remarkable icon indicating copy to clipboard operation
remarkable copied to clipboard

Render specific tag cause infinite loop

Open ghost opened this issue 7 years ago • 3 comments

Here is the situation I encountered:

Ignore how strange the string is, which is Test Engineer's works, once executed, it will fall into an infinite loop.

Even breakpoint debugging can't work.

So I post here for solution.

const remarkable = new Remarkable('full', {
    html: true,
    xhtmlOut: false,
    breaks: false,
    langPrefix: 'language-',
    linkify: true,
    linkTarget: '_blank',
    typographer: false,
    quotes: '“”‘’',
});

const html = `
<img src=# onerror=’alert(document.cookie)/><!--‘
<img src=https://dn-coding-net-production-pp.qbox.me/63d4c242-e9c4-4b61-9e61-9adad4bb6b15.png />
`;

remarkable.render(html);

ghost avatar Aug 14 '18 10:08 ghost

Umm... well - you are feeding remarkable HTML instead of Markdown (edit: originally wrote Markup;), so ... I must say I don't see what you're actually expecting to happen?

DiscoNova avatar Aug 14 '18 10:08 DiscoNova

Hmm... seems like my knowledge of remarkable is very outdated - apparently it is possible to have HTML as input. I shall see myself out ;)

DiscoNova avatar Aug 14 '18 10:08 DiscoNova

@DiscoNova We are using Remarkable in our web editor, so we allow users to write markup originally.

ghost avatar Aug 14 '18 11:08 ghost