Skip to content

Commit 06e0f0d

Browse files
authored
fix: allow to omit region name in endregion tag in code snippets (#1909)
* fix: allow to omit region name in endregion tag in code snippets * fix: allow leading spaces in code block * Discard changes to packages/slidev/node/syntax/transform/snippet.ts * allow tab
1 parent 5666d07 commit 06e0f0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/slidev/node/syntax/transform/code-wrapper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { MarkdownTransformContext } from '@slidev/types'
22
import { normalizeRangeStr } from './utils'
33

44
// eslint-disable-next-line regexp/no-super-linear-backtracking
5-
export const reCodeBlock = /^```([\w'-]+)?\s*(?:\{([\w*,|-]+)\}\s*?(\{[^}]*\})?([^\r\n]*))?\r?\n(\S[\s\S]*?)^```$/gm
5+
export const reCodeBlock = /^```([\w'-]+)?\s*(?:\{([\w*,|-]+)\}\s*?(\{[^}]*\})?([^\r\n]*))?\r?\n([ \t]*\S[\s\S]*?)^```$/gm
66

77
/**
88
* Transform code block with wrapper

0 commit comments

Comments
 (0)