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

Compare commits

...

4 Commits

Author SHA1 Message Date
e8d8801db4 resolve #135 2014-05-01 02:44:35 +03:00
521803cdcd resolve #136 2014-05-01 02:42:01 +03:00
0eb480324c resolve #145 2014-05-01 02:02:14 +03:00
7c78aff578 resolve #163 2014-05-01 01:47:14 +03:00
3 changed files with 15 additions and 8 deletions

View File

@ -418,7 +418,7 @@ class Parsedown
protected function identifyFencedCode($Line) protected function identifyFencedCode($Line)
{ {
if (preg_match('/^(['.$Line['text'][0].']{3,})[ ]*(\w+)?[ ]*$/', $Line['text'], $matches)) if (preg_match('/^(['.$Line['text'][0].']{3,})[ ]*([\w-]+)?[ ]*$/', $Line['text'], $matches))
{ {
$Element = array( $Element = array(
'name' => 'code', 'name' => 'code',
@ -593,6 +593,8 @@ class Parsedown
if (isset($Block['interrupted'])) if (isset($Block['interrupted']))
{ {
$Block['element']['text'] []= ''; $Block['element']['text'] []= '';
unset($Block['interrupted']);
} }
$Block['element']['text'] []= $matches[1]; $Block['element']['text'] []= $matches[1];
@ -1069,7 +1071,7 @@ class Parsedown
protected function identifyEmailTag($excerpt) protected function identifyEmailTag($excerpt)
{ {
if (strpos($excerpt, '>') !== false and preg_match('/<(\S+?@\S+?)>/', $excerpt, $matches)) if (strpos($excerpt, '>') !== false and preg_match('/^<(\S+?@\S+?)>/', $excerpt, $matches))
{ {
return array( return array(
'extent' => strlen($matches[0]), 'extent' => strlen($matches[0]),
@ -1333,12 +1335,12 @@ class Parsedown
protected $textLevelElements = array( protected $textLevelElements = array(
'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont', 'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont',
'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing', 'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing',
'i', 'rp', 'sub', 'code', 'strike', 'marquee', 'i', 'rp', 'del', 'code', 'strike', 'marquee',
'q', 'rt', 'sup', 'font', 'strong', 'q', 'rt', 'ins', 'font', 'strong',
's', 'tt', 'var', 'mark', 's', 'tt', 'sub', 'mark',
'u', 'xm', 'wbr', 'nobr', 'u', 'xm', 'sup', 'nobr',
'ruby', 'var', 'ruby',
'span', 'wbr', 'span',
'time', 'time',
); );
} }

View File

@ -1,4 +1,6 @@
<blockquote> <blockquote>
<p>quote <p>quote
the rest of it</p> the rest of it</p>
<p>another paragraph
the rest of it</p>
</blockquote> </blockquote>

View File

@ -1,2 +1,5 @@
> quote > quote
the rest of it
> another paragraph
the rest of it the rest of it