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

Navigation: Fix issue creating front-end markup #18607

Merged
merged 3 commits into from
Nov 20, 2019

Conversation

retrofox
Copy link
Contributor

@retrofox retrofox commented Nov 19, 2019

Description

It fixes a bug when the link has special chars escaping them applying the esc_attr() function.

Fixes #18604

How has this been tested?

Add a link from a post or page where its menu has a special char, for instance <, >, etc

Before
Confirm that it breaks the markup in the front-end:

Screen Shot 2019-11-19 at 9 33 04 AM

After
The markup should be ok.

Screen Shot 2019-11-19 at 9 34 35 AM

Screenshots

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.

@retrofox retrofox added [Feature] List View Menu item in the top toolbar to select blocks from a list of links. [Block] Navigation Affects the Navigation Block labels Nov 19, 2019
@retrofox retrofox requested a review from getdave November 19, 2019 12:35
@retrofox retrofox changed the title navigation: esc attrs making markup Navigation: Fix issue creating front-end markup Nov 19, 2019
Copy link
Contributor

@getdave getdave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @retrofox 👍

Copy link
Contributor

@draganescu draganescu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All attributes should go through esc_attr indeed :)

@retrofox retrofox force-pushed the fix/navigation-markup-broken branch from fea84ee to 7c8b33f Compare November 19, 2019 19:27
packages/block-library/src/navigation/index.php Outdated Show resolved Hide resolved
packages/block-library/src/navigation/index.php Outdated Show resolved Hide resolved
@retrofox retrofox requested a review from obenland November 19, 2019 22:29
It fixes a big when the link has spececial chars escaping them applying the esc_attr() function
@retrofox retrofox force-pushed the fix/navigation-markup-broken branch from 3273d9e to 760f0a5 Compare November 20, 2019 11:37
@retrofox retrofox merged commit 35d5f69 into master Nov 20, 2019
@retrofox retrofox deleted the fix/navigation-markup-broken branch November 20, 2019 11:59
@youknowriad youknowriad added this to the Gutenberg 7.0 milestone Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Navigation Affects the Navigation Block [Feature] List View Menu item in the top toolbar to select blocks from a list of links.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigation: Markup is broken
5 participants