Hi 👋
Previously, I opened #42 to correctly unescape whitespace HTML entity codes.
However, that the approach already present turned out to be not very scalable, as many valid entities are still not decoded correctly.
For example:
These entities are automatically decoded in GitHub’s markdown preview, but not in marked-react, which leads to inconsistent rendering in our application (some entities decoded, others not).
Proposed solution
Use html-entities, a lightweight package without dependencies, to safely decode all valid HTML entities.
Example
Input:
Café – temperature: 23°C
Expected output:
Café – temperature: 23°C
Actual output (current):
Café – temperature: 23°C
Would you consider adding this improvement?
I’d be happy to open a PR if this approach sounds good.
Hi 👋
Previously, I opened #42 to correctly unescape whitespace HTML entity codes.
However, that the approach already present turned out to be not very scalable, as many valid entities are still not decoded correctly.
For example:
These entities are automatically decoded in GitHub’s markdown preview, but not in marked-react, which leads to inconsistent rendering in our application (some entities decoded, others not).
Proposed solution
Use html-entities, a lightweight package without dependencies, to safely decode all valid HTML entities.
Example
Input:
Expected output:
Actual output (current):
Would you consider adding this improvement?
I’d be happy to open a PR if this approach sounds good.