Why does Tumblr strip p tags from posts?
I noticed that Tumblr strips <p> tags from posts, but only when it's the only paragraph in the post. For example, if I post a link and I put this in the description:
It gets rendered in my template without the <p> tags.
But if there's more than one paragraph, or if there are any other block-level elements in the post, then none of them get stripped out.
Why does it do this? It's annoying me a bit because I can't make my template and my posts look just the way I want. If I put the <p> tags myself in the template, like this:
Then I would end up with stuff nested inside that <p> tag if I wrote a post with more than one paragraph. If I don't put the <p> tag in the template, I end up with unstyled text when the post is just one paragraph.
It would be nice if the template rendered my text exactly as I wrote it, without stripping any tags.
<p>This is the description of my link.</p>
It gets rendered in my template without the <p> tags.
But if there's more than one paragraph, or if there are any other block-level elements in the post, then none of them get stripped out.
Why does it do this? It's annoying me a bit because I can't make my template and my posts look just the way I want. If I put the <p> tags myself in the template, like this:
{block:Description}
<p>{Description}</p>
{/block:Description}
Then I would end up with stuff nested inside that <p> tag if I wrote a post with more than one paragraph. If I don't put the <p> tag in the template, I end up with unstyled text when the post is just one paragraph.
It would be nice if the template rendered my text exactly as I wrote it, without stripping any tags.
3
people have this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?I think that post sounds harsher than I intended. I should mention that I love the platform, this is my only complaint about it, and I'll definitely try to go Pro next year, if I can afford it.
-
Inappropriate?Hi, Guillermo. If the TinyMCE Rich Text Editor is making changes you don't like, try using the Plain Text Editor. You can switch to it by clicking the Preferences link on the Dashboard. Thanks!
Marc :-) -
Inappropriate?Hi Marc. This happens precisely with the plain text editor. I never use the TinyMCE editor, I compose all my posts in HTML using the plain text editor.
-
Inappropriate?I can backup Guillermo’s statement. I use Markdown to write my posts and there too writing 1 sentence will not put a p-element around it, while as soon as multiple paragraphs are used it adds the p-elements.
I’m annoyed
-
Inappropriate?I just noticed that this happens in the API as well. Notice that the single-paragraph “Princess Unicorn” post got its <p> tags stripped, while the multi-paragraph post below maintains its markup intact.
-
Inappropriate?This tag situation bothers me too. I can't style posts consistently because sometimes I have a tag and sometimes I don't.
Was there a reason for this?
I’m frustrated
-
Inappropriate?I'm seeing this same issue. Please let me know when and if this changes!
I’m frustrated
-
Inappropriate?This is still happening. It should be pretty easy for Tumblr to add tags to descriptions with just one paragraph. Pretty please!!
I’m frustrated
-
Inappropriate?Ran into this problem again today, as I started work on a new theme. Directly did some testing:
The <p>-element suspected to be wrapped around a single line (single paragraph) post is stripped with every possible posting type (plain text, Markdown and Rich). It is also stripped when inserted manually as in writing the post:
<p>This is a single line post.</p>
From that example the <p>-element is removed in both Markdown and plain mode.
When a single line or word is written in the rich mode one can see the <p>-element to be there when the HTML button is clicked. However after submission here too it gets stripped.
Is there any progress on this issue? Even if you are concerned about backwards compatibility with existing blogs it is clear that a manually inserted <p>-element should never be stripped!
(Get Satisfaction has terrible ways of explaining how to use it’s HTML — took me a lot of edits to get this reply somewhat presentable...)
I’m frustrated
Loading Profile...






