site/node_modules/shiki/dist/langs/markdown.mjs

57 lines
58 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
const lang = Object.freeze({ "displayName": "Markdown", "name": "markdown", "patterns": [{ "include": "#frontMatter" }, { "include": "#block" }], "repository": { "ampersand": { "comment": "Markdown will convert this for us. We match it so that the HTML grammar will not mark it up as invalid.", "match": "&(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);)", "name": "meta.other.valid-ampersand.markdown" }, "block": { "patterns": [{ "include": "#separator" }, { "include": "#heading" }, { "include": "#blockquote" }, { "include": "#lists" }, { "include": "#fenced_code_block" }, { "include": "#raw_block" }, { "include": "#link-def" }, { "include": "#html" }, { "include": "#table" }, { "include": "#paragraph" }] }, "blockquote": { "begin": "(^|\\G)[ ]{0,3}(>) ?", "captures": { "2": { "name": "punctuation.definition.quote.begin.markdown" } }, "name": "markup.quote.markdown", "patterns": [{ "include": "#block" }], "while": "(^|\\G)\\s*(>) ?" }, "bold": { "begin": "(?x) (?<open>(\\*\\*(?=\\w)|(?<!\\w)\\*\\*|(?<!\\w)\\b__))(?=\\S) (?=\n(\n<[^>]*+>\n| (?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw>\n\n| \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+\n| \\[\n(\n(?<square>\n[^\\[\\]\\\\]\n| \\\\.\n| \\[ \\g<square>*+ \\]\n)*+\n\\]\n(\n(\n[ ]?\n\\[[^\\]]*+\\]\n)\n| (\n\\(\n[ \\t]*+\n<?(.*?)>?\n[ \\t]*+\n(\n(?<title>['\"])\n(.*?)\n\\k<title>\n)?\n\\)\n)\n)\n)\n| (?!(?<=\\S)\\k<open>).\n\n)++\n(?<=\\S)(?=__\\b|\\*\\*)\\k<open>\n)\n", "captures": { "1": { "name": "punctuation.definition.bold.markdown" } }, "end": "(?<=\\S)(\\1)", "name": "markup.bold.markdown", "patterns": [{ "applyEndPatternLast": 1, "begin": "(?=<[^>]*?>)", "end": "(?<=>)", "patterns": [{ "include": "text.html.derivative" }] }, { "include": "#escape" }, { "include": "#ampersand" }, { "include": "#bracket" }, { "include": "#raw" }, { "include": "#bold" }, { "include": "#italic" }, { "include": "#image-inline" }, { "include": "#link-inline" }, { "include": "#link-inet" }, { "include": "#link-email" }, { "include": "#image-ref" }, { "include": "#link-ref-literal" }, { "include": "#link-ref" }, { "include": "#link-ref-shortcut" }, { "include": "#strikethrough" }] }, "bracket": { "comment": "Markdown will convert this for us. We match it so that the HTML grammar will not mark it up as invalid.", "match": "<(?![a-zA-Z/?\\$!])", "name": "meta.other.valid-bracket.markdown" }, "escape": { "match": "\\\\[-`*_#+.!(){}\\[\\]\\\\>]", "name": "constant.character.escape.markdown" }, "fenced_code_block": { "patterns": [{ "include": "#fenced_code_block_css" }, { "include": "#fenced_code_block_basic" }, { "include": "#fenced_code_block_ini" }, { "include": "#fenced_code_block_java" }, { "include": "#fenced_code_block_lua" }, { "include": "#fenced_code_block_makefile" }, { "include": "#fenced_code_block_perl" }, { "include": "#fenced_code_block_r" }, { "include": "#fenced_code_block_ruby" }, { "include": "#fenced_code_block_php" }, { "include": "#fenced_code_block_sql" }, { "include": "#fenced_code_block_vs_net" }, { "include": "#fenced_code_block_xml" }, { "include": "#fenced_code_block_xsl" }, { "include": "#fenced_code_block_yaml" }, { "include": "#fenced_code_block_dosbatch" }, { "include": "#fenced_code_block_clojure" }, { "include": "#fenced_code_block_coffee" }, { "include": "#fenced_code_block_c" }, { "include": "#fenced_code_block_cpp" }, { "include": "#fenced_code_block_diff" }, { "include": "#fenced_code_block_dockerfile" }, { "include": "#fenced_code_block_git_commit" }, { "include": "#fenced_code_block_git_rebase" }, { "include": "#fenced_code_block_go" }, { "include": "#fenced_code_block_groovy" }, { "include": "#fenced_code_block_pug" }, { "include": "#fenced_code_block_js" }, { "include": "#fenced_code_block_js_regexp" }, { "include": "#fenced_code_block_json" }, { "include": "#fenced_code_block_jsonc" }, { "include": "#fenced_code_block_less" }, { "include": "#fenced_code_block_objc" }, { "include": "#fenced_code_block_swift" }, { "include": "#fenced_code_block_scss" }, { "include": "#fenced_code_block_perl6" }, { "include": "#fenced_code_block_powershell" }, { "include": "#fenced_code_b
(\\!\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])
(\\()
[ \\t]*
(
(<)((?:\\\\[<>]|[^<>\\n])*)(>)
| ((?<url>(?>[^\\s()]+)|\\(\\g<url>*\\))*)
)
[ \\t]*
(?:
((\\().+?(\\)))
| ((").+?("))
| ((').+?('))
)?
\\s*
(\\))
`, "name": "meta.image.inline.markdown" }, "image-ref": { "captures": { "1": { "name": "punctuation.definition.link.description.begin.markdown" }, "2": { "name": "string.other.link.description.markdown" }, "4": { "name": "punctuation.definition.link.description.end.markdown" }, "5": { "name": "punctuation.definition.constant.markdown" }, "6": { "name": "constant.other.reference.link.markdown" }, "7": { "name": "punctuation.definition.constant.markdown" } }, "match": "(\\!\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])[ ]?(\\[)(.*?)(\\])", "name": "meta.image.reference.markdown" }, "inline": { "patterns": [{ "include": "#ampersand" }, { "include": "#bracket" }, { "include": "#bold" }, { "include": "#italic" }, { "include": "#raw" }, { "include": "#strikethrough" }, { "include": "#escape" }, { "include": "#image-inline" }, { "include": "#image-ref" }, { "include": "#link-email" }, { "include": "#link-inet" }, { "include": "#link-inline" }, { "include": "#link-ref" }, { "include": "#link-ref-literal" }, { "include": "#link-ref-shortcut" }] }, "italic": { "begin": "(?x) (?<open>(\\*(?=\\w)|(?<!\\w)\\*|(?<!\\w)\\b_))(?=\\S)\n(?=\n(\n<[^>]*+>\n| (?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw>\n\n| \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+\n| \\[\n(\n(?<square>\n[^\\[\\]\\\\]\n| \\\\.\n| \\[ \\g<square>*+ \\]\n)*+\n\\]\n(\n(\n[ ]?\n\\[[^\\]]*+\\]\n)\n| (\n\\(\n[ \\t]*+\n<?(.*?)>?\n[ \\t]*+\n(\n(?<title>['\"])\n(.*?)\n\\k<title>\n)?\n\\)\n)\n)\n)\n| \\k<open>\\k<open>\n| (?!(?<=\\S)\\k<open>).\n\n)++\n(?<=\\S)(?=_\\b|\\*)\\k<open>\n)\n", "captures": { "1": { "name": "punctuation.definition.italic.markdown" } }, "end": "(?<=\\S)(\\1)((?!\\1)|(?=\\1\\1))", "name": "markup.italic.markdown", "patterns": [{ "applyEndPatternLast": 1, "begin": "(?=<[^>]*?>)", "end": "(?<=>)", "patterns": [{ "include": "text.html.derivative" }] }, { "include": "#escape" }, { "include": "#ampersand" }, { "include": "#bracket" }, { "include": "#raw" }, { "include": "#bold" }, { "include": "#image-inline" }, { "include": "#link-inline" }, { "include": "#link-inet" }, { "include": "#link-email" }, { "include": "#image-ref" }, { "include": "#link-ref-literal" }, { "include": "#link-ref" }, { "include": "#link-ref-shortcut" }, { "include": "#strikethrough" }] }, "link-def": { "captures": { "1": { "name": "punctuation.definition.constant.markdown" }, "2": { "name": "constant.other.reference.link.markdown" }, "3": { "name": "punctuation.definition.constant.markdown" }, "4": { "name": "punctuation.separator.key-value.markdown" }, "5": { "name": "punctuation.definition.link.markdown" }, "6": { "name": "markup.underline.link.markdown" }, "7": { "name": "punctuation.definition.link.markdown" }, "8": { "name": "markup.underline.link.markdown" }, "9": { "name": "string.other.link.description.title.markdown" }, "10": { "name": "punctuation.definition.string.begin.markdown" }, "11": { "name": "punctuation.definition.string.end.markdown" }, "12": { "name": "string.other.link.description.title.markdown" }, "13": { "name": "punctuation.definition.string.begin.markdown" }, "14": { "name": "punctuation.definition.string.end.markdown" }, "15": { "name": "string.other.link.description.title.markdown" }, "16": { "name": "punctuation.definition.string.begin.markdown" }, "17": { "name": "punctuation.definition.string.end.markdown" } }, "match": `(?x)
\\s*
(\\[)([^]]+?)(\\])(:)
[ \\t]*
(?:(<)((?:\\\\[<>]|[^<>\\n])*)(>)|(\\S+?))
[ \\t]*
(?:
((\\().+?(\\)))
| ((").+?("))
| ((').+?('))
)?
\\s*
$
`, "name": "meta.link.reference.def.markdown" }, "link-email": { "captures": { "1": { "name": "punctuation.definition.link.markdown" }, "2": { "name": "markup.underline.link.markdown" }, "4": { "name": "punctuation.definition.link.markdown" } }, "match": "(<)((?:mailto:)?[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*)(>)", "name": "meta.link.email.lt-gt.markdown" }, "link-inet": { "captures": { "1": { "name": "punctuation.definition.link.markdown" }, "2": { "name": "markup.underline.link.markdown" }, "3": { "name": "punctuation.definition.link.markdown" } }, "match": "(<)((?:https?|ftp)://.*?)(>)", "name": "meta.link.inet.markdown" }, "link-inline": { "captures": { "1": { "name": "punctuation.definition.link.title.begin.markdown" }, "2": { "name": "string.other.link.title.markdown", "patterns": [{ "include": "#raw" }, { "include": "#bold" }, { "include": "#italic" }, { "include": "#strikethrough" }, { "include": "#image-inline" }] }, "4": { "name": "punctuation.definition.link.title.end.markdown" }, "5": { "name": "punctuation.definition.metadata.markdown" }, "7": { "name": "punctuation.definition.link.markdown" }, "8": { "name": "markup.underline.link.markdown" }, "9": { "name": "punctuation.definition.link.markdown" }, "10": { "name": "markup.underline.link.markdown" }, "12": { "name": "string.other.link.description.title.markdown" }, "13": { "name": "punctuation.definition.string.begin.markdown" }, "14": { "name": "punctuation.definition.string.end.markdown" }, "15": { "name": "string.other.link.description.title.markdown" }, "16": { "name": "punctuation.definition.string.begin.markdown" }, "17": { "name": "punctuation.definition.string.end.markdown" }, "18": { "name": "string.other.link.description.title.markdown" }, "19": { "name": "punctuation.definition.string.begin.markdown" }, "20": { "name": "punctuation.definition.string.end.markdown" }, "21": { "name": "punctuation.definition.metadata.markdown" } }, "match": `(?x)
(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])
(\\()
[ \\t]*
(
(<)((?:\\\\[<>]|[^<>\\n])*)(>)
| ((?<url>(?>[^\\s()]+)|\\(\\g<url>*\\))*)
)
[ \\t]*
(?:
((\\()[^()]*(\\)))
| ((")[^"]*("))
| ((')[^']*('))
)?
\\s*
(\\))
`, "name": "meta.link.inline.markdown" }, "link-ref": { "captures": { "1": { "name": "punctuation.definition.link.title.begin.markdown" }, "2": { "name": "string.other.link.title.markdown", "patterns": [{ "include": "#raw" }, { "include": "#bold" }, { "include": "#italic" }, { "include": "#strikethrough" }, { "include": "#image-inline" }] }, "4": { "name": "punctuation.definition.link.title.end.markdown" }, "5": { "name": "punctuation.definition.constant.begin.markdown" }, "6": { "name": "constant.other.reference.link.markdown" }, "7": { "name": "punctuation.definition.constant.end.markdown" } }, "match": "(?<![\\]\\\\])(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])(\\[)([^\\]]*+)(\\])", "name": "meta.link.reference.markdown" }, "link-ref-literal": { "captures": { "1": { "name": "punctuation.definition.link.title.begin.markdown" }, "2": { "name": "string.other.link.title.markdown" }, "4": { "name": "punctuation.definition.link.title.end.markdown" }, "5": { "name": "punctuation.definition.constant.begin.markdown" }, "6": { "name": "punctuation.definition.constant.end.markdown" } }, "match": "(?<![\\]\\\\])(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])[ ]?(\\[)(\\])", "name": "meta.link.reference.literal.markdown" }, "link-ref-shortcut": { "captures": { "1": { "name": "punctuation.definition.link.title.begin.markdown" }, "2": { "name": "string.other.link.title.markdown" }, "3": { "name": "punctuation.definition.link.title.end.markdown" } }, "match": "(?<![\\]\\\\])(\\[)((?:[^\\s\\[\\]\\\\]|\\\\[\\[\\]])+?)((?<!\\\\)\\])", "name": "meta.link.reference.markdown" }, "list_paragraph": { "begin": "(^|\\G)(?=\\S)(?![*+->]\\s|[0-9]+\\.\\s)", "name": "meta.paragraph.markdown", "patterns": [{ "include": "#inline" }, { "include": "text.html.derivative" }, { "include": "#heading-setext" }], "while": "(^|\\G)(?!\\s*$|#|[ ]{0,3}([-*_>][ ]{2,}){3,}[ \\t]*$\\n?|[ ]{0,3}[*+->]|[ ]{0,3}[0-9]+\\.)" }, "lists": { "patterns": [{ "begin": "(^|\\G)([ ]{0,3})([*+-])([ \\t])", "beginCaptures": { "3": { "name": "punctuation.definition.list.begin.markdown" } }, "comment": "Currently does not support un-indented second lines.", "name": "markup.list.unnumbered.markdown", "patterns": [{ "include": "#block" }, { "include": "#list_paragraph" }], "while": "((^|\\G)([ ]{2,4}|\\t))|(^[ \\t]*$)" }, { "begin": "(^|\\G)([ ]{0,3})([0-9]+[\\.\\)])([ \\t])", "beginCaptures": { "3": { "name": "punctuation.definition.list.begin.markdown" } }, "name": "markup.list.numbered.markdown", "patterns": [{ "include": "#block" }, { "include": "#list_paragraph" }], "while": "((^|\\G)([ ]{2,4}|\\t))|(^[ \\t]*$)" }] }, "paragraph": { "begin": "(^|\\G)[ ]{0,3}(?=[^ \\t\\n])", "name": "meta.paragraph.markdown", "patterns": [{ "include": "#inline" }, { "include": "text.html.derivative" }, { "include": "#heading-setext" }], "while": "(^|\\G)((?=\\s*[-=]{3,}\\s*$)|[ ]{4,}(?=[^ \\t\\n]))" }, "raw": { "captures": { "1": { "name": "punctuation.definition.raw.markdown" }, "3": { "name": "punctuation.definition.raw.markdown" } }, "match": "(`+)((?:[^`]|(?!(?<!`)\\1(?!`))`)*+)(\\1)", "name": "markup.inline.raw.string.markdown" }, "raw_block": { "begin": "(^|\\G)([ ]{4}|\\t)", "name": "markup.raw.block.markdown", "while": "(^|\\G)([ ]{4}|\\t)" }, "separator": { "match": "(^|\\G)[ ]{0,3}([\\*\\-\\_])([ ]{0,2}\\2){2,}[ \\t]*$\\n?", "name": "meta.separator.markdown" }, "strikethrough": { "captures": { "1": { "name": "punctuation.definition.strikethrough.markdown" }, "2": { "patterns": [{ "applyEndPatternLast": 1, "begin": "(?=<[^>]*?>)", "end": "(?<=>)", "patterns": [{ "include": "text.html.derivative" }] }, { "include": "#escape" }, { "include": "#ampersand" }, { "include": "#bracket" }, { "include": "#raw" }, { "include": "#bold" }, { "include": "#italic" }, { "include": "#image-inline" }, { "include": "#link-inline" }, { "include": "#link-inet" }, { "include": "#link-email" }, { "include": "#image-ref" }, { "include": "#link-ref-literal" }, { "include": "#link-ref" }, { "include": "#link-ref-shortcut" }] }, "3": { "name": "punctuation.definition.strike
var markdown = [
lang
];
export { markdown as default };