Truncate search result text for performance reasons

This commit is contained in:
squidfunk
2017-03-16 16:26:52 +01:00
committed by Martin Donath
parent 675a75e000
commit d77d900479
3 changed files with 6 additions and 4 deletions

View File

@@ -205,14 +205,16 @@ export default class Result {
</h1>
{section.text.length ?
<p class="md-search-result__teaser">
{{ __html: section.text.replace(match, highlight) }}
{{ __html: this.truncate_(
section.text.replace(match, highlight), 400)
}}
</p> : {}}
</article>
</a>
)
})}
</li>
) /* {this.truncate_(doc.text, 140)} */
)
})
/* Bind click handlers for anchors */