Support Emoji 17 (#6823)
This commit is contained in:
parent
0f18a00e0c
commit
6b384c8da5
6
package-lock.json
generated
6
package-lock.json
generated
@ -17,7 +17,7 @@
|
|||||||
"@tauri-apps/plugin-shell": "^2.3.4",
|
"@tauri-apps/plugin-shell": "^2.3.4",
|
||||||
"@tauri-apps/plugin-updater": "^2.9.0",
|
"@tauri-apps/plugin-updater": "^2.9.0",
|
||||||
"async-mutex": "^0.5.0",
|
"async-mutex": "^0.5.0",
|
||||||
"emoji-data-ios": "git+https://github.com/korenskoy/emoji-data-ios#443f1c9",
|
"emoji-data-ios": "git+https://github.com/korenskoy/emoji-data-ios#30529a2",
|
||||||
"fflate": "^0.8.2",
|
"fflate": "^0.8.2",
|
||||||
"idb-keyval": "^6.2.2",
|
"idb-keyval": "^6.2.2",
|
||||||
"lowlight": "^3.3.0",
|
"lowlight": "^3.3.0",
|
||||||
@ -10174,8 +10174,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/emoji-data-ios": {
|
"node_modules/emoji-data-ios": {
|
||||||
"version": "0.5.2",
|
"version": "0.5.3",
|
||||||
"resolved": "git+ssh://git@github.com/korenskoy/emoji-data-ios.git#443f1c9d7b16a82e7ee53f7f226d7d9a9920a105",
|
"resolved": "git+ssh://git@github.com/korenskoy/emoji-data-ios.git#30529a2df438add436f6a3803cbe841093e9dea7",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/emoji-regex": {
|
"node_modules/emoji-regex": {
|
||||||
|
|||||||
@ -131,7 +131,7 @@
|
|||||||
"@tauri-apps/plugin-shell": "^2.3.4",
|
"@tauri-apps/plugin-shell": "^2.3.4",
|
||||||
"@tauri-apps/plugin-updater": "^2.9.0",
|
"@tauri-apps/plugin-updater": "^2.9.0",
|
||||||
"async-mutex": "^0.5.0",
|
"async-mutex": "^0.5.0",
|
||||||
"emoji-data-ios": "git+https://github.com/korenskoy/emoji-data-ios#443f1c9",
|
"emoji-data-ios": "git+https://github.com/korenskoy/emoji-data-ios#30529a2",
|
||||||
"fflate": "^0.8.2",
|
"fflate": "^0.8.2",
|
||||||
"idb-keyval": "^6.2.2",
|
"idb-keyval": "^6.2.2",
|
||||||
"lowlight": "^3.3.0",
|
"lowlight": "^3.3.0",
|
||||||
|
|||||||
@ -43,15 +43,12 @@ export default function renderText(
|
|||||||
return escapeHtml(text, params?.markdownPostProcessor);
|
return escapeHtml(text, params?.markdownPostProcessor);
|
||||||
|
|
||||||
case 'hq_emoji':
|
case 'hq_emoji':
|
||||||
EMOJI_REGEX.lastIndex = 0;
|
|
||||||
return replaceEmojis(text, 'big', 'jsx', params?.markdownPostProcessor);
|
return replaceEmojis(text, 'big', 'jsx', params?.markdownPostProcessor);
|
||||||
|
|
||||||
case 'emoji':
|
case 'emoji':
|
||||||
EMOJI_REGEX.lastIndex = 0;
|
|
||||||
return replaceEmojis(text, 'small', 'jsx', params?.markdownPostProcessor);
|
return replaceEmojis(text, 'small', 'jsx', params?.markdownPostProcessor);
|
||||||
|
|
||||||
case 'emoji_html':
|
case 'emoji_html':
|
||||||
EMOJI_REGEX.lastIndex = 0;
|
|
||||||
return replaceEmojis(text, 'small', 'html');
|
return replaceEmojis(text, 'small', 'html');
|
||||||
|
|
||||||
case 'br':
|
case 'br':
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -136,7 +136,7 @@ function isLastEmojiVersionSupported() {
|
|||||||
inlineEl.classList.add('emoji-test-element');
|
inlineEl.classList.add('emoji-test-element');
|
||||||
document.body.appendChild(inlineEl);
|
document.body.appendChild(inlineEl);
|
||||||
|
|
||||||
inlineEl.innerText = '🇨🇶'; // Emoji from 16.0 version
|
inlineEl.innerText = '🧑🩰'; // Emoji from 17.0 version
|
||||||
const newEmojiWidth = inlineEl.offsetWidth;
|
const newEmojiWidth = inlineEl.offsetWidth;
|
||||||
inlineEl.innerText = '❤️'; // Emoji from 1.0 version
|
inlineEl.innerText = '❤️'; // Emoji from 1.0 version
|
||||||
const legacyEmojiWidth = inlineEl.offsetWidth;
|
const legacyEmojiWidth = inlineEl.offsetWidth;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user