Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/src/core/api/markdown-regex.ts
6458 views
1
// src/core/api/markdown-regex.ts
2
3
import { globalRegistry } from "./registry.ts";
4
import type { MarkdownRegexNamespace } from "./types.ts";
5
6
// Import implementations
7
import { readYamlFromMarkdown } from "../yaml.ts";
8
import {
9
languagesInMarkdown,
10
languagesWithClasses,
11
partitionMarkdown,
12
} from "../pandoc/pandoc-partition.ts";
13
import { breakQuartoMd } from "../lib/break-quarto-md.ts";
14
15
// Register markdownRegex namespace
16
globalRegistry.register("markdownRegex", (): MarkdownRegexNamespace => {
17
return {
18
extractYaml: readYamlFromMarkdown,
19
partition: partitionMarkdown,
20
getLanguages: languagesInMarkdown,
21
getLanguagesWithClasses: languagesWithClasses,
22
breakQuartoMd,
23
};
24
});
25
26