Fix for unencoded " in footnote ids.
This commit is contained in:
parent
ff5ad6b9d6
commit
25941e626b
2 changed files with 9 additions and 3 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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>↩</a>";
|
||||
$backlink = "<a href=\"#fnref:$note_id\"$attr>↩</a>";
|
||||
if (preg_match('{</p>$}', $footnote)) {
|
||||
$footnote = substr($footnote, 0, -4) . " $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\">".
|
||||
|
|
|
|||
Loading…
Reference in a new issue