-
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.
Escape CDATA inserted into script/style tags so they still parse in R…
…EXML and work in browsers. The output is pretty ugly, but at least these tags will now work without crashing REXML or nuking the script/style. Fixes issue #120.
- Loading branch information
Showing
4 changed files
with
100 additions
and
13 deletions.
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
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,54 @@ | ||
Style tags should be OK with unescaped angle brackets and ampersands. https://github.com/bhollis/maruku/issues/120 | ||
NOTE: Commented CDATA is output because we use XHTML - for HTML mode it should be omitted. | ||
*** Parameters: *** | ||
{} | ||
*** Markdown input: *** | ||
<style type="text/css"> | ||
p > .highlight { | ||
color: red; | ||
background-image: url('/foo?bar&baz'); | ||
} | ||
</style> | ||
|
||
<style type="text/css">/*<![CDATA[*/ | ||
p > .highlight { | ||
color: red; | ||
background-image: url('/foo?bar&baz'); | ||
} | ||
/*]]>*/</style> | ||
|
||
<style type="text/css"> | ||
/*<![CDATA[*/ | ||
p > .highlight { | ||
color: red; | ||
background-image: url('/foo?bar&baz'); | ||
} | ||
/*]]>*/ | ||
</style> | ||
*** Output of inspect *** | ||
|
||
*** Output of to_html *** | ||
<style type='text/css'>/*<![CDATA[*/ | ||
|
||
p > .highlight { | ||
color: red; | ||
background-image: url('/foo?bar&baz'); | ||
} | ||
|
||
/*]]>*/</style><style type='text/css'>/*<![CDATA[*/ | ||
/*<![CDATA[*/ | ||
p > .highlight { | ||
color: red; | ||
background-image: url('/foo?bar&baz'); | ||
} | ||
/**/ | ||
/*]]>*/</style><style type='text/css'>/*<![CDATA[*/ | ||
|
||
/*<![CDATA[*/ | ||
p > .highlight { | ||
color: red; | ||
background-image: url('/foo?bar&baz'); | ||
} | ||
/**/ | ||
|
||
/*]]>*/</style> |
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