Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Descriptions containing unicode characters gets encoded #82

Closed
rigwild opened this issue May 2, 2020 · 2 comments
Closed

Descriptions containing unicode characters gets encoded #82

rigwild opened this issue May 2, 2020 · 2 comments

Comments

@rigwild
Copy link

rigwild commented May 2, 2020

After some testing, I got unlucky with superb with a description containing an apostrophe.

Yeoman seems to encode Unicode characters to be HTML-safe.

My cat's meow module

package.json:

{
  "description": "My cat's meow module"
}

readme.md:

> My cat's meow module

It does not break the package.json file, nor the readme rendering though.

Related: #59 #60

@rigwild rigwild changed the title Descriptions containing apostrophes gets badly encoded Descriptions containing unicode characters gets encoded May 2, 2020
@sindresorhus
Copy link
Owner

This is an edge-case, so I'm most likely not going to look into this. But a PR is always welcome.

@rigwild
Copy link
Author

rigwild commented May 3, 2020

did some testing, checked which chars would break package.json

Tested:

& é ~ " # ' { ( [ - | è ` _ \ ç ^ à @ ) ] ° = + } ¨ $ £ ¤ ù % * µ < > , ? ; . : / ! § a ã ä â à

Ones that gets HTML-encoded:

& " ' < >

One that does not get encoded but still break

\

Emojis seems to work as expected.
There will always be some random unicode chars that will always break it, but that's too edgy, no one really care.

Escaping is not enough (they still get converted by yeoman when using fs.copyTpl

I can do a PR that simply replace these with a space.

@rigwild rigwild closed this as completed Jul 6, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants