id summary reporter owner description type status priority milestone component version severity resolution keywords cc focuses
44571 force_balance_tags breaks JavaScript yellowafterlife "Input:
{{{
console.log(""extest:"", 0<=1);')
?>
}}}
Output:
{{{
}}}
(no longer valid JavaScript)
Context:
I use tiny (<20KB) JS programs for interactive illustrations inside tutorials on a WP blog. These would most commonly break on pages where excerpts are shown (post list, search) and it took a little while to narrow this down to force_balance_tags running for !--more splitter in get_the_content.
Workarounds: enclosing JS code in a comment
{{{
}}}
which is a legacy part of spec https://html.spec.whatwg.org/multipage/scripting.html#restrictions-for-contents-of-script-elements
Could the script-tags be treated like the comments in this regard? This is a rather unobvious behaviour." defect (bug) new normal Awaiting Review Shortcodes 4.9.7 normal