When I print the content of the post with
{{ post.content }}
It is outputted like:
<p>Lorem ipsum...</p>
How can I remove the <p>
tag when generated. I need it to be removed before JavaScript starts to process the DOM.
Jekyll automatically wraps content in p
tags. You can remove those tags with a liquid command. Per Jekyll's documentation:
Because Jekyll grabs the first paragraph you will not need to wrap the excerpt in p tags, which is already done for you. These tags can be removed with the following if you’d prefer:
{{ post.excerpt | remove: '<p>' | remove: '</p>' }}
Hope this helps!
I changed the post file's extension from .md to plain old .html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With