mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-24 10:15:37 +03:00
Move emojis check condition to top
This commit is contained in:
parent
82163c0b88
commit
66e8bfe18c
1 changed files with 2 additions and 4 deletions
|
@ -116,13 +116,11 @@ function _enhanceContent(content, opts = {}) {
|
|||
// ======
|
||||
// Convert :shortcode: to <img />
|
||||
let textNodes;
|
||||
if (enhancedContent.includes(':')) {
|
||||
if (enhancedContent.includes(':') && emojis?.length) {
|
||||
textNodes = extractTextNodes(dom);
|
||||
for (const node of textNodes) {
|
||||
let html = escapeHTML(node.nodeValue);
|
||||
if (emojis) {
|
||||
html = emojifyText(html, emojis);
|
||||
}
|
||||
fauxDiv.innerHTML = html;
|
||||
node.replaceWith(...fauxDiv.childNodes);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue