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

Classic block: Convert to Blocks removes data, rb, and rtc elements #11775

Closed
ZebulanStanphill opened this issue Nov 12, 2018 · 7 comments
Closed
Labels
[Feature] Paste [Type] Enhancement A suggestion for improvement.

Comments

@ZebulanStanphill
Copy link
Member

The issue

<data>, <rb>, and <rtc> elements are not preserved when converting a Classic block to other blocks using the Convert to Blocks option.

Reproduction steps

  1. Create a post using the Classic Editor and open in it Gutenberg, or insert a Classic block in Gutenberg.
  2. Open the More Options (ellipsis) menu and choose Edit as HTML.
  3. Insert the following markup:
<data value="value">data</data> <ruby>ruby <rb>rb</rb> <rp>rp</rp> <rt>rt</rt> <rtc>rtc</rtc> <rp>rp</rp></ruby>
  1. Open the More Options menu again and choose Edit visually.
  2. Press More OptionsConvert to Blocks. This will result in a Paragraph block being created.
  3. Press More OptionsEdit as HTML.
  4. The markup should all be preserved from the Classic block, but this bug causes <data>, <rb>, and <rtc> elements to be removed.

Related issues and PRs

@designsimply designsimply added [Type] Enhancement A suggestion for improvement. [Feature] Paste labels Nov 13, 2018
@designsimply
Copy link
Member

designsimply commented Nov 13, 2018

Thanks for clearly written issue!

Since I wasn't familiar with these HTML elements, I looked them up and found some have limited browser compatibility and wanted to make a note about that and link to their respective specs for reference:

@oandregal
Copy link
Member

This is now fixed. Probably by some of the changes that affected #12029

@oandregal oandregal added this to the WordPress 5.0 RC milestone Nov 20, 2018
@ZebulanStanphill
Copy link
Member Author

@nosolosw I can still reproduce in latest master. Please re-open.

@oandregal
Copy link
Member

Hi @ZebulanStanphill this is a GIF I've just recorded with the latest master:

peek 2018-11-20 22-29

I understood that was what you were expecting to happen, is that correct?

@ZebulanStanphill
Copy link
Member Author

@nosolosw No. If you look at the resulting markup, some of the tags have been stripped out. The <ruby> tag (and some others) were not stripped out, but that's not what this ticket is about. I just put the <ruby> tag there since you're supposed to nest the <rb> and <rtc> elements inside of one, assuming I understand the HTML specification correctly.

The title of this issue says <data>, <rb>, and <rtc> elements are removed, and that is precisely what happens in your GIF.

@oandregal
Copy link
Member

Oh, you are so right, I was confused by the actual text while looking at other issues at the same time.

@oandregal oandregal reopened this Nov 20, 2018
@oandregal oandregal removed this from the WordPress 5.0 RC milestone Nov 20, 2018
@ellatrix
Copy link
Member

This is how the classic editor works (TinyMCE). There's nothing I can do about that. You'll notice that it works in Gutenberg:

  1. Create a paragraph block. You'll have to type something in it so the controls appear.
  2. Go to more options, then edit as HTML.
  3. Insert:
<p><data value="value">data</data> <ruby>ruby <rb>rb</rb> <rp>rp</rp> <rt>rt</rt> <rtc>rtc</rtc> <rp>rp</rp></ruby></p>
  1. Edit visually. All content is there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Paste [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants