Skip to content

Commit

Permalink
fix: incorrect indentation issue and trim html content
Browse files Browse the repository at this point in the history
  • Loading branch information
razortanmayshah committed Mar 29, 2024
1 parent 451f714 commit a3bcbca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion build-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ const build = async (config) => {

docsWithContent.forEach((doc) => {
let content = atRules(doc.body, config, doc.key);
const parsedContent = markdown(content, config);
const trimmedContent = content.split('\n').filter(line => Boolean(line.trim())).map(line => line.trim()).join('\n')
const parsedContent = markdown(trimmedContent, config);
const parsedContentWithFrontmatter = {
...parsedContent,
...doc.frontMatter,
body: content,
href: doc.href,
content: parsedContent.content.split('\n').join(''),
};
applyPlugin({ plugin, content: parsedContentWithFrontmatter });
});
Expand Down

0 comments on commit a3bcbca

Please sign in to comment.