Closed talatkuyuk closed 1 year ago
Is there any emoji or emoticon which contains triple colon :::?
I don't think so. RE_SHORT
is simply not perfect to precisely match emoticons.
https://github.com/rhysd/remark-emoji/blob/a5018376aa7bfea2c114a8667f8e9a8497775a68/index.js#L46
Though the regex matches to :::
, it is not found in emoticons list. So the matcher just returns the original text without modification here.
I tried the following and it worked fine.
import { remark } from 'remark';
import emoji from 'remark-emoji';
const emoticon = remark().use(emoji, { emoticon: true });
const input = '::: danger Title\n\nbla bla bla\n\n:::\n';
const file = await emoticon.process(input);
const output = String(file);
console.log(output);
It seems a problem of the remark-custom-container that it does not handle the nested text node correctly. Closing.
This situation might be improved at v3.1.1 because remark-emoji no longer replace the matched text with a text node when no emoji corresponding to the text is found.
I will try, and let you know, thanks.
I tested and see that it is fixed, no more side-effects, thanks..
Having similar issue with links
@danielfabriq This issue is already closed hence it is not tracked. Can you make a new issue with an example input (the input string and the JavaScript code you tried) which can reproduce it? I guess this is a conflict with some other plugins (auto-linking?).
In the markdown, when I create a custom container: (with
remark-custom-container
)the regex
RE_SHORT
(for detecting emoticon) matches also container markup triple colon:::
, and broke the container.Is there any emoji or emoticon which contains triple colon
:::
?Actually the triple colon
:::
is well-known pattern to make containers in the remark ecosystem.When I use the
remark-emoji
after theremark-custom-container
, the custom containers are okey, but in that case it broke something else, which I don't prefer.Is it necessary to match triple colon
:::
?. If not, I think theRE_SHORT
needs to be refactored, but I don't know which regex pattern ignores the triple colon:::
and matches the actual emoticons.