Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render specific tag cause infinite loop #305

Open
ghost opened this issue Aug 14, 2018 · 3 comments
Open

Render specific tag cause infinite loop #305

ghost opened this issue Aug 14, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 14, 2018

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 ghost changed the title render specific tag cause **Infinite loop** render specific tag cause infinite loop Aug 14, 2018
@ghost ghost changed the title render specific tag cause infinite loop Render specific tag cause infinite loop Aug 14, 2018
@DiscoNova
Copy link

DiscoNova commented Aug 14, 2018

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
Copy link

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

@ghost
Copy link
Author

ghost commented Aug 14, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant