diff --git a/packages/saber-plugin-search/lib/index.js b/packages/saber-plugin-search/lib/index.js index 13367513a..e70d9cd0e 100644 --- a/packages/saber-plugin-search/lib/index.js +++ b/packages/saber-plugin-search/lib/index.js @@ -10,10 +10,6 @@ function getLocale(locale) { return db[locale] } -function stripHTML(input) { - return input.replace(/<(?:.|\n)*?>/gm, '') -} - exports.apply = (api, options) => { const { index } = Object.assign( { @@ -44,11 +40,11 @@ exports.apply = (api, options) => { const value = page[element] if (value !== undefined) { if (element === 'content') { - item.content = stripHTML( - await api.renderer.renderPageContent(page.permalink) + item.content = await api.renderer.renderPageContent( + page.permalink ) } else { - item[element] = stripHTML(page[element]) + item[element] = page[element] } } }