Jekyll post.content output is surrounded by <p> tag

jekyll, liquid

Solution

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!

Problem

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.

Original source