Fixed issue with unencoded tags inside code blocks.

This commit is contained in:
Michel Fortin 2012-01-08 10:00:25 -05:00
parent a2d66b9c58
commit beb25bca80
2 changed files with 12 additions and 9 deletions

View file

@ -216,6 +216,9 @@ Latest Extra:
* Fixed an issue preventing fenced code blocks indented inside lists items
and elsewhere from being interpreted correctly.
* Fixed an issue where HTML tags inside fenced code blocks were sometime
not encoded with entities.
1.0.1n (10 Oct 2009):

View file

@ -1947,17 +1947,9 @@ class MarkdownExtra_Parser extends Markdown_Parser {
}
}
#
# Check for: Indented code block.
#
else if ($tag{0} == "\n" || $tag{0} == " ") {
# Indented code block: pass it unchanged, will be handled
# later.
$parsed .= $tag;
}
#
# Check for: Fenced code block marker.
#
else if ($tag{0} == "~") {
else if (preg_match('{^\n?[ ]{0,'.($indent+3).'}~}', $tag)) {
# Fenced code block marker: find matching end marker.
$tag_re = preg_quote(trim($tag));
if (preg_match('{^(?>.*\n)+?[ ]{0,'.($indent).'}'.$tag_re.'[ ]*\n}', $text,
@ -1973,6 +1965,14 @@ class MarkdownExtra_Parser extends Markdown_Parser {
}
}
#
# Check for: Indented code block.
#
else if ($tag{0} == "\n" || $tag{0} == " ") {
# Indented code block: pass it unchanged, will be handled
# later.
$parsed .= $tag;
}
#
# Check for: Opening Block level tag or
# Opening Context Block tag (like ins and del)
# used as a block tag (tag is alone on it's line).