simov / markdown-viewer

Markdown Viewer / Browser Extension
MIT License
1.01k stars 131 forks source link

Turn on `emoji` will cause hyperlinks containing two colons to fail #205

Closed DIYer22 closed 1 year ago

DIYer22 commented 1 year ago

For example:

- [public typing demo](https://megvii-my.sharepoint.cn/:v:/g/personal/yanglei_megvii_com/EVdE-isEsd1Jt9NiJ4NreigBUKDCK64i04erQnnE-qKvAQ?e=9DQG26)

Yes, this is a real web hyperlink containing two colons 🤣

The render result: image

simov commented 1 year ago

That's unfortunate, though I think I might be able to guard against certain HTML tags, since the emojis are being applied on top of the already rendered HTML string using this very simple regular expression :[a-z0-9_+-]+:.

simov commented 1 year ago

This was fixed in v5.1, emojis inside HTML tag strings and inside <code> blocks are being ignored now.