diff --git a/lib/broccoli/search-indexer.js b/lib/broccoli/search-indexer.js index d559349db..2a2c473ae 100644 --- a/lib/broccoli/search-indexer.js +++ b/lib/broccoli/search-indexer.js @@ -3,12 +3,10 @@ const Writer = require('broccoli-caching-writer'); const lunr = require('lunr'); const striptags = require('striptags'); -const Entities = require('html-entities').AllHtmlEntities; +const { decode } = require('html-entities'); const fs = require('fs-extra'); const path = require('path'); -const htmlEntities = new Entities(); - module.exports = class SearchIndexCompiler extends Writer { constructor(input, options) { super([input]); @@ -121,7 +119,7 @@ module.exports = class SearchIndexCompiler extends Writer { type: 'component', title: item.attributes.name, keywords: keywords, - text: htmlEntities.decode(striptags(normalizeText(item.attributes.description))), + text: decode(striptags(normalizeText(item.attributes.description))), item }; } diff --git a/package.json b/package.json index 6c2684080..831dd7576 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "git-repo-info": "^2.1.1", "highlight.js": "^10.4.0", "hosted-git-info": "^3.0.4", - "html-entities": "^1.2.1", + "html-entities": "^2.0.6", "inflected": "^2.0.3", "jsdom": "^16.4.0", "json-api-serializer": "^2.2.1", diff --git a/yarn.lock b/yarn.lock index 4d189428c..5cd5b65bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9172,10 +9172,10 @@ html-encoding-sniffer@^2.0.1: dependencies: whatwg-encoding "^1.0.5" -html-entities@^1.2.1: - version "1.4.0" - resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.4.0.tgz#cfbd1b01d2afaf9adca1b10ae7dffab98c71d2dc" - integrity sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA== +html-entities@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.0.6.tgz#e773b9acfad65718dd194e599f1b11cf5704b925" + integrity sha512-SiH2gwQT78XunjDZfXAa6KrE91kzZUGbef3PL9JmWS+DhL48/+FC+1sNh++/titGzIs8NvH+xuNam/FwV7mJsQ== html-tags@^3.1.0: version "3.1.0"