search, filters, links, bug fix, misc, ALPHA

This commit is contained in:
2020-07-17 19:14:18 +02:00
parent 4c2288cf97
commit fb4cb676ac
7 changed files with 143 additions and 113 deletions
+21 -16
View File
@@ -57,22 +57,27 @@ export default {
for (var i = 0; i < links.length; i++) {
// console.log(`link ${i}:`, links[i])
linkparts = RegExp(/<a class="(.+)" href="(.+)" data-index="(.+)">(.+)<\/a>/g).exec(links[i], 'g')
index = linkparts[3]
uuid = linkparts[2].replace('#', '')
newlink = `<a` +
` class="${linkparts[1]} active-link"` +
` data-index="${index}"` +
` data-uuid="${uuid}"` +
` href="/${index}/${uuid}"` +
` @click.prevent="onClickRef"` +
` @keyup.enter="onClickRef"` +
` @mouseover="onHoverLink"` +
` @mouseleave="onLeaveLink"` +
`>${linkparts[4]}` +
`<sup class="mdi mdi-message-text-outline" />` +
`</a>`
// console.log('newlink', newlink)
this.html = this.html.replace(links[i], newlink)
// console.log('linkparts', linkparts)
if (!linkparts) {
console.warn(`link ${i} malformed:`, links[i])
} else {
index = linkparts[3]
uuid = linkparts[2].replace('#', '')
newlink = `<a` +
` class="${linkparts[1]} active-link"` +
` data-index="${index}"` +
` data-uuid="${uuid}"` +
` href="/${index}/${uuid}"` +
` @click.prevent="onClickRef"` +
` @keyup.enter="onClickRef"` +
` @mouseover="onHoverLink"` +
` @mouseleave="onLeaveLink"` +
`>${linkparts[4]}` +
`<sup class="mdi mdi-message-text-outline" />` +
`</a>`
// console.log('newlink', newlink)
this.html = this.html.replace(links[i], newlink)
}
}
// console.log('this.html', this.html)
}