…ents or CDATA surrounding executed scripts. Unit tests added.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -29,7 +29,7 @@ var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figca | ||
// checked="checked" or checked | ||
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, | ||
rscriptType = /\/(java|ecma)script/i, | ||
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/, | ||
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g, | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
gnarf
Member
|
||
wrapMap = { | ||
option: [ 1, "<select multiple='multiple'>", "</select>" ], | ||
legend: [ 1, "<fieldset>", "</fieldset>" ], | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<script> | ||
<!-- | ||
ok( true, "script within html comments executed" ); | ||
This comment has been minimized.
Sorry, something went wrong.
dmethvin
Member
|
||
--> | ||
</script> | ||
<script> | ||
<![CDATA[ | ||
ok( true, "script within CDATA executed" ); | ||
]]> | ||
</script> |
I don't think any of the
-
need escapng here:/^\s*<!(?:\[CDATA\[|--)|[\]-]{2}>\s*$/g
The first two have no special meaning outside of
[]
and the third one, so long as the hyphen is the first or last character inside of a[]
it doesn't need to be escaped either.