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

Content is lost if you remove P tags #1526

Closed
Ipstenu opened this issue Jun 28, 2017 · 1 comment
Closed

Content is lost if you remove P tags #1526

Ipstenu opened this issue Jun 28, 2017 · 1 comment

Comments

@Ipstenu
Copy link
Contributor

Ipstenu commented Jun 28, 2017

If the text content 'loses' it's paragraph tags, it gets 'eaten' by Gutenberg.

So for example, if you have this, everything works:

<!-- wp:core/text -->
<p>I like that I can dance.</p>
<!-- /wp:core/text -->

Looks like this:

screen shot 2017-06-27 at 27 jun - 7 41 27 pm

But if you have this it won't:

<!-- wp:core/text -->
This is a test post. I'm going to do something dumb. Hang on.
<!-- /wp:core/text -->

That looks like this:

screen shot 2017-06-27 at 27 jun - 7 40 02 pm

It basically created an EMPTY text block. If I go into the text editor, it looks like this:

<!-- wp:core/text -->
<p></p>
<!-- /wp:core/text -->

The easiest way to reproduce would be this:

  1. Make a post in Gutenberg
  2. Edit the post in the visual/tinyMCE editor for any reason (in my case, editing tags and adding meta box content)
  3. Go back to Gutenberg

All your text will be lost. Sad panda. 🐼

NB: You must save your content in the visual/TinyMCE editor. Because it strips p tags.

My recommendation would be to somehow force-add them back in? I know it should never happen in the future, but if someone goes into the text editor for any reason and adds content not knowing that they have to have p tags, they'll lose content.

@youknowriad
Copy link
Contributor

I think we can consider this as closed by #1929 because removing the p tags will mark the block as corrupted and it will be protected from any gutenberg change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants