diff --git a/_includes/search_page.html b/_includes/search_page.html
index 1684d270ea3..49a20db6a00 100644
--- a/_includes/search_page.html
+++ b/_includes/search_page.html
@@ -134,7 +134,7 @@
Advanced Search
if ('content' in hit._highlightResult) {
if ('value' in hit._highlightResult.content) {
- content = hit._highlightResult.content.value;
+ content = hit._highlightResult.content.value.replace(/<(.|\n)*?>/g, '');
}
}
diff --git a/_plugins/algolia_hooks.rb b/_plugins/algolia_hooks.rb
index a1012f4401b..20fa84e2b39 100644
--- a/_plugins/algolia_hooks.rb
+++ b/_plugins/algolia_hooks.rb
@@ -30,12 +30,11 @@ def self.before_indexing_each(record, node, context)
if record[:html]
html = Nokogiri::HTML.parse(record[:html])
html.search('.lineno').remove
- html = html.text.gsub(/\s+/,' ')[0 ... 4400]
+ html = html.text.gsub(/\s+/,' ').gsub(/[\u0080-\u00ff]/,'')[0 ... 4400]
record[:html] = html
end
if record[:content]
- record[:content].gsub!(/^\d+\n/,'')
- record[:content] = record[:content][0 ... 4400]
+ record[:content] = record[:content].gsub(/^\d+\n/,'').gsub(/[\u0080-\u00ff]/,'')[0 ... 4400]
end
# fix glossary generating algolia record that's too big
if record[:glossaries]
diff --git a/assets/js/documents.js b/assets/js/documents.js
index 12722902b06..4cf9c4e6ee7 100644
--- a/assets/js/documents.js
+++ b/assets/js/documents.js
@@ -253,7 +253,7 @@ $(document).ready(function() {
if ('content' in suggestion._highlightResult){
if ('value' in suggestion._highlightResult.content){
- content = suggestion._highlightResult.content.value.replace('%20', ' ').replace('_', ' ');
+ content = suggestion._highlightResult.content.value.replace('%20', ' ').replace('_', ' ').replace(/<(.|\n)*?>/g, '');
}
}
if (content.length > 400) {