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
merged 1 commit into from Nov 21, 2018

Conversation

Projects
None yet
4 participants
@jorgefilipecosta
Member

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 approved these changes Nov 20, 2018

@jorgefilipecosta jorgefilipecosta force-pushed the fix/remove-formats-from-document-outline-headings branch from 5da9e2f to 7df5fe9 Nov 21, 2018

@iseulde

This comment has been minimized.

Member

iseulde commented Nov 21, 2018

Look good.

@jorgefilipecosta jorgefilipecosta merged commit 4ddb5aa into master Nov 21, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jorgefilipecosta jorgefilipecosta deleted the fix/remove-formats-from-document-outline-headings branch Nov 21, 2018

grey-rsi pushed a commit to OnTheGoSystems/gutenberg that referenced this pull request Nov 22, 2018

Fix: remove formats from document outline headings. (WordPress#12130)
After WordPress#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 design.

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

@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