// Support: IE <=10 - 11+
// In IE using regex groups here causes severe slowdowns.
- rnoInnerhtml = /<script|<style|<link/i,
-
- rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
+ rnoInnerhtml = /<script|<style|<link/i;
// Prefer a tbody over its parent table for containing new rows
function manipulationTarget( elem, content ) {
}, doc );
}
} else {
- DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
+ DOMEval( node.textContent, node, doc );
}
}
}
"</script>"
].join( "\n" ) ).appendTo( "#qunit-fixture" );
+ // This test requires XHTML mode as CDATA is not recognized in HTML.
+ // jQuery( [
+ // "<script type='text/javascript'>",
+ // "<![CDATA[",
+ // "QUnit.assert.ok( true, '<![CDATA[ handled' );",
+ // "//]]>",
+ // "</script>"
+ // ].join( "\n" ) ).appendTo( "#qunit-fixture" );
+
jQuery( [
"<script type='text/javascript'>",
- "<![CDATA[",
- "QUnit.assert.ok( true, '<![CDATA[ handled' );",
- "//]]>",
+ "<!--//--><![CDATA[//><!--",
+ "QUnit.assert.ok( true, '<!--//--><![CDATA[//><!-- (Drupal case) handled' );",
+ "//--><!]]>",
"</script>"
].join( "\n" ) ).appendTo( "#qunit-fixture" );
+ // ES2015 in Annex B requires HTML-style comment delimiters (`<!--` & `-->`) to act as
+ // single-line comment delimiters; i.e. they should be treated as `//`.
+ // See gh-4904
jQuery( [
"<script type='text/javascript'>",
- "<!--//--><![CDATA[//><!--",
- "QUnit.assert.ok( true, '<!--//--><![CDATA[//><!-- (Drupal case) handled' );",
- "//--><!]]>",
+ "<!-- Same-line HTML comment",
+ "QUnit.assert.ok( true, '<!-- Same-line HTML comment' );",
+ "-->",
"</script>"
].join( "\n" ) ).appendTo( "#qunit-fixture" );
} );