WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #2833, comment 37


Ignore:
Timestamp:
04/23/2019 08:38:09 PM (9 months ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #2833, comment 37

    initial v1  
    1111
    1212That would mean they will always be "pulled out" on a new line, even when inside other tags. That may result in unwanted `<p>` after `</script>`. Another option would be to remove leading line breaks before `<script...>`. This can still bring edge cases but perhaps less often. Not really sure what's the "lesser evil" here :)
     13
     14Perhaps a more "proper" solution would be to use the method from 2833.2.diff but have two "script tag placeholders":
     15- One for use when the script tags have line breaks both before and after. This placeholder will be in `allblocks` so it's not wrapped in <p>.
     16- Another for "inline" script tags.
     17
     18Then the regex that replaces the tags will need to look at "white space" before and after the script tags to determine which placeholder to use.