Skip to content

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