Permalink
Browse files

Escape html from search excerpts

  • Loading branch information...
mbajur committed May 30, 2017
1 parent cc8ab43 commit 014643b98cc3a821115f90143d580bc06456a33c
Showing with 4 additions and 1 deletion.
  1. +4 −1 source/javascripts/search.js
@@ -44,7 +44,10 @@ $(document).ready(function() {
.replace('Guides - ', '')
var doc = window.lunrData.docs[suggestion.ref]
var excerpt = excerptSearch(currentValue, doc.content, {
var content = doc.content
content = content.replace(/<[^>]*>/g, '')
var excerpt = excerptSearch(currentValue, content, {
padding: 40,
highlightClass: 'highlighted'
})

0 comments on commit 014643b

Please sign in to comment.