1

Very strange WordPress behavior: <p> tags are removed when placed inside <pre> tags, but not always. for example, this works fine:

<pre><p>This is a paragraph</p></pre>

But when the <p> tag is in its own line, it is removed. for example:

<pre>
    <p>This is a paragraph</p>
</pre>

is printed as:

<pre>
    This is a paragraph
</pre>

The context in which this is happening is inside the_loop() using the_content(). I am using WordPress 4.1

It's not a plugin issue, I've tried disabling them all.
It's not a theme problem, I tried other themes.
It's not a filter, I tried removing all filters using remove_filter and even manually using unset($GLOBALS['wp_filter'][ 'the_content' ])

What could be causing it?

4
  • In which context are that happening? For example: the content of single post view printed using the_content(). Please, edit your question and add this information.
    – cybmeta
    Commented Dec 28, 2014 at 11:00
  • @cybmeta the question was updated Commented Dec 28, 2014 at 18:01
  • I can not reproduce your problem in any way. Disable all plugins, including MU plugins (if any), as you did, use a default them (not sure if you tried with core themes or not) and clean the browser cache (just in case there is some javascript in the editor involved).
    – cybmeta
    Commented Dec 28, 2014 at 18:32
  • @cybmeta I understand. Ill try to dig into it and see if I can get more information. Commented Dec 29, 2014 at 22:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.