Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #56120, comment 2


Ignore:
Timestamp:
07/05/2022 05:23:50 AM (2 years ago)
Author:
costdev
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #56120, comment 2

    initial v1  
    11> To be thorough, the line break could match `<br` (the tag might be `<br>`, `<br/>` or `<br />`—and it could have an attribute).
    22
    3 This pattern seems to do the trick: `/(\s)?<br(.*?)>(\s)?/`. [https://3v4l.org/XWjQo 3v4l].
     3This pattern and a `trim()` for leading/trailing `<br>` tags seems to do the trick: `/(\s)?<br(.*?)>(\s)?/`. [https://3v4l.org/o4elT 3v4l].
    44
    55I'm not sure of inappropriate cases either, so I'd be interested in second opinions on this.