Skip to content

Commit e48c08f

Browse files
committed
fix: Storybook mdx code block typecheck compatibility was fixed
1 parent ddbd6e5 commit e48c08f

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

m3-react/storybook/utils/mdxCodeBlock.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ function ensureLanguagesRegistered (): void {
124124

125125
function escapeHtml (value: string): string {
126126
return value
127-
.replaceAll('&', '&')
128-
.replaceAll('<', '&lt;')
129-
.replaceAll('>', '&gt;')
130-
.replaceAll('"', '&quot;')
131-
.replaceAll('\'', '&#39;')
127+
.replace(/&/g, '&amp;')
128+
.replace(/</g, '&lt;')
129+
.replace(/>/g, '&gt;')
130+
.replace(/"/g, '&quot;')
131+
.replace(/'/g, '&#39;')
132132
}
133133

134134
function normalizeLanguageFromClass (className?: string | null): string | null {

m3-vue/storybook/utils/mdxCodeBlock.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ function ensureLanguagesRegistered (): void {
124124

125125
function escapeHtml (value: string): string {
126126
return value
127-
.replaceAll('&', '&amp;')
128-
.replaceAll('<', '&lt;')
129-
.replaceAll('>', '&gt;')
130-
.replaceAll('"', '&quot;')
131-
.replaceAll('\'', '&#39;')
127+
.replace(/&/g, '&amp;')
128+
.replace(/</g, '&lt;')
129+
.replace(/>/g, '&gt;')
130+
.replace(/"/g, '&quot;')
131+
.replace(/'/g, '&#39;')
132132
}
133133

134134
function normalizeLanguageFromClass (className?: string | null): string | null {

0 commit comments

Comments
 (0)