Simplified strong/emphasis regexps
(?<=\S|^) becomes (?<!\s) (?=\S|$) becomes (?!\s) (?<!\s)(?<!\*) becomes (?<![\s*]) (?<!\s)(?<!_) becomes (?<![\s_]) (?!\s)(?![\.,:;]\s) becomes (?![\.,:;]?\s)
This commit is contained in:
parent
6f952ee180
commit
c44cf320c1
1 changed files with 18 additions and 18 deletions
|
|
@ -979,19 +979,19 @@ class Markdown implements MarkdownInterface {
|
|||
|
||||
|
||||
protected $em_relist = array(
|
||||
'' => '(?:(?<!\*)\*(?!\*)|(?<!_)_(?!_))(?=\S|$)(?![\.,:;]\s)',
|
||||
'*' => '(?<=\S|^)(?<!\*)\*(?!\*)',
|
||||
'_' => '(?<=\S|^)(?<!_)_(?!_)',
|
||||
'' => '(?:(?<!\*)\*(?!\*)|(?<!_)_(?!_))(?![\.,:;]?\s)',
|
||||
'*' => '(?<![\s*])\*(?!\*)',
|
||||
'_' => '(?<![\s_])_(?!_)',
|
||||
);
|
||||
protected $strong_relist = array(
|
||||
'' => '(?:(?<!\*)\*\*(?!\*)|(?<!_)__(?!_))(?=\S|$)(?![\.,:;]\s)',
|
||||
'**' => '(?<=\S|^)(?<!\*)\*\*(?!\*)',
|
||||
'__' => '(?<=\S|^)(?<!_)__(?!_)',
|
||||
'' => '(?:(?<!\*)\*\*(?!\*)|(?<!_)__(?!_))(?![\.,:;]?\s)',
|
||||
'**' => '(?<![\s*])\*\*(?!\*)',
|
||||
'__' => '(?<![\s_])__(?!_)',
|
||||
);
|
||||
protected $em_strong_relist = array(
|
||||
'' => '(?:(?<!\*)\*\*\*(?!\*)|(?<!_)___(?!_))(?=\S|$)(?![\.,:;]\s)',
|
||||
'***' => '(?<=\S|^)(?<!\*)\*\*\*(?!\*)',
|
||||
'___' => '(?<=\S|^)(?<!_)___(?!_)',
|
||||
'' => '(?:(?<!\*)\*\*\*(?!\*)|(?<!_)___(?!_))(?![\.,:;]?\s)',
|
||||
'***' => '(?<![\s*])\*\*\*(?!\*)',
|
||||
'___' => '(?<![\s_])___(?!_)',
|
||||
);
|
||||
protected $em_strong_prepared_relist;
|
||||
|
||||
|
|
@ -2837,19 +2837,19 @@ abstract class _MarkdownExtra_TmpImpl extends \Michelf\Markdown {
|
|||
# work in the middle of a word.
|
||||
#
|
||||
protected $em_relist = array(
|
||||
'' => '(?:(?<!\*)\*(?!\*)|(?<![a-zA-Z0-9_])_(?!_))(?=\S|$)(?![\.,:;]\s)',
|
||||
'*' => '(?<=\S|^)(?<!\*)\*(?!\*)',
|
||||
'_' => '(?<=\S|^)(?<!_)_(?![a-zA-Z0-9_])',
|
||||
'' => '(?:(?<!\*)\*(?!\*)|(?<![a-zA-Z0-9_])_(?!_))(?![\.,:;]?\s)',
|
||||
'*' => '(?<![\s*])\*(?!\*)',
|
||||
'_' => '(?<![\s_])_(?![a-zA-Z0-9_])',
|
||||
);
|
||||
protected $strong_relist = array(
|
||||
'' => '(?:(?<!\*)\*\*(?!\*)|(?<![a-zA-Z0-9_])__(?!_))(?=\S|$)(?![\.,:;]\s)',
|
||||
'**' => '(?<=\S|^)(?<!\*)\*\*(?!\*)',
|
||||
'__' => '(?<=\S|^)(?<!_)__(?![a-zA-Z0-9_])',
|
||||
'' => '(?:(?<!\*)\*\*(?!\*)|(?<![a-zA-Z0-9_])__(?!_))(?![\.,:;]?\s)',
|
||||
'**' => '(?<![\s*])\*\*(?!\*)',
|
||||
'__' => '(?<![\s_])__(?![a-zA-Z0-9_])',
|
||||
);
|
||||
protected $em_strong_relist = array(
|
||||
'' => '(?:(?<!\*)\*\*\*(?!\*)|(?<![a-zA-Z0-9_])___(?!_))(?=\S|$)(?![\.,:;]\s)',
|
||||
'***' => '(?<=\S|^)(?<!\*)\*\*\*(?!\*)',
|
||||
'___' => '(?<=\S|^)(?<!_)___(?![a-zA-Z0-9_])',
|
||||
'' => '(?:(?<!\*)\*\*\*(?!\*)|(?<![a-zA-Z0-9_])___(?!_))(?![\.,:;]?\s)',
|
||||
'***' => '(?<![\s*])\*\*\*(?!\*)',
|
||||
'___' => '(?<![\s_])___(?![a-zA-Z0-9_])',
|
||||
);
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue