From e4f7c6add9b63795a8f568ada6d5544b764856f2 Mon Sep 17 00:00:00 2001 From: Ajay Bura Date: Tue, 25 Jan 2022 12:15:47 +0530 Subject: [PATCH] Show underline on link hover Signed-off-by: Ajay Bura --- src/index.scss | 3 +++ src/util/twemojify.js | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/index.scss b/src/index.scss index a529b0c3..3dbbfc94 100644 --- a/src/index.scss +++ b/src/index.scss @@ -389,6 +389,9 @@ body { a { color: var(--tc-link); text-decoration: none; + &:hover { + text-decoration: underline; + } } b { font-weight: var(--fw-medium); diff --git a/src/util/twemojify.js b/src/util/twemojify.js index 43943bac..bcef5869 100644 --- a/src/util/twemojify.js +++ b/src/util/twemojify.js @@ -13,9 +13,17 @@ import { sanitizeText } from './sanitize'; */ export function twemojify(text, opts, linkify = false, sanitize = true) { if (typeof text !== 'string') return text; - let content = sanitize ? twemoji.parse(sanitizeText(text), opts) : twemoji.parse(text, opts); + let content = text; + + if (sanitize) { + content = sanitizeText(content); + } + content = twemoji.parse(content, opts); if (linkify) { - content = linkifyHtml(content, { target: '_blank', rel: 'noreferrer noopener' }); + content = linkifyHtml(content, { + target: '_blank', + rel: 'noreferrer noopener', + }); } return parse(content); }