fix: fix pleroma hashtag links (#1511)

fixes #832
This commit is contained in:
Nolan Lawson 2019-09-22 15:12:51 -07:00 committed by GitHub
parent 98a4fbb96e
commit d0b7f981d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -121,7 +121,7 @@
// hydrate hashtag // hydrate hashtag
if (tags && anchor.classList.contains('hashtag')) { if (tags && anchor.classList.contains('hashtag')) {
for (const tag of tags) { for (const tag of tags) {
if (anchor.getAttribute('href').toLowerCase().endsWith(`/tags/${tag.name.toLowerCase()}`)) { if (anchor.getAttribute('href').toLowerCase().endsWith(`/${tag.name.toLowerCase()}`)) {
anchor.setAttribute('href', `/tags/${tag.name}`) anchor.setAttribute('href', `/tags/${tag.name}`)
anchor.setAttribute('id', `status-content-link-${uuid}-${++count}`) anchor.setAttribute('id', `status-content-link-${uuid}-${++count}`)
anchor.removeAttribute('target') anchor.removeAttribute('target')