From 291beb45fcb7a4c856232b12848ebad8267e2840 Mon Sep 17 00:00:00 2001 From: Aya Morisawa Date: Sat, 1 Sep 2018 23:12:51 +0900 Subject: Use string interpolation --- src/mfm/html-to-mfm.ts | 2 +- src/mfm/html.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mfm') diff --git a/src/mfm/html-to-mfm.ts b/src/mfm/html-to-mfm.ts index e2681f5447..b476a9af5c 100644 --- a/src/mfm/html-to-mfm.ts +++ b/src/mfm/html-to-mfm.ts @@ -45,7 +45,7 @@ export default function(html: string): string { if (part.length == 2) { //#region ホスト名部分が省略されているので復元する - const acct = txt + '@' + (new URL(href.value)).hostname; + const acct = `${txt}@${(new URL(href.value)).hostname}`; text += acct; break; //#endregion diff --git a/src/mfm/html.ts b/src/mfm/html.ts index c798ee410a..2e38fe10a0 100644 --- a/src/mfm/html.ts +++ b/src/mfm/html.ts @@ -44,8 +44,8 @@ const handlers: { [key: string]: (window: any, token: any, mentionedRemoteUsers: hashtag({ document }, { hashtag }) { const a = document.createElement('a'); - a.href = config.url + '/tags/' + hashtag; - a.textContent = '#' + hashtag; + a.href = `${config.url}/tags/${hashtag}`; + a.textContent = `#${hashtag}`; a.setAttribute('rel', 'tag'); document.body.appendChild(a); }, -- cgit v1.2.3-freya