markdown-it / markdown-it-emoji

Emoji syntax plugin for markdown-it markdown parser

Home Page:https://markdown-it.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: How can I escape an emoji string so it's not rendered as emoji?

muffinresearch opened this issue · comments

I have some text which has strings being detected as a emoji when I don't want them to. Is there a way to escape the emoji syntax?

I was hoping :op would render :op rather than 😮

Current implementation is simple, it operates with parser text nodes output, instead of sitting on tokenizer level. So, it can't understand escaping. I'd suggest to select emoji patterns more carefully.

Sometime problem can be solved by improving start/end guard conditions. If it's you case - give me your text example with false positive.

I have a string which is reflecting some code e.g:

<em:optionType>

I get this output instead :)

validator_rules

I suppose I could easily solve this by surrounding that with "`".

Does "" solve your problem or should i think about additional checks, similar to \w` before/after shourtcuts?

Yep - surrounding the code snippet with "`" did indeed solve it for me. I'll let you decide if you want to keep this open but my own issue is resolved. Thanks!

Closing then. Will reopen if anyone decide he has unresolvable problem.