UNPKG

vue-files-preview-inno

Version:

A tool for previewing files such as doc, excel, pdf, image, markdown, txt, audio, and video and so on.

176 lines (175 loc) 3.92 kB
var i, E; function d() { if (E) return i; E = 1; function l(e) { const a = "true false yes no null", n = "[\\w#;/?:@&=+$,.~*'()[\\]]+", b = { className: "attr", variants: [ // added brackets support { begin: /\w[\w :()\./-]*:(?=[ \t]|$)/ }, { // double quoted keys - with brackets begin: /"\w[\w :()\./-]*":(?=[ \t]|$)/ }, { // single quoted keys - with brackets begin: /'\w[\w :()\./-]*':(?=[ \t]|$)/ } ] }, g = { className: "template-variable", variants: [ { // jinja templates Ansible begin: /\{\{/, end: /\}\}/ }, { // Ruby i18n begin: /%\{/, end: /\}/ } ] }, c = { className: "string", relevance: 0, variants: [ { begin: /'/, end: /'/ }, { begin: /"/, end: /"/ }, { begin: /\S+/ } ], contains: [ e.BACKSLASH_ESCAPE, g ] }, N = e.inherit(c, { variants: [ { begin: /'/, end: /'/ }, { begin: /"/, end: /"/ }, { begin: /[^\s,{}[\]]+/ } ] }), R = { className: "number", begin: "\\b" + "[0-9]{4}(-[0-9][0-9]){0,2}" + "([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?" + "(\\.[0-9]*)?" + "([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?" + "\\b" }, s = { end: ",", endsWithParent: !0, excludeEnd: !0, keywords: a, relevance: 0 }, o = { begin: /\{/, end: /\}/, contains: [s], illegal: "\\n", relevance: 0 }, m = { begin: "\\[", end: "\\]", contains: [s], illegal: "\\n", relevance: 0 }, r = [ b, { className: "meta", begin: "^---\\s*$", relevance: 10 }, { // multi line string // Blocks start with a | or > followed by a newline // // Indentation of subsequent lines must be the same to // be considered part of the block className: "string", begin: "[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*" }, { // Ruby/Rails erb begin: "<%[%=-]?", end: "[%-]?%>", subLanguage: "ruby", excludeBegin: !0, excludeEnd: !0, relevance: 0 }, { // named tags className: "type", begin: "!\\w+!" + n }, // https://yaml.org/spec/1.2/spec.html#id2784064 { // verbatim tags className: "type", begin: "!<" + n + ">" }, { // primary tags className: "type", begin: "!" + n }, { // secondary tags className: "type", begin: "!!" + n }, { // fragment id &ref className: "meta", begin: "&" + e.UNDERSCORE_IDENT_RE + "$" }, { // fragment reference *ref className: "meta", begin: "\\*" + e.UNDERSCORE_IDENT_RE + "$" }, { // array listing className: "bullet", // TODO: remove |$ hack when we have proper look-ahead support begin: "-(?=[ ]|$)", relevance: 0 }, e.HASH_COMMENT_MODE, { beginKeywords: a, keywords: { literal: a } }, R, // numbers are any valid C-style number that // sit isolated from other words { className: "number", begin: e.C_NUMBER_RE + "\\b", relevance: 0 }, o, m, c ], t = [...r]; return t.pop(), t.push(N), s.contains = t, { name: "YAML", case_insensitive: !0, aliases: ["yml"], contains: r }; } return i = l, i; } export { d as __require }; //# sourceMappingURL=yaml.mjs.map