fix: don't decode HTML entities (&foo;
) until rendering (#465)
This commit is contained in:
parent
9a7c37db24
commit
f8ebc0e99a
4 changed files with 18 additions and 5 deletions
|
@ -58,6 +58,13 @@ exports[`html-parse > empty > html 1`] = `""`;
|
|||
|
||||
exports[`html-parse > empty > text 1`] = `""`;
|
||||
|
||||
exports[`html-parse > html entities > html 1`] = `
|
||||
"<p>Hello <World />.</p>
|
||||
"
|
||||
`;
|
||||
|
||||
exports[`html-parse > html entities > text 1`] = `"Hello <World />."`;
|
||||
|
||||
exports[`html-parse > inline markdown > html 1`] = `"<p>text <code>code</code> <b>bold</b> <em>italic</em> <del>del</del></p><p><pre><code class=\\"language-js\\">code block</code></pre></p>"`;
|
||||
|
||||
exports[`html-parse > inline markdown > text 1`] = `
|
||||
|
|
|
@ -52,6 +52,12 @@ describe('html-parse', () => {
|
|||
expect(formatted).toMatchSnapshot('html')
|
||||
expect(serializedText).toMatchSnapshot('text')
|
||||
})
|
||||
|
||||
it('html entities', async () => {
|
||||
const { formatted, serializedText } = await render('<p>Hello <World />.</p>')
|
||||
expect(formatted).toMatchSnapshot('html')
|
||||
expect(serializedText).toMatchSnapshot('text')
|
||||
})
|
||||
})
|
||||
|
||||
async function render(input: string, emojis?: Record<string, Emoji>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue