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 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 [Type] Bug An existing feature does not function as intended [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 force-pushed the fix/navigation-link-special-chars branch from 9588991 to 87b30e7 Compare November 19, 2019 19:26
@retrofox retrofox force-pushed the fix/navigation-link-special-chars branch from 87b30e7 to 34200af Compare November 20, 2019 13:46
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.

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

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. [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Navigation: handle special chars in Editor canvas
3 participants