asciidoc.min.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*! `asciidoc` grammar compiled for Highlight.js 11.7.0 */
  2. var hljsGrammar=(()=>{"use strict";return e=>{const n=e.regex,a=[{
  3. className:"strong",begin:/\*{2}([^\n]+?)\*{2}/},{className:"strong",
  4. begin:n.concat(/\*\*/,/((\*(?!\*)|\\[^\n]|[^*\n\\])+\n)+/,/(\*(?!\*)|\\[^\n]|[^*\n\\])*/,/\*\*/),
  5. relevance:0},{className:"strong",begin:/\B\*(\S|\S[^\n]*?\S)\*(?!\w)/},{
  6. className:"strong",begin:/\*[^\s]([^\n]+\n)+([^\n]+)\*/}],s=[{
  7. className:"emphasis",begin:/_{2}([^\n]+?)_{2}/},{className:"emphasis",
  8. begin:n.concat(/__/,/((_(?!_)|\\[^\n]|[^_\n\\])+\n)+/,/(_(?!_)|\\[^\n]|[^_\n\\])*/,/__/),
  9. relevance:0},{className:"emphasis",begin:/\b_(\S|\S[^\n]*?\S)_(?!\w)/},{
  10. className:"emphasis",begin:/_[^\s]([^\n]+\n)+([^\n]+)_/},{className:"emphasis",
  11. begin:"\\B'(?!['\\s])",end:"(\\n{2}|')",contains:[{begin:"\\\\'\\w",relevance:0
  12. }],relevance:0}];return{name:"AsciiDoc",aliases:["adoc"],
  13. contains:[e.COMMENT("^/{4,}\\n","\\n/{4,}$",{relevance:10
  14. }),e.COMMENT("^//","$",{relevance:0}),{className:"title",begin:"^\\.\\w.*$"},{
  15. begin:"^[=\\*]{4,}\\n",end:"\\n^[=\\*]{4,}$",relevance:10},{className:"section",
  16. relevance:10,variants:[{begin:"^(={1,6})[ \t].+?([ \t]\\1)?$"},{
  17. begin:"^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$"}]},{className:"meta",
  18. begin:"^:.+?:",end:"\\s",excludeEnd:!0,relevance:10},{className:"meta",
  19. begin:"^\\[.+?\\]$",relevance:0},{className:"quote",begin:"^_{4,}\\n",
  20. end:"\\n_{4,}$",relevance:10},{className:"code",begin:"^[\\-\\.]{4,}\\n",
  21. end:"\\n[\\-\\.]{4,}$",relevance:10},{begin:"^\\+{4,}\\n",end:"\\n\\+{4,}$",
  22. contains:[{begin:"<",end:">",subLanguage:"xml",relevance:0}],relevance:10},{
  23. className:"bullet",begin:"^(\\*+|-+|\\.+|[^\\n]+?::)\\s+"},{className:"symbol",
  24. begin:"^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+",relevance:10},{
  25. begin:/\\[*_`]/},{begin:/\\\\\*{2}[^\n]*?\*{2}/},{begin:/\\\\_{2}[^\n]*_{2}/},{
  26. begin:/\\\\`{2}[^\n]*`{2}/},{begin:/[:;}][*_`](?![*_`])/},...a,...s,{
  27. className:"string",variants:[{begin:"``.+?''"},{begin:"`.+?'"}]},{
  28. className:"code",begin:/`{2}/,end:/(\n{2}|`{2})/},{className:"code",
  29. begin:"(`.+?`|\\+.+?\\+)",relevance:0},{className:"code",begin:"^[ \\t]",
  30. end:"$",relevance:0},{begin:"^'{3,}[ \\t]*$",relevance:10},{
  31. begin:"(link:)?(http|https|ftp|file|irc|image:?):\\S+?\\[[^[]*?\\]",
  32. returnBegin:!0,contains:[{begin:"(link|image:?):",relevance:0},{
  33. className:"link",begin:"\\w",end:"[^\\[]+",relevance:0},{className:"string",
  34. begin:"\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0,relevance:0}],relevance:10}]
  35. }}})();export default hljsGrammar;