This commit is contained in:
2023-06-19 16:17:41 +02:00
parent 9543bb863c
commit ea111c2af1
3 changed files with 97 additions and 84 deletions
+1 -1
View File
@@ -101,7 +101,7 @@ export default {
let itemparts, icon, newspan
for (var i = 0; i < items.length; i++) {
itemparts = RegExp(/<span[^>]*class="([^"]+)"[^>]*>.+<\/span>/g).exec(items[i], 'g')
console.log('itemparts', itemparts)
// console.log('itemparts', itemparts)
switch (itemparts[1]) {
case 'placeName':
icon = '<span class="index-item-icon mdi mdi-map-marker"></span>'
+8 -4
View File
@@ -51,11 +51,15 @@ export default {
},
created () {
let max = 40
if (this.result.title.length > max) {
let subString = this.result.title.substr(0, max)
this.shorted_title = subString.substr(0, subString.lastIndexOf(' ')) + '&nbsp&hellip;'
if (this.result.title) {
if (this.result.title.length > max) {
let subString = this.result.title.substr(0, max)
this.shorted_title = subString.substr(0, subString.lastIndexOf(' ')) + '&nbsp&hellip;'
} else {
this.shorted_title = this.result.title
}
} else {
this.shorted_title = this.result.title
console.warn(`no result title for ${this.result.uuid}`, this.result)
}
// if (this.result.extract) {
// const subString = this.result.extract.substr(0, 80)