How can I make sure that redundant <p> tags do not violate the style?
I get an unreliable result from the Tumblr API. When I get one line of text, I get only text. When there are multiple lines, each line is wrapped with a tag <p>. So I either get:
This is a value with no second line
or
<p>This is a value</p>
<p>with a second line</p>
I want both displayed the same way. I manually added <p>around the value, but this will result in:
<p><p>This is a value</p>
<p>with a second line</p></p>
for multi-line values.
I have a few thoughts on how to fix this, but I'm not sure if it would be better.
- Create a new CSS style
p p {}that shifts the style of the twisted style - Use jQuery to retrieve DOM contents of redundant tags
<p>and make them non-redundant - jQuery, ,
<p>, , , DOM.
, 1 ( ), . , 2 3, ?
: , Tumblr, Python/PHP/ASP/etc ( !).