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

parse_inline_elements » parse_span_elements to match the specs

This commit is contained in:
Emanuil Rusev 2013-11-16 11:53:25 +02:00
parent 38300323a6
commit 5fa3eb1b2f

View File

@ -468,7 +468,7 @@ class Parsedown
case 'p': case 'p':
$text = $this->parse_inline_elements($element['text']); $text = $this->parse_span_elements($element['text']);
$text = preg_replace('/[ ]{2}\n/', '<br />'."\n", $text); $text = preg_replace('/[ ]{2}\n/', '<br />'."\n", $text);
@ -510,7 +510,7 @@ class Parsedown
case 'h.': case 'h.':
$text = $this->parse_inline_elements($element['text']); $text = $this->parse_span_elements($element['text']);
$markup .= '<h'.$element['level'].'>'.$text.'</h'.$element['level'].'>'."\n"; $markup .= '<h'.$element['level'].'>'.$text.'</h'.$element['level'].'>'."\n";
@ -531,7 +531,7 @@ class Parsedown
return $markup; return $markup;
} }
private function parse_inline_elements($text) private function parse_span_elements($text)
{ {
$map = array(); $map = array();
@ -584,7 +584,7 @@ class Parsedown
} }
else else
{ {
$element_text = $this->parse_inline_elements($matches[3]); $element_text = $this->parse_span_elements($matches[3]);
$element = '<a href="'.$url.'">'.$element_text.'</a>'; $element = '<a href="'.$url.'">'.$element_text.'</a>';
} }
@ -625,7 +625,7 @@ class Parsedown
} }
else # anchor else # anchor
{ {
$element_text = $this->parse_inline_elements($matches[2]); $element_text = $this->parse_span_elements($matches[2]);
$element = '<a href="'.$url.'">'.$element_text.'</a>'; $element = '<a href="'.$url.'">'.$element_text.'</a>';
} }