1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

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

View File

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