Preserve links with embedded emoji

This commit is contained in:
Scott Nonnenberg 2019-01-02 11:56:33 -08:00
parent dc9f9dabfd
commit 6eb8f5680c
4 changed files with 54 additions and 11 deletions

View file

@ -10,6 +10,8 @@ instance.include_title = true;
instance.replace_mode = 'img';
instance.supports_css = false; // needed to avoid spans with background-image
export type SizeClassType = '' | 'small' | 'medium' | 'large' | 'jumbo';
export function getRegex(): RegExp {
return instance.rx_unified;
}
@ -56,7 +58,7 @@ function hasNormalCharacters(str: string) {
return noEmoji.length > 0;
}
export function getSizeClass(str: string) {
export function getSizeClass(str: string): SizeClassType {
if (hasNormalCharacters(str)) {
return '';
}