Opened 14 years ago
Closed 11 years ago
#15367 closed defect (bug) (fixed)
WordPress strips multiple line breaks inside of <pre> tags
Reported by: | Viper007Bond | Owned by: | garyc40 |
---|---|---|---|
Milestone: | 3.4 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Formatting | Keywords: | wpautop needs-unit-tests |
Focuses: | Cc: |
Description
Write a post:
<pre> This is a test. </pre>
You end up with this:
<pre> This is a test. </pre>
Probably related to wpautop()
I imagine.
Attachments (1)
Change History (20)
#3
follow-up:
↓ 4
@
14 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
This isn't a TinyMCE issue, it's an output filter issue.
#4
in reply to:
↑ 3
@
14 years ago
Replying to Viper007Bond:
The same was happening when switching editors, perhaps we can apply the changes from the JS version of wpautop to the php one.
#5
@
14 years ago
No I mean this isn't an editor issue. If I write the above example in the HTML editor, it stays exactly like that. I save the post, still correct. When I view it on the front end however, the extra line breaks are stripped out.
#6
@
14 years ago
Whoops, I need to learn to read. Yes, we need to apply the code to the PHP-based `wpautp()~ too.
#8
@
14 years ago
Nah you can spell apparently fairly well it's the other words you should practice ;-)
#9
@
14 years ago
- Keywords 3.2-early wpautop added
- Milestone changed from Awaiting Review to Future Release
#12
@
13 years ago
- Keywords needs-testing added
My approach was to preserve all content inside <pre> tags from most of the substitution that occurs on the rest of the text. As a result, the call to clean_pre() is no longer necessary.
#14
@
12 years ago
- Cc MikeHansenMe added
- Keywords needs-refresh added
This problem still exists but the patch would not apply. Needs Refresh.
#15
@
12 years ago
In addition to my last comment the problem still exist when switching between Visual and Text mode. If you paste the example in text mode and click publish then reload the page it remains as it should. It seems a similar fix is needed for the js.
#16
@
11 years ago
- Keywords needs-unit-tests added
I can't seem to reproduce this. This needs a unit test, then maybe we can figure out exactly what (PHP/JS/TinyMCE) needs changing.
(In [16394]) Remove invalid parent paragraph when pasting in the visual editor or switching visual to HTML and back, keep multiple empty lines in a <pre> tag, fixes #15095 fixes #15367