Show underline on link hover

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura 2022-01-25 12:15:47 +05:30
parent 80110d1a48
commit e4f7c6add9
2 changed files with 13 additions and 2 deletions

View file

@ -389,6 +389,9 @@ body {
a {
color: var(--tc-link);
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
b {
font-weight: var(--fw-medium);

View 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);
}