markdown-it / markdown-it-emoji

Emoji syntax plugin for markdown-it markdown parser
https://markdown-it.github.io/
MIT License
727 stars 167 forks source link

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

Closed muffinresearch closed 8 years ago

muffinresearch commented 8 years ago

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 :open_mouth:

puzrin commented 8 years ago

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.

muffinresearch commented 8 years ago

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

<em:optionType>

I get this output instead :)

validator_rules
muffinresearch commented 8 years ago

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

puzrin commented 8 years ago

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

muffinresearch commented 8 years ago

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!

puzrin commented 8 years ago

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