-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
largo_remove_hero does not remove duplicate heroes on Gutenberg content. #1834
Comments
If we want to fix this parser:
If we don't want to fix the parser:
|
Personally, I'm in favor of the deprecation technique. By removing Largo Featured Media in favor of Gutenberg, sites will have more editorial control over how the media displays in their posts, with the same level of control over whether it displays at all. Getting rid of the featured media output would also bring Largo's existing templates closer to the "Blank Slate" template described in #1663 |
https:/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: