mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 00:53:40 +08:00
f3dee5863f
The 10+ version has actually a bug with bash. We will wait a little bit before upgrading to 10, we should also make sure any of the breaking changes listed here https://github.com/highlightjs/highlight.js/blob/master/VERSION_10_BREAKING_CHANGES.md are not impacting us.
1 line
1.6 KiB
JavaScript
1 line
1.6 KiB
JavaScript
hljs.registerLanguage("elixir",function(e){var b="[a-zA-Z_][a-zA-Z0-9_.]*(\\!|\\?)?",c="and false then defined module in return redo retry end for true self when next until do begin unless nil break not case cond alias while ensure or include use alias fn quote require import with|0",n={cN:"subst",b:"#\\{",e:"}",l:b,k:c},r="[/|([{<\"']",a={cN:"string",b:"~[a-z](?="+r+")",c:[{endsParent:!0,c:[{c:[e.BE,n],v:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/\//,e:/\//},{b:/\|/,e:/\|/},{b:/\(/,e:/\)/},{b:/\[/,e:/\]/},{b:/\{/,e:/\}/},{b:/</,e:/>/}]}]}]},i={cN:"string",b:"~[A-Z](?="+r+")",c:[{b:/"/,e:/"/},{b:/'/,e:/'/},{b:/\//,e:/\//},{b:/\|/,e:/\|/},{b:/\(/,e:/\)/},{b:/\[/,e:/\]/},{b:/\{/,e:/\}/},{b:/\</,e:/\>/}]},l={cN:"string",c:[e.BE,n],v:[{b:/"""/,e:/"""/},{b:/'''/,e:/'''/},{b:/~S"""/,e:/"""/,c:[]},{b:/~S"/,e:/"/,c:[]},{b:/~S'''/,e:/'''/,c:[]},{b:/~S'/,e:/'/,c:[]},{b:/'/,e:/'/},{b:/"/,e:/"/}]},s={cN:"function",bK:"def defp defmacro",e:/\B\b/,c:[e.inherit(e.TM,{b:b,endsParent:!0})]},t=e.inherit(s,{cN:"class",bK:"defimpl defmodule defprotocol defrecord",e:/\bdo\b|$|;/}),d=[l,i,a,e.HCM,t,s,{b:"::"},{cN:"symbol",b:":(?![\\s:])",c:[l,{b:"[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?"}],relevance:0},{cN:"symbol",b:b+":(?!:)",relevance:0},{cN:"number",b:"(\\b0o[0-7_]+)|(\\b0b[01_]+)|(\\b0x[0-9a-fA-F_]+)|(-?\\b[1-9][0-9_]*(.[0-9_]+([eE][-+]?[0-9]+)?)?)",relevance:0},{cN:"variable",b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{b:"->"},{b:"("+e.RSR+")\\s*",c:[e.HCM,{cN:"regexp",i:"\\n",c:[e.BE,n],v:[{b:"/",e:"/[a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}],relevance:0}];return{l:b,k:c,c:n.c=d}}); |