I am running into an issue with Gutenberg where I want to display the excerpt of a post, even when the excerpt field isn't filled in. Usually the functionality of WordPress is when the excerpt is empty to grab the first few lines of text from the content editor. With Gutenberg however when it does that it injects the page with additional HTML Elements, mainly p tags, screwing up the rest of the page.
If I add an excerpt manually in that post's excerpt field this issue is resolved and additional HTML elements aren't injected. But I can't rely on my client to always fill out the excerpt field, so I am trying to find a solution where I can use:
And if the excerpt field isn't filled out pull just text from the Gutenberg editor and not additional HTML elements. I assume this issue is with how Gutenberg works with the content editor containing everything in one.
Has anyone else ran into this issue and knows of a solution for this?