Fix syuilo#5729 (#5732)

This commit is contained in:
MeiMei 2020-01-20 01:53:17 +09:00 committed by syuilo
parent 75cb7f8b36
commit 5a950cf991

View File

@ -36,7 +36,8 @@ export function fromHtml(html: string): string {
const txt = getText(node);
const rel = node.attrs.find((x: any) => x.name == 'rel');
const href = node.attrs.find((x: any) => x.name == 'href');
const isHashtag = rel && rel.value.match('tag') !== null;
const _class = node.attrs.find((x: any) => x.name == 'class');
const isHashtag = rel?.value?.match('tag') || _class?.value?.match('hashtag');
// ハッシュタグ / hrefがない / txtがURL
if (isHashtag || !href || href.value == txt) {