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

Fix: remove formats from document outline headings #12130

Merged

Conversation

jorgefilipecosta
Copy link
Member

@jorgefilipecosta jorgefilipecosta commented Nov 20, 2018

Description

After #8204 was merged, we started using the heading content as the outline item.
So if the heading contained custom formats, they were shown in the document outline. Showing the formats in the outline may break the formats as discovered by @mcsf.

This PR makes sure we show the plain text in the hading without any formats.

Props to @mcsf for finding the issue and proposing a solution.

How has this been tested?

In the code editor I pasted:

<!-- wp:heading -->
<h2>aaaa</h2>
<!-- /wp:heading -->

<!-- wp:heading {"level":3} -->
<h3><span style="line-height: 100px; color: red">bbbb</span></h3>
<!-- /wp:heading -->

<!-- wp:heading -->
<h2>cccccc</h2>
<!-- /wp:heading -->

I checked that the document inspector shown matches the "After" image.

Screenshots

Before:

screenshot 2018-11-20 at 19 43 23

After:
screenshot 2018-11-20 at 19 44 01

@mcsf mcsf added the [Feature] Document Outline An option that outlines content based on a title and headings used in the post/page label Nov 20, 2018
@jorgefilipecosta jorgefilipecosta force-pushed the fix/remove-formats-from-document-outline-headings branch from 5da9e2f to 7df5fe9 Compare November 21, 2018 10:08
@ellatrix
Copy link
Member

Look good.

@jorgefilipecosta jorgefilipecosta merged commit 4ddb5aa into master Nov 21, 2018
@jorgefilipecosta jorgefilipecosta deleted the fix/remove-formats-from-document-outline-headings branch November 21, 2018 11:00
@mtias mtias added this to the 4.6 milestone Nov 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Document Outline An option that outlines content based on a title and headings used in the post/page
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants