-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sanitize HTML attributes that come from extended attributes. Fixes #114.
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Make sure extended attributes get escaped when generating HTML: https://github.com/bhollis/maruku/issues/114 | ||
*** Parameters: *** | ||
{} # params | ||
*** Markdown input: *** | ||
*foo*{: style='ball & chain'} | ||
|
||
*foo*{: style='ball\008 chain'} | ||
|
||
*foo*{: style='ball\" badAttribute=\"chain'} | ||
*** Output of inspect *** | ||
md_el(:document, [ | ||
md_par(md_em("foo", [["style", "ball & chain"]])), | ||
md_par(md_em("foo", [["style", "ball\\008 chain"]])), | ||
md_par(md_em("foo", [["style", "ball\" badAttribute=\"chain"]])) | ||
]) | ||
*** Output of to_html *** | ||
<p><em style="ball & chain">foo</em> | ||
</p> | ||
<p><em style="ball\008 chain">foo</em> | ||
</p> | ||
<p><em style="ball" badAttribute="chain">foo</em> | ||
</p> |
7363179
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to remove illegal characters (like U+0008), rather than allow them through.
7363179
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More sanitization added in 1911554.