Opened 5 years ago
Closed 4 years ago
#6128 closed enhancement (fixed)
the_content spits out bogus BR tag
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.8 |
| Component: | Administration | Version: | 2.3.3 |
| Severity: | normal | Keywords: | has-patch tested |
| Cc: | jblaine@… |
Description
When calling the_content() via, say... archives.php, a BR tag is spit out even if the page is empty.
Let me try explaining that in more detail.
Calling the_content() from a page template PHP file (like archives.php in some themes) should drag in the contents of the actual page itself, as written by the page author. When the Wordpress page content is BLANK (read: "just spit out only what the page template generates"), the_content() is still generating a BR tag.
It causes bogus whitespace that is not wanted.
Attachments (2)
Change History (13)
comment:1
Viper007Bond — 4 years ago
- Keywords wpautop added
- Milestone changed from 2.9 to Future Release
comment:2
Viper007Bond — 4 years ago
- Type changed from defect (bug) to enhancement
Denis-de-Bernardy — 4 years ago
comment:3
follow-ups:
↓ 4
↓ 5
Denis-de-Bernardy — 4 years ago
- Component changed from Template to TinyMCE
- Keywords has-patch tested added; wpautop removed
- Milestone changed from Future Release to 2.8
- Owner changed from anonymous to azaozz
a separate patch is needed for the js version of wpautop in wp-admin/js/editor.js. you can see tinymce add the <br /> back and forth as you switch to and from the wysiwyg.
but as the code is minified, it's not easy to read or edit.
Replying to Denis-de-Bernardy:
but as the code is minified, it's not easy to read or edit.
See editor.dev.js
Replying to Denis-de-Bernardy:
you can see tinymce add the <br /> back and forth as you switch to and from the wysiwyg.
How? I cannot get mine to do that.
comment:6
in reply to:
↑ 5
Denis-de-Bernardy — 4 years ago
Replying to jbsil:
Replying to Denis-de-Bernardy:
you can see tinymce add the <br /> back and forth as you switch to and from the wysiwyg.
How? I cannot get mine to do that.
In Camino, you actually see the transformed code for a fraction of a second before things switch to Wysiwyg view.
Denis-de-Bernardy — 4 years ago
- Component changed from TinyMCE to Administration
- Owner changed from azaozz to anonymous
TinyMCE uses <br /> to pad the empty editor so the cursor can be placed in it. That's removed during the save cleanup. Think the <br /> in an empty post comes from autop (next line after the proposed fix in the first patch).
- Resolution set to fixed
- Status changed from new to closed
comment:9
follow-up:
↓ 10
Denis-de-Bernardy — 4 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
we're not fixing the js too?
comment:10
in reply to:
↑ 9
azaozz — 4 years ago
Replying to Denis-de-Bernardy:
we're not fixing the js too?
It doesn't happen there, see the previous comment.
- Resolution set to fixed
- Status changed from reopened to closed
oh, sorry, I had missed your comment.

Not really a bug, so gonna switch this to an enhancement.