remarkjs/remark

HTML entity is mangled

Closed this issue · 4 comments

Porges commented

Initial checklist

Affected packages and versions

at least 15.0.1, 14.0.2

Link to runnable example

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!

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.