Unbalanced tags with excerpt_strip=no parameter
-
In order to retain formatting of an excerpt, your plugin allows for the “excerpt_strip=no” parameter. This results in excerpt code that retains the HTML tags. This introduces a bug when the excerpt is terminated (at maximum word length) in the middle of an HTML tag. So, for example, if the excerpt contains a “P” tag, or a “DIV” tag and the excerpt ends, there is a missing “END-P” or “END-DIV” tag that causes the output formatting to get all messed up.
There needs to be a function that parses the excerpt output, pushing and popping the various tags onto a stack so that, at the end of processing the excerpt, any remaining tags in the stack will have a corresponding “END-TAG” appended to the end of the excerpt.
- The topic ‘Unbalanced tags with excerpt_strip=no parameter’ is closed to new replies.