Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty paragraph in text column block #2651

Closed
samikeijonen opened this issue Sep 2, 2017 · 16 comments
Closed

Empty paragraph in text column block #2651

samikeijonen opened this issue Sep 2, 2017 · 16 comments
Labels
[Status] Not Implemented Issue/PR we will (likely) not implement. [Type] Bug An existing feature does not function as intended [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked.

Comments

@samikeijonen
Copy link
Contributor

When I add text column block (2,3, or 4 columns) I always get empty (<p></p>) paragraph in the front end. No matter how I try to write text in the admin.

@Kuckovic
Copy link

I have the same issue!
How can we get rid of this??

@youknowriad
Copy link
Contributor

I can't reproduce this, can we have more context? steps to reproduce?

@youknowriad youknowriad added the [Status] Needs More Info Follow-up required in order to be actionable. label Sep 19, 2017
@samikeijonen
Copy link
Contributor Author

samikeijonen commented Sep 19, 2017

  1. Add Text Columns block.
  2. Write text in the columns.
  3. Save.
  4. Check front end, and there are empty <p> tags.
<section class="wp-block-text-columns alignundefined columns-2">
  <div class="wp-block-column">
    <p>This is it for me.</p>
    <p></p>
  </div>
  <div class="wp-block-column">
    <p>This is it for see.</p>
    <p></p>
  </div>
</section>

@youknowriad youknowriad added [Type] Bug An existing feature does not function as intended and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Sep 19, 2017
@afercia
Copy link
Contributor

afercia commented Oct 19, 2017

I'd also argue a <section> element is not appropriate in this case. Even a quick reading of the spec clarifies it pretty well: https://www.w3.org/TR/html51/sections.html#the-section-element

The section element represents a generic section of a document or application. A section, in this context, is a thematic grouping of content. Each section should be identified, typically by including a heading (h1-h6 element) as a child of the section element.
...
Examples of sections would be chapters, the various tabbed pages in a tabbed dialog box, or the numbered sections of a thesis. A Web site’s home page could be split into sections for an introduction, news items, and contact information.

@samikeijonen
Copy link
Contributor Author

In #2908 we are discussing about markup and changing to <div>.

But I still see the original issue, which is empty <p></p>.

@jorgefilipecosta
Copy link
Member

jorgefilipecosta commented Nov 1, 2017

This issue seems a bug in WordPress core, for example in the classic editor if we add this content:

  <div>
    <p>test</p>
  </div>

In the browser we get:

<div>
 <p>test</p>
 </p></div>

Then the browser adds the missing opening tag. This seems like the root cause of this problem.

@mtias mtias added the [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked. label Nov 20, 2017
@karmatosed karmatosed added this to the Merge Proposal milestone Jan 25, 2018
@mtias mtias modified the milestones: Merge Proposal, WordPress 5.0 Mar 7, 2018
@noisysocks
Copy link
Member

I'm unable to reproduce this bug in Gutenberg 2.7.

@samikeijonen
Copy link
Contributor Author

Now Enter doesn't create new <p> but <br>.

Markup looks like this in the front end:

<div class="wp-block-text-columns alignundefined columns-2">
	<div class="wp-block-column">
		<p>This is it.<br><br>And another one.<br>What, one line.</p>
	</div>
	<div class="wp-block-column">
		<p>This is it.<br>This is it.<br><br>It is.</p>
	</div>
</div>

That's not correct either.

@samikeijonen samikeijonen reopened this Apr 26, 2018
@samikeijonen
Copy link
Contributor Author

Is the above markup correct or should we close this? I personally feel it's weird that pressing Enter creates <br> and not new <p>.

@youknowriad
Copy link
Contributor

In my testing, shift + Enter creates <br> but regular Enter creates new paragraphs.

@samikeijonen
Copy link
Contributor Author

I was testing the plugin version, could be resolved in the master.

@ajitbohra
Copy link
Member

Tested on master Enter creates <br>

@samikeijonen
Copy link
Contributor Author

I confirm what @ajitbohra noted, this is still issue.

@noisysocks
Copy link
Member

Here's my understanding of the issue:

  1. Create a Text Columns block
  2. Type some text into one of the columns
  3. Press Enter
  4. Type some more text
  5. View the source of the post

Result: The two lines of text are separated by a <br>.
Expected result: The two lines of text should be in seperate <p> tags.


I'm on the fence as to whether this is a bug. On the one hand, it matches how other blocks that contain a rich text area work, e.g. Verse, Quote, Preformatted. On the other, it does not match how the Columns (not Text Columns) block works.

My gut feeling is to leave this as is because, hopefully, Columns will soon be stable enough for us to simply remove the Text Columns block.

Thoughts, @jasmussen?

@samikeijonen
Copy link
Contributor Author

My gut feeling is to leave this as is because, hopefully, Columns will soon be stable enough for us to simply remove the Text Columns block.

That make sense.

@scamba
Copy link

scamba commented Sep 10, 2020

To remove empty <p></p> i am positioned my cursor inside this possible paragrah and i pulse delete key until to get my real last element, and save page. Sorry for my english i hope this help anyone

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Not Implemented Issue/PR we will (likely) not implement. [Type] Bug An existing feature does not function as intended [Type] WP Core Ticket Requires an upstream change from WordPress. Core Trac ticket should be linked.
Projects
None yet
Development

No branches or pull requests

10 participants