largo_remove_hero does not remove duplicate heroes on Gutenberg content. #1834
Labels
category: gutenberg
Relating to general Gutenberg compatibility
priority: normal
Must be completed before release of this version of plugin.
type: bug
type: question
type: tech debt
For necessary updates because code is old
https://github.com/INN/largo/blob/512da701664b329f2f92244bbe54880a6e146431/inc/post-templates.php#L191-L204
In situations where the first block on a post is an image block, the first paragraph of the post is not the image tag. It's a comment.
as a post content will be passed through the filter.
$p[0]
is'<!-- wp:image {"id":4923609,"className":"size-large wp-image-4923609"} -->'
, not an image that matches the regex.Even if we adjusted this algorithm to skip the opening comment, and to treat figcaptions like the paragraph tag, we're edging into the dangerous territory for parsing HTML with regular expressions. https://stackoverflow.com/a/1732454
The text was updated successfully, but these errors were encountered: