markdown.min.js 2.1 KB

12345678910111213141516171819202122232425262728293031
  1. /*! `markdown` grammar compiled for Highlight.js 11.7.0 */
  2. (()=>{var e=(()=>{"use strict";return e=>{const n={begin:/<\/?[A-Za-z_]/,
  3. end:">",subLanguage:"xml",relevance:0},a={variants:[{begin:/\[.+?\]\[.*?\]/,
  4. relevance:0},{
  5. begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,
  6. relevance:2},{
  7. begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),
  8. relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{
  9. begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/
  10. },{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,
  11. returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",
  12. excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",
  13. end:"\\]",excludeBegin:!0,excludeEnd:!0}]},i={className:"strong",contains:[],
  14. variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]
  15. },s={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{
  16. begin:/_(?![_\s])/,end:/_/,relevance:0}]},c=e.inherit(i,{contains:[]
  17. }),t=e.inherit(s,{contains:[]});i.contains.push(t),s.contains.push(c)
  18. ;let g=[n,a];return[i,s,c,t].forEach((e=>{e.contains=e.contains.concat(g)
  19. })),g=g.concat(i,s),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{
  20. className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:g},{
  21. begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",
  22. contains:g}]}]},n,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",
  23. end:"\\s+",excludeEnd:!0},i,s,{className:"quote",begin:"^>\\s+",contains:g,
  24. end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{
  25. begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{
  26. begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",
  27. contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{
  28. begin:"^[-\\*]{3,}",end:"$"},a,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{
  29. className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{
  30. className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}})()
  31. ;hljs.registerLanguage("markdown",e)})();