Skip to content

Commit

Permalink
fix(theme): replace angle brackets in inline markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
10Derozan committed Mar 21, 2024
1 parent 55474e3 commit b6e0d99
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/red-lions-unite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@rspress/theme-default': patch
---

fix(theme): replace angle brackets in inline markdown
1 change: 1 addition & 0 deletions packages/theme-default/src/logic/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export function renderHtmlOrText(str?: string | number | null) {
*/
export function renderInlineMarkdown(text: string) {
const htmlText = text
.replace(/</g, '&lt;')
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
.replace(/`(.*?)`/g, '<code>$1</code>');
return renderHtmlOrText(htmlText);
Expand Down

0 comments on commit b6e0d99

Please sign in to comment.