[wp-trac] [WordPress Trac] #58366: Shortcode Support Regained but Content Filters are messing with Shortcode HTML
WordPress Trac
noreply at wordpress.org
Mon May 22 18:23:48 UTC 2023
#58366: Shortcode Support Regained but Content Filters are messing with Shortcode
HTML
-------------------------------------------------+-------------------------
Reporter: domainsupport | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting
| Review
Component: Shortcodes | Version: 6.2.2
Severity: normal | Resolution:
Keywords: needs-testing has-testing-info | Focuses:
needs-unit-tests |
-------------------------------------------------+-------------------------
Comment (by Ov3rfly):
Another use case similar to @davidsjptimoney, javascript snippets added
via ACF field.
We have not (yet) the problem described here, but obviously only due to
(still) use of classic theme instead of (planned) block theme.
We can not simply strip `\n` and `\r` from code as our javascript snippets
also contain lines with `//` javascript comments similar to example here:
https://stackoverflow.com/q/65274912
{{{
<script>
// Set to the same value as the web property used on the site
var gaProperty = 'UA-XXXX-Y';
// Disable tracking if the opt-out cookie exists.
var disableStr = 'ga-disable-' + gaProperty;
if (document.cookie.indexOf(disableStr + '=true') > -1) {
window[disableStr] = true;
}
// Opt-out function
function gaOptout() {
document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59
UTC; path=/';
window[disableStr] = true;
}
</script>
}}}
These kind of code snippets with `//` javascript comments lines are widely
in use and need their linefeeds present.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/58366#comment:26>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list