Opened 8 years ago
Last modified 3 months ago
#39847 new defect (bug)
force_balance_tags not properly balancing < with <strong> and </strong>
Reported by: | jpmerx | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 4.7.2 |
Component: | Formatting | Keywords: | |
Focuses: | ui | Cc: |
Description
Given following HMTL code which includes the \[ and \] Latex delimiters:
\[<\] <strong>We</strong>
the output of force_balance_tags is
\[<\] <strong>We
which is not correct as the bold tags are unbalanced. Expected output should be the input string.
Change History (2)
#1
@
8 years ago
- Summary changed from force_balance_tags not properly balancing < in \[\] block to force_balance_tags not properly balancing < with <strong> and </strong>
#2
@
3 months ago
@jpmerx I'm looking at replacing the internal logic of force_balance_tags()
to rely on the new WP_HTML_Processor::normalize()
method. That seems to resolve these issues.
<?php echo force_balance_tags( '\[<\] <strong>We</strong>' ); // \[<\] <strong>We</strong> echo force_balance_tags( '< <strong>We</strong>' ); // < <strong>We</strong>
Note: See
TracTickets for help on using
tickets.
I found an even simple string producing the error.
For following HMTL code which includes the < symbol:
the output of force_balance_tags is
which is not correct as the bold tags are unbalanced. Expected output should be the input string.