Closed MoLow closed 2 years ago
hast-util-raw 7.2.1
https://stackblitz.com/edit/node-h5dh1f?file=index.js
this was discovered in node.js docs, see https://github.com/nodejs/node/issues/43864 provided a minimal repro in stackblitz where the last word in this case is repeated
the output of
import { raw } from 'hast-util-raw'; const children = [ { type: 'raw', value: 'this is a thing' }, { type: 'raw', value: '<sup>' }, { type: 'text', value: 'b' }, { type: 'raw', value: '</sup>' }, ]; console.log(raw({ type: 'root', children }));
should be
{ type: 'root', children: [ { type: 'text', value: 'this is a thing' }, { type: 'element', tagName: 'sup', properties: {}, children: [Array] } ], data: { quirksMode: false } }
the word thing is duplicated (changing to another word will result with the same issue):
{ type: 'root', children: [ { type: 'text', value: 'this is a thingthing' }, { type: 'element', tagName: 'sup', properties: {}, children: [Array] } ], data: { quirksMode: false } }
node18, node 16
npm@8.11.0
any
No response
Thanks, found it!
Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.
phase/solved
no/*
Released!
Thanks!
Initial checklist
Affected packages and versions
hast-util-raw 7.2.1
Link to runnable example
https://stackblitz.com/edit/node-h5dh1f?file=index.js
Steps to reproduce
this was discovered in node.js docs, see https://github.com/nodejs/node/issues/43864 provided a minimal repro in stackblitz where the last word in this case is repeated
Expected behavior
the output of
should be
Actual behavior
the word thing is duplicated (changing to another word will result with the same issue):
Affected runtime and version
node18, node 16
Affected package manager and version
npm@8.11.0
Affected OS and version
any
Build and bundle tools
No response