Fixed some emphasis corner-cases.

This commit is contained in:
Michel Fortin 2009-10-10 08:50:41 -04:00
parent 221e41a280
commit 8dcbb993ec
2 changed files with 11 additions and 9 deletions

View file

@ -245,6 +245,8 @@ Version History
* Fixed a bug where tags where the name contains an underscore aren't parsed
correctly.
* Fixed some corner-cases mixing underscore-ephasis and asterisk-emphasis.
1.0.1m (21 Jun 2008):

View file

@ -1117,19 +1117,19 @@ class Markdown_Parser {
var $em_relist = array(
'' => '(?:(?<!\*)\*(?!\*)|(?<!_)_(?!_))(?=\S)(?![.,:;]\s)',
'*' => '(?<=\S)(?<!\*)\*(?!\*)',
'_' => '(?<=\S)(?<!_)_(?!_)',
'' => '(?:(?<!\*)\*(?!\*)|(?<!_)_(?!_))(?=\S|$)(?![.,:;]\s)',
'*' => '(?<=\S|^)(?<!\*)\*(?!\*)',
'_' => '(?<=\S|^)(?<!_)_(?!_)',
);
var $strong_relist = array(
'' => '(?:(?<!\*)\*\*(?!\*)|(?<!_)__(?!_))(?=\S)(?![.,:;]\s)',
'**' => '(?<=\S)(?<!\*)\*\*(?!\*)',
'__' => '(?<=\S)(?<!_)__(?!_)',
'' => '(?:(?<!\*)\*\*(?!\*)|(?<!_)__(?!_))(?=\S|$)(?![.,:;]\s)',
'**' => '(?<=\S|^)(?<!\*)\*\*(?!\*)',
'__' => '(?<=\S|^)(?<!_)__(?!_)',
);
var $em_strong_relist = array(
'' => '(?:(?<!\*)\*\*\*(?!\*)|(?<!_)___(?!_))(?=\S)(?![.,:;]\s)',
'***' => '(?<=\S)(?<!\*)\*\*\*(?!\*)',
'___' => '(?<=\S)(?<!_)___(?!_)',
'' => '(?:(?<!\*)\*\*\*(?!\*)|(?<!_)___(?!_))(?=\S|$)(?![.,:;]\s)',
'***' => '(?<=\S|^)(?<!\*)\*\*\*(?!\*)',
'___' => '(?<=\S|^)(?<!_)___(?!_)',
);
var $em_strong_prepared_relist;