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 # 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(