yaml.min.js 1.8 KB

12345678910111213141516171819202122232425
  1. /*! `yaml` grammar compiled for Highlight.js 11.7.0 */
  2. (()=>{var e=(()=>{"use strict";return e=>{
  3. const n="true false yes no null",a="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={
  4. className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/
  5. },{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",
  6. variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=e.inherit(s,{
  7. variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),l={
  8. end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},t={begin:/\{/,
  9. end:/\}/,contains:[l],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",
  10. contains:[l],illegal:"\\n",relevance:0},b=[{className:"attr",variants:[{
  11. begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{
  12. begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$",
  13. relevance:10},{className:"string",
  14. begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{
  15. begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,
  16. relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type",
  17. begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a
  18. },{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",
  19. begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",
  20. relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},{
  21. className:"number",
  22. 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"
  23. },{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},t,g,s],r=[...b]
  24. ;return r.pop(),r.push(i),l.contains=r,{name:"YAML",case_insensitive:!0,
  25. aliases:["yml"],contains:b}}})();hljs.registerLanguage("yaml",e)})();