Fix for unencoded " in footnote ids.

This commit is contained in:
Michel Fortin 2008-06-05 23:07:43 -04:00
parent ff5ad6b9d6
commit 25941e626b
2 changed files with 9 additions and 3 deletions

View file

@ -207,7 +207,10 @@ Version History
Current Extra:
* Fixed a bug where characters such as `"` in abbreviation
definitions weren't properly escaped in the generated HTML.
definitions weren't properly encoded to HTML entities.
* Fixed a bug where double quotes `"` were not correctly encoded
as HTML entities when used inside a footnote reference id.
Extra 1.2.1 (27 May 2008):

View file

@ -2588,10 +2588,11 @@ class MarkdownExtra_Parser extends Markdown_Parser {
$footnote = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}',
array(&$this, '_appendFootnotes_callback'), $footnote);
$attr2 = str_replace("%%", ++$num, $attr);
$attr = str_replace("%%", ++$num, $attr);
$note_id = $this->encodeAttribute($note_id);
# Add backlink to last paragraph; create new paragraph if needed.
$backlink = "<a href=\"#fnref:$note_id\"$attr2>&#8617;</a>";
$backlink = "<a href=\"#fnref:$note_id\"$attr>&#8617;</a>";
if (preg_match('{</p>$}', $footnote)) {
$footnote = substr($footnote, 0, -4) . "&#160;$backlink</p>";
} else {
@ -2630,7 +2631,9 @@ class MarkdownExtra_Parser extends Markdown_Parser {
$title = $this->encodeAttribute($title);
$attr .= " title=\"$title\"";
}
$attr = str_replace("%%", $num, $attr);
$node_id = $this->encodeAttribute($node_id);
return
"<sup id=\"fnref:$node_id\">".