diff options
Diffstat (limited to 'packages/astro-parser/src/parse/state/fragment.ts')
-rw-r--r-- | packages/astro-parser/src/parse/state/fragment.ts | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/packages/astro-parser/src/parse/state/fragment.ts b/packages/astro-parser/src/parse/state/fragment.ts index d3b30f329..fc8874a19 100644 --- a/packages/astro-parser/src/parse/state/fragment.ts +++ b/packages/astro-parser/src/parse/state/fragment.ts @@ -7,26 +7,26 @@ import codespan from './codespan.js'; import { Parser } from '../index.js'; export default function fragment(parser: Parser) { - if (parser.html.children.length === 0 && parser.match_regex(/^---/m)) { - return setup; - } + if (parser.html.children.length === 0 && parser.match_regex(/^---/m)) { + return setup; + } - // Fenced code blocks are pretty complex in the GFM spec - // https://github.github.com/gfm/#fenced-code-blocks - if (parser.match_regex(/[`~]{3,}/)) { - return codefence; - } - if (parser.match_regex(/(?<!\\)`{1,2}/)) { - return codespan; - } + // Fenced code blocks are pretty complex in the GFM spec + // https://github.github.com/gfm/#fenced-code-blocks + if (parser.match_regex(/[`~]{3,}/)) { + return codefence; + } + if (parser.match_regex(/(?<!\\)`{1,2}/)) { + return codespan; + } - if (parser.match('<')) { - return tag; - } + if (parser.match('<')) { + return tag; + } - if (parser.match('{')) { - return mustache; - } + if (parser.match('{')) { + return mustache; + } - return text; + return text; } |