fix: escape/textify the contents of inline and block code (#954)
This commit is contained in:
parent
24d43699bb
commit
f9509f8987
3 changed files with 35 additions and 1 deletions
|
@ -20,6 +20,16 @@ describe('content-rich', () => {
|
|||
expect(formatted).toMatchSnapshot()
|
||||
})
|
||||
|
||||
it('inline code with link', async () => {
|
||||
const { formatted } = await render('<p>Inline code with link: `<a href="https://api.iconify.design/noto.css?icons=1st-place-medal,2nd-place-medal" target="_blank" rel="nofollow noopener noreferrer" class="status-link unhandled-link" title="https://api.iconify.design/noto.css?icons=1st-place-medal,2nd-place-medal"><span class="invisible">https://</span><span class="ellipsis">api.iconify.design/noto.css?ic</span><span class="invisible">ons=1st-place-medal,2nd-place-medal</span></a>`</p>')
|
||||
expect(formatted).toMatchSnapshot()
|
||||
})
|
||||
|
||||
it('handles html within code blocks', async () => {
|
||||
const { formatted } = await render('<p>HTML block code:<br>```html<br><span class="icon--noto icon--noto--1st-place-medal"></span><br><span class="icon--noto icon--noto--2nd-place-medal-medal"></span><br>```</p>')
|
||||
expect(formatted).toMatchSnapshot()
|
||||
})
|
||||
|
||||
it('custom emoji', async () => {
|
||||
const { formatted } = await render('Daniel Roe :nuxt:', {
|
||||
nuxt: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue