From 3b3f7363dae105be35ebc02d62c66e666181bf69 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 12 Jun 2018 09:10:34 +0900 Subject: [PATCH] Fix bugs --- src/client/app/common/views/components/note-html.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/client/app/common/views/components/note-html.ts b/src/client/app/common/views/components/note-html.ts index 2fa13b16e..8ace37582 100644 --- a/src/client/app/common/views/components/note-html.ts +++ b/src/client/app/common/views/components/note-html.ts @@ -44,7 +44,10 @@ export default Vue.component('mk-note-html', { return; } - while (ast[ast.length - 1].type == 'hashtag') { + while ( + ast[ast.length - 1].type == 'hashtag' || + (ast[ast.length - 1].type == 'text' && ast[ast.length - 1].content == ' ') || + (ast[ast.length - 1].type == 'text' && ast[ast.length - 1].content == '\n')) { ast.pop(); } @@ -100,7 +103,7 @@ export default Vue.component('mk-note-html', { case 'hashtag': return createElement('a', { attrs: { - href: `${url}/search?q=${token.content}`, + href: `${url}/tags/${token.content}`, target: '_blank' } }, token.content);