Skip to content

Commit

Permalink
使用正则
Browse files Browse the repository at this point in the history
  • Loading branch information
Nisekoi5 committed Jan 16, 2024
1 parent f1b4887 commit 1993d87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vitepress-plugin-git-changelog/src/client/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export function renderMarkdown(markdownText = '') {
const htmlText = markdownText
.replaceAll('<', '&lt;')
.replaceAll('>', '&gt;')
.replace(/</gm, '&lt;')
.replace(/>/gm, '&gt;')
.replace(/^### (.*$)/gim, '<h3>$1</h3>')
.replace(/^## (.*$)/gim, '<h2>$1</h2>')
.replace(/^# (.*$)/gim, '<h1>$1</h1>')
Expand Down

0 comments on commit 1993d87

Please sign in to comment.