Skip to content

Commit

Permalink
fix: allow to omit region name in endregion tag in code snippets (#1909)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
KermanX authored Oct 26, 2024
1 parent 5666d07 commit 06e0f0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/slidev/node/syntax/transform/code-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { MarkdownTransformContext } from '@slidev/types'
import { normalizeRangeStr } from './utils'

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

/**
* Transform code block with wrapper
Expand Down

0 comments on commit 06e0f0d

Please sign in to comment.