Skip to content
Snippets Groups Projects
Commit 6a4da03c authored by Ole Voldsæter's avatar Ole Voldsæter
Browse files

homografnummer i "alle søkeresultater"

parent 4f655a98
No related branches found
No related tags found
No related merge requests found
<template>
<li>
<div class="preview">
<h4>{{searchHit.text ||
(searchHit._source && searchHit._source.lemmas.map(l => l.lemma) || []).join(',') ||
"Alle søkeresultater..."}}</h4>
<h4 v-html="previewHeader"></h4>
<h5 v-if="searchHit._source">{{group_list}}</h5>
{{previewText.substring(0, 40) + (previewText ? '...' : '')}}
</div>
......@@ -21,6 +19,11 @@ export default {
searchHit: Object
},
computed: {
previewHeader: function(){
return this.searchHit.text ||
(this.searchHit._source && this.searchHit._source.lemmas.map(l => `<span class="homograph">${l.hgno ? String.fromCharCode(0x215f + l.hgno) + ' ' : ''}</span>${l.lemma}`) || []).join(',') ||
"Alle søkeresultater..."
},
previewText: function(){
if (! this.searchHit._source) return ''
let element = this.searchHit._source.body.definitions[0] || ''
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment