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/navigation link special chars #18617

Merged
merged 4 commits into from Nov 25, 2019
Merged

Conversation

@retrofox
Copy link
Contributor

retrofox commented Nov 19, 2019

Description

This PR fixes an issue when the navigation links come from blog posts/pages. We need to escape special chars when the title and label are propagated to the RichText component.

Fixes #18613

How has this been tested?

  • Create a page setting special chars at the page title, for instance <Navigation />:

Before: Confirm that the link label is empty:
Screen Shot 2019-11-19 at 3 28 22 PM

After
The link label should fill with the page title:

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR. .
@retrofox retrofox added this to 👀 PRs to review in Navigation block via automation Nov 19, 2019
@retrofox retrofox force-pushed the fix/navigation-link-special-chars branch from 9588991 to 87b30e7 Nov 19, 2019
@retrofox retrofox force-pushed the fix/navigation-link-special-chars branch from 87b30e7 to 34200af Nov 20, 2019
Copy link
Contributor

draganescu left a comment

Tested locally and works great. Used the title <!--<Navigation Link/>±Scrip<*&!--> and the label is preserved.

@retrofox retrofox merged commit 1af6467 into master Nov 25, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
Navigation block automation moved this from 👀 PRs to review to ✅ Done Nov 25, 2019
@retrofox retrofox deleted the fix/navigation-link-special-chars branch Nov 25, 2019
@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
You can’t perform that action at this time.