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

Permalink: Slug input field strips unicode characters #12546

Closed
LuckynaSan opened this issue Oct 25, 2022 · 3 comments · Fixed by #12603
Closed

Permalink: Slug input field strips unicode characters #12546

LuckynaSan opened this issue Oct 25, 2022 · 3 comments · Fixed by #12603
Assignees
Labels
P1 High priority, must do soon Package: Story Editor /packages/story-editor Type: Bug Something isn't working Type: Documentation Improvements or additions to documentation

Comments

@LuckynaSan
Copy link
Collaborator

LuckynaSan commented Oct 25, 2022

Bug Description

The permalink slug field does not show foreign language special characters when using it as a title or when entering it in the slug field.

AMP Bug (out of scope for this project)

The story bookend is being displayed with HTML markup when the story title or permalink slug contains language special characters.

Example story URL: https://feignednorth.s4-tastewp.com/web-stories/%e0%b0%87%e0%b0%82%e0%b0%a1%e0%b0%bf%e0%b0%af%e0%b0%be-%e0%b0%b8%e0%b0%bf%e0%b0%ae%e0%b1%86%e0%b0%82%e0%b0%9f%e0%b1%8d%e0%b0%b8%e0%b1%8d-%e0%b0%aa%e0%b1%88%e0%b0%a8-%e0%b0%95%e0%b1%87%e0%b0%b8/

Expected Behaviour

The slug should display the language characters.

Steps to Reproduce

  1. Create a new story
  2. Use “ఇండియా-సిమెంట్స్-పైన-కేస” as title
  3. Publish the story.
  4. Note Permalink Slug field.

-> Compare the same with Gutenberg where this just works.

Screenshots

Additional Context

Screen Shot 2022-10-25 at 9 41 28 AM

Support Topic: https://wordpress.org/support/topic/doesnt-tech-url

  • Plugin Version: 1.25.1
  • WordPress Version:
  • Operating System: macOS
  • Browser: Chrome
@LuckynaSan LuckynaSan added the Type: Bug Something isn't working label Oct 25, 2022
@swissspidy swissspidy changed the title Foreign Language Characters Shown as HTML Markup in Permalink Slug Permalink: Slug input field strips unicode characters Oct 25, 2022
@swissspidy swissspidy added Type: Documentation Improvements or additions to documentation P1 High priority, must do soon Pod: Prometheus Package: Story Editor /packages/story-editor labels Oct 25, 2022
@swissspidy
Copy link
Collaborator

The issue with the permalink field is something we can fix, the other part is not in our hands and needs to be reported in the amphtml repo.

@LuckynaSan
Copy link
Collaborator Author

I have opened the other part here: ampproject/amphtml#38510

@miina miina self-assigned this Oct 31, 2022
@swissspidy
Copy link
Collaborator

Gutenberg nowadays uses the MIT remove-accents package. We can potentially use that one as well.

Also, I think we should use String.prototype.normalize() with NFC, not NFD

We can also use replaceAll() to make the cleanForSlug function more readable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 High priority, must do soon Package: Story Editor /packages/story-editor Type: Bug Something isn't working Type: Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants