HTML entity is mangled
Closed this issue · 4 comments
Porges commented
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
Affected packages and versions
at least 15.0.1, 14.0.2
Link to runnable example
- Markdown–HTML: https://codesandbox.io/p/sandbox/github/remarkjs/.github/tree/main/sandbox-templates/remark-rehype-with-vite
- Markdown–Markdown: https://codesandbox.io/p/sandbox/github/remarkjs/.github/tree/main/sandbox-templates/remark-with-vite
Steps to reproduce
Create a Markdown file:
# test
片󠄃
Run remark on it.
Expected behavior
Output should preserve the HTML entity or change it to non-entity form.
Actual behavior
HTML entity is changed to a completely different character:
# test
片ă
Note that I don't recall this happening with past versions, so it might have been introduced (fairly) recently.
This will be a bug in mdast-util-{from,to}-markdown
, but I’m not sure which.
Runtime
Node v16
Package manager
npm 8
OS
Windows, Linux
Build and bundle tools
No response
Porges commented
This is also present when just using micromark:
import {micromark} from 'micromark';
console.log(micromark('片󠄃'));
> node test.mjs
<p>片ă</p>
Porges commented
Sent a PR fixing this to the micromark repo: micromark/micromark#158
wooorm commented
Thanks!
github-actions commented
Hi! This was closed. Team: If this was fixed, please add phase/solved
. Otherwise, please add one of the no/*
labels.