From 5a950cf991d7c4e5142dbf0a3228acce81c17475 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Mon, 20 Jan 2020 01:53:17 +0900 Subject: [PATCH] Fix syuilo#5729 (#5732) --- src/mfm/fromHtml.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mfm/fromHtml.ts b/src/mfm/fromHtml.ts index 60293b07f..0ffae014a 100644 --- a/src/mfm/fromHtml.ts +++ b/src/mfm/fromHtml.ts @@ -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) {