diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-03-18 01:16:32 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-03-18 01:16:32 +0900 |
| commit | bc3006f3c41297536788ec20ea012ba0a4d0ee24 (patch) | |
| tree | 66878ca481de7e0005bfd6bb91c7d027d018511d /src/web/app/common/scripts | |
| parent | nanka iroiro (diff) | |
| download | sharkey-bc3006f3c41297536788ec20ea012ba0a4d0ee24.tar.gz sharkey-bc3006f3c41297536788ec20ea012ba0a4d0ee24.tar.bz2 sharkey-bc3006f3c41297536788ec20ea012ba0a4d0ee24.zip | |
#277
Diffstat (limited to 'src/web/app/common/scripts')
| -rw-r--r-- | src/web/app/common/scripts/text-compiler.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/web/app/common/scripts/text-compiler.js b/src/web/app/common/scripts/text-compiler.js index 2edffbb766..d4570ca923 100644 --- a/src/web/app/common/scripts/text-compiler.js +++ b/src/web/app/common/scripts/text-compiler.js @@ -21,8 +21,10 @@ module.exports = (tokens, shouldBreak) => { .replace(/(\r\n|\n|\r)/g, shouldBreak ? '<br>' : ' '); case 'bold': return '<strong>' + escape(token.bold) + '</strong>'; - case 'link': + case 'url': return '<mk-url href="' + escape(token.content) + '" target="_blank"></mk-url>'; + case 'link': + return '<a class="link" href="' + escape(token.url) + '" target="_blank">' + escape(token.title) + '</a>'; case 'mention': return '<a href="' + CONFIG.url + '/' + escape(token.username) + '" target="_blank" data-user-preview="' + token.content + '" ' + (me && me.username == token.username ? 'data-is-me' : '') + '>' + token.content + '</a>'; case 'hashtag': // TODO |