Show underline on link hover
authorAjay Bura <ajbura@gmail.com>
Tue, 25 Jan 2022 06:45:47 +0000 (12:15 +0530)
committerAjay Bura <ajbura@gmail.com>
Tue, 25 Jan 2022 06:45:47 +0000 (12:15 +0530)
Signed-off-by: Ajay Bura <ajbura@gmail.com>
src/index.scss
src/util/twemojify.js

index a529b0c3760d6421405f4bd238522f3ad35766f9..3dbbfc94f3daf7bd2c311f403901857b5f208448 100644 (file)
@@ -389,6 +389,9 @@ body {
 a {
   color: var(--tc-link);
   text-decoration: none;
+  &:hover {
+    text-decoration: underline;
+  }
 }
 b {
   font-weight: var(--fw-medium);
index 43943bac84612aa81ade8d9a415aa03c34e08340..bcef58699a1129d799f5a7d9c31204807be8543f 100644 (file)
@@ -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);
 }