summaryrefslogtreecommitdiff
path: root/src/mfm
diff options
context:
space:
mode:
authorAcid Chicken (硫酸鶏) <root@acid-chicken.com>2019-03-15 00:03:24 +0900
committerGitHub <noreply@github.com>2019-03-15 00:03:24 +0900
commit68d43e43b61254803a307605043ffeab08ca6fd9 (patch)
tree4a34b0e8fe04e066311e017becfcb2a2afcfc6ba /src/mfm
parentFollow #3676 (diff)
downloadmisskey-68d43e43b61254803a307605043ffeab08ca6fd9.tar.gz
misskey-68d43e43b61254803a307605043ffeab08ca6fd9.tar.bz2
misskey-68d43e43b61254803a307605043ffeab08ca6fd9.zip
Fix hashtag style
Diffstat (limited to 'src/mfm')
-rw-r--r--src/mfm/fromHtml.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mfm/fromHtml.ts b/src/mfm/fromHtml.ts
index 330ebdde09..369f9de0ee 100644
--- a/src/mfm/fromHtml.ts
+++ b/src/mfm/fromHtml.ts
@@ -39,10 +39,11 @@ 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;
// ハッシュタグ / hrefがない / txtがURL
- if ((rel && rel.value.match('tag') !== null) || !href || href.value == txt) {
- text += txt.match(urlRegex) ? txt : `<${txt}>`;
+ if (isHashtag || !href || href.value == txt) {
+ text += isHashtag || txt.match(urlRegex) ? txt : `<${txt}>`;
// メンション
} else if (txt.startsWith('@') && !(rel && rel.value.match(/^me /))) {
const part = txt.split('@');