Quantcast
Channel: Topic Tag: xml | WordPress.org
Viewing all articles
Browse latest Browse all 3201

Chen-Pang He on "Stop converting `]]>`s to `]]& gt;`s"

$
0
0

I have to separate & and gt to prevent from being converted.

I write polygot (X)HTML. Therefore, there are many necessary CDATAs in scripts. However, WordPress converts ]]>s into ]]& gt;s, and this is unstoppable because it is not a filter.

See wp-includes/post-template.php:167

We may disagree on that which should be the default behavior, but why not make it a filter? If it were a filter,

1. I can remove it or use another filter to make it up.
2. This makes code more maintainable.

Nevertheless, it is hard-coded and runs after all filters. The only solution is to modify wp-includes/post-template.php, and I have to remember this after each update.

This issue has been here for over 3 years, but it is easy to fix.


Viewing all articles
Browse latest Browse all 3201

Trending Articles