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

Escape non breaking space #1430

Closed
wants to merge 3 commits into from
Closed

Escape non breaking space #1430

wants to merge 3 commits into from

Conversation

predragnikolic
Copy link

This should address this comment #1428 (comment)

This is a try I am not sure if this works.
I do not know how to test this manually locally. I run the tests npm run test, and the test are passing so that makes me think that everthing should work...

So feel free to push some commits.

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • run tests npm run test
  • tests are included

Checklist (for documentation change)

  • only relevant documentation part is changed (make a diff before you submit the PR)
  • motivation/reason is provided

@adrai
Copy link
Member

adrai commented Dec 14, 2021

@cuyl can you review this?

@coveralls
Copy link

coveralls commented Dec 14, 2021

Coverage Status

Coverage remained the same at 96.057% when pulling e7cc438 on predragnikolic:escape-non-breaking-space into 6fda214 on i18next:master.

@cuyl
Copy link
Contributor

cuyl commented Dec 14, 2021

@adrai   is works without any changes.

@predragnikolic You can revert react-i18next.js change and run test, it works.

adrai added a commit that referenced this pull request Dec 14, 2021
@predragnikolic
Copy link
Author

  is works without any changes.

Are you sure?

I have the following:

<Trans
    shouldUnescape
    defaults={"<p>Do&nbsp;Not&nbsp;Disturb</p>"} />

And I expect to see:
Screen Shot 2021-12-14 at 2 07 07 PM

But I see:
Screen Shot 2021-12-14 at 2 06 40 PM

@adrai
Copy link
Member

adrai commented Dec 14, 2021

@predragnikolic this works without any change: 71d3542

@predragnikolic
Copy link
Author

this works without any change:

True the test passes even without my changes,
but I am confused why the browser still displays &nbsp;

@cuyl
Copy link
Contributor

cuyl commented Dec 14, 2021

@predragnikolic If you want render many actual spaces, you can try \u00A0 or \xA0. unescape &nbsp; to SPACE can't help you, because even you unescape &nbsp; to SPACE, html still only render one space.

@predragnikolic
Copy link
Author

I'd say that I expected the wrong behavior, so I'm closing this. :)

@predragnikolic predragnikolic deleted the escape-non-breaking-space branch December 14, 2021 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants