I assume, because your page.content already has <p>Content</p>
If you were to look at the proper source instead of inspector, I’d bet you will see something like <p><p>Content</p></p>. Inspector/Browser closes tags for you, that’s why you see <p></p><p>Content</p><p></p>, because <p> is not allowed inside another <p>
Could you dump your content|raw and see what’s there? I believe Grav wraps every paragraph into <p/> - and that would make sense, because otherwise you wouldn’t have a separation between your content paragraphs
Routed to page /blog (type: blog)
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. </p>
Without p tag, it shows correctly the paragraph, but with p tag, it still shows two paragraphs.
This is the source in browser:
<p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed convallis venenatis vehicula. Morbi ultrices finibus neque, ac vestibulum ante pharetra cursus. Nullam faucibus leo non dui porttitor, a sodales quam pharetra. Aliquam viverra, purus sit amet dictum rhoncus, sapien arcu vestibulum lacus, a...
</p>
</p>
If I write the text in Editor with <p>any text here
Not that I know of. Also can’t find anything quickly by looking at the code.
What’s your use case, if I might ask? I don’t see any benefit of not wrapping it. Maybe you should consider using other (custom) input rather than content then?
The problem is that I am customizing a theme in which its P tag comes with some defined css classes. I don’t want to use those classes, so I must use my own. If I do this, and in the Twig code I write something like <p class ="custom"> Text </p>, Grav wraps it in another additional <p> tag, making it have two paragraphs, and in this case the <p> tag has a large padding, causing two very separate paragraphs to appear.
I don’t know if I have explained myself very well, but that is more or less the problem.
I don’t think this will work on page.content, because it’s always parsed. Even if it worked, then you wouldn’t get paragraphs separated. I see only two options here: