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

Applied formats should produce optimized HTML #12314

Closed
gziolo opened this issue Nov 26, 2018 · 2 comments · Fixed by #14555
Closed

Applied formats should produce optimized HTML #12314

gziolo opened this issue Nov 26, 2018 · 2 comments · Fixed by #14555
Labels
[Package] Rich text /packages/rich-text [Type] Enhancement A suggestion for improvement.

Comments

@gziolo
Copy link
Member

gziolo commented Nov 26, 2018

Describe the behavior
When you apply multiple formats to the text when using RichText. It doesn't always produce optimal HTML code. In many cases the order of application matters producing different HTML. In the case I recorded, it produces two links instead of one.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new post.
  2. Type a few words in a paragraph.
  3. Apply bold to one of the words.
  4. Apply italics to the part of the bolded word.
  5. Apply link to the full bolded word.
  6. You should see something like the following when checking HTML source:
<p>My <strong><a href="http://localhost:8888/?page_id=2">te</a><em><a href="http://localhost:8888/?page_id=2">xt</a></em></strong> to test</p>

Expected behavior
Wrap text with only one link in all cases, no matter in what order formats get applied. The HTML should look like:

<p>My <a href="http://localhost:8888/?page_id=2"><strong>te<em>xt</em></strong></a> to test</p>

Screenshots
rich text formats

Desktop (please complete the following information):

  • OS: macOS Mojave
  • Browser: Chrome
  • Version: 70
@gziolo gziolo added [Type] Enhancement A suggestion for improvement. [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable labels Nov 26, 2018
@gziolo
Copy link
Member Author

gziolo commented Nov 26, 2018

@iseulde, any thought on this one?

@ellatrix
Copy link
Member

I thought this has already been reported once. Until now I considered this low priority. I can work on this for whatever milestone needed.

@ellatrix ellatrix added [Package] Rich text /packages/rich-text and removed [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable labels Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Rich text /packages/rich-text [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants