Skip to content

Commit 03d17e9

Browse files
committed
fix #694
1 parent da432db commit 03d17e9

File tree

1 file changed

+5
-5
lines changed
  • packages/site-kit/src/lib/markdown

1 file changed

+5
-5
lines changed

packages/site-kit/src/lib/markdown/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ export const SHIKI_LANGUAGE_MAP = {
1919
*/
2020
export function clean(markdown: string) {
2121
return markdown
22-
.replace(/\*\*(.+?)\*\*/g, '$1') // bold
23-
.replace(/_(.+?)_/g, '$1') // Italics
24-
.replace(/\*(.+?)\*/g, '$1') // Italics
25-
.replace(/`(.+?)`/g, '$1') // Inline code
26-
.replace(/~~(.+?)~~/g, '$1') // Strikethrough
22+
.replace(/(?:^|b)\*\*(.+?)\*\*(?:\b|$)/g, '$1') // bold
23+
.replace(/(?:^|b)_(.+?)_(?:\b|$)/g, '$1') // Italics
24+
.replace(/(?:^|b)\*(.+?)\*(?:\b|$)/g, '$1') // Italics
25+
.replace(/(?:^|b)`(.+?)`(?:\b|$)/g, '$1') // Inline code
26+
.replace(/(?:^|b)~~(.+?)~~(?:\b|$)/g, '$1') // Strikethrough
2727
.replace(/\[(.+?)\]\(.+?\)/g, '$1') // Link
2828
.replace(/\n/g, ' ') // New line
2929
.replace(/ {2,}/g, ' ')

0 commit comments

Comments
 (0)