Opened 10 years ago
Last modified 2 years ago
#39847 new defect (bug)
force_balance_tags not properly balancing < with <strong> and </strong>
| Reported by: | jpmerx | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Formatting | Version: | 4.7.2 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: | ui |
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
@
10 years ago
- Summary force_balance_tags not properly balancing < in \[\] block → force_balance_tags not properly balancing < with <strong> and </strong>
Version 0, edited 10 years ago by
(next)
#2
@
2 years 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I found an even simple string producing the error.
For following HMTL code which includes the \[ and \] Latex delimiters:
the output of force_balance_tags is
which is not correct as the bold tags are unbalanced. Expected output should be the input string.