diff options
Diffstat (limited to 'src/text/html.ts')
| -rw-r--r-- | src/text/html.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/text/html.ts b/src/text/html.ts index f33ef4997b..70b341689a 100644 --- a/src/text/html.ts +++ b/src/text/html.ts @@ -1,5 +1,6 @@ import { lib as emojilib } from 'emojilib'; import { JSDOM } from 'jsdom'; +import config from '../config'; const handlers = { bold({ document }, { bold }) { @@ -24,8 +25,10 @@ const handlers = { hashtag({ document }, { hashtag }) { const a = document.createElement('a'); - a.href = '/search?q=#' + hashtag; - a.textContent = hashtag; + a.href = config.url + '/tags/' + hashtag; + a.textContent = '#' + hashtag; + a.setAttribute('rel', 'tag'); + document.body.appendChild(a); }, 'inline-code'({ document }, { code }) { @@ -43,7 +46,7 @@ const handlers = { mention({ document }, { content }) { const a = document.createElement('a'); - a.href = '/' + content; + a.href = `${config.url}/${content}`; a.textContent = content; document.body.appendChild(a); }, |