[wp-trac] [WordPress Trac] #2833: wpautop breaks style and script tags

WordPress Trac noreply at wordpress.org
Fri Mar 28 03:27:53 UTC 2014


#2833: wpautop breaks style and script tags
-------------------------------+-----------------------------
 Reporter:  Nazgul             |       Owner:
     Type:  defect (bug)       |      Status:  reopened
 Priority:  low                |   Milestone:  Future Release
Component:  Formatting         |     Version:  2.0.3
 Severity:  normal             |  Resolution:
 Keywords:  wpautop has-patch  |     Focuses:
-------------------------------+-----------------------------
Changes (by cmmarslender):

 * keywords:  needs-patch needs-unit-tests wpautop => wpautop has-patch


Comment:

 Added a patch that addresses the issues with the contents of 'script' tags
 being altered. Uses the same method that was used to prevent the contents
 of 'pre' tags (removing the actual contents of the tag, and replacing with
 a placeholder). Abstracted the code that replaces the tags into its own
 helper function, so that there isn't a ton of nearly-identical code inside
 of wpautop()

 Also added a unit test to check the 'script' case - based on the unit
 tests for 'pre' case.
 Tested with groups 2833 (my tests) and 19855 (existing tests for 'pre'
 tags) and they both passed.

 This could conceivably be used in the future for other things that should
 not have the inner contents modified, such as 'style' tags - maybe others?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/2833#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list