Add unicode support for strong/em regex.

This commit is contained in:
Kane Cohen 2014-01-29 10:30:21 +00:00
parent 215ff63594
commit 55f360a591
1 changed files with 9 additions and 9 deletions

View File

@ -1068,23 +1068,23 @@ class Parsedown
# Read-only # Read-only
private static $strong_regex = array( private static $strong_regex = array(
'*' => '/^[*]{2}([^*]+?)[*]{2}(?![*])/s', '*' => '/^[*]{2}([^*]+?)[*]{2}(?![*])/us',
'_' => '/^__([^_]+?)__(?!_)/s', '_' => '/^__([^_]+?)__(?!_)/us',
); );
private static $em_regex = array( private static $em_regex = array(
'*' => '/^[*]([^*]+?)[*](?![*])/s', '*' => '/^[*]([^*]+?)[*](?![*])/us',
'_' => '/^_([^_]+?)[_](?![_])\b/s', '_' => '/^_([^_]+?)[_](?![_])\b/us',
); );
private static $strong_em_regex = array( private static $strong_em_regex = array(
'*' => '/^[*]{2}(.*?)[*](.+?)[*](.*?)[*]{2}/s', '*' => '/^[*]{2}(.*?)[*](.+?)[*](.*?)[*]{2}/us',
'_' => '/^__(.*?)_(.+?)_(.*?)__/s', '_' => '/^__(.*?)_(.+?)_(.*?)__/us',
); );
private static $em_strong_regex = array( private static $em_strong_regex = array(
'*' => '/^[*](.*?)[*]{2}(.+?)[*]{2}(.*?)[*]/s', '*' => '/^[*](.*?)[*]{2}(.+?)[*]{2}(.*?)[*]/us',
'_' => '/^_(.*?)__(.+?)__(.*?)_/s', '_' => '/^_(.*?)__(.+?)__(.*?)_/us',
); );
private static $special_characters = array( private static $special_characters = array(
@ -1102,4 +1102,4 @@ class Parsedown
'span', 'span',
'time', 'time',
); );
} }