mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-15 19:22:52 +02:00
chore: add dependabot, remove html comments from post excerpts
This commit is contained in:
parent
e8c2ac5790
commit
adbad9a0a4
5 changed files with 153 additions and 130 deletions
|
@ -48,8 +48,9 @@ export function generateExcerpt(
|
|||
if (!content)
|
||||
return ''
|
||||
|
||||
// Remove Markdown headings
|
||||
// Remove HTML comments and Markdown headings
|
||||
const contentWithoutHeadings = content
|
||||
.replace(/<!--[\s\S]*?-->/g, '')
|
||||
.replace(/^#{1,6}\s+\S.*$/gm, '')
|
||||
.replace(/\n{2,}/g, '\n\n')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue