bobbingwide / oik-shortcodes

Shortcode, block and API server
https://www.oik-plugins.com/oik-plugins/oik-shortcode-server/
GNU General Public License v2.0
1 stars 0 forks source link

oik_get_the_excerpt needs to allow for Gutenberg comments #59

Closed bobbingwide closed 5 years ago

bobbingwide commented 6 years ago

The oik_get_the_excerpt function uses simple logic to check for a <!--more--> tag in the content. It doesn't work when the content is generated using Gutenberg and therefore contains lots of HTML comments.

So, for a post containing

<!-- wp:paragraph -->
<p>Just like many other companies around the world we've been updating our Privacy policies both for our websites and our internal business procedures.<br/>
</p>
<!-- /wp:paragraph -->

<!-- wp:more -->
<!--more-->
<!-- /wp:more -->
...
and then a lot more stuff

we get more than we expected.

Expected output

Just the excerpt, before the <!--more--> HTML comment.

Actual output

The whole content.