Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix emoji size when using "marked" markdown
The old logic of determing whether a message consists solely of emoji was pretty primitive: it just checked whether there are top level text nodes that contain text. This fails when using the "marked" markdown parser because it can return a <p> node, or a <table> node or whatever as the first element; the old logic would conclude that the message only uses emoji and render the emojis in "big". Rewrite the logic to scan every child node, ignoring "emoji" nodes, and when there is a text node with some text, we know that the message doesn't consist solely of emojis. This approach also works with the "original" markdown parser.
- Loading branch information