mode-markdown.js 122 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194
  1. define("ace/mode/doc_comment_highlight_rules",["ace_require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(ace_require, exports, module) {
  2. "use strict";
  3. var oop = ace_require("../lib/oop");
  4. var TextHighlightRules = ace_require("./text_highlight_rules").TextHighlightRules;
  5. var DocCommentHighlightRules = function() {
  6. this.$rules = {
  7. "start" : [ {
  8. token : "comment.doc.tag",
  9. regex : "@[\\w\\d_]+" // TODO: fix email addresses
  10. },
  11. DocCommentHighlightRules.getTagRule(),
  12. {
  13. defaultToken : "comment.doc",
  14. caseInsensitive: true
  15. }]
  16. };
  17. };
  18. oop.inherits(DocCommentHighlightRules, TextHighlightRules);
  19. DocCommentHighlightRules.getTagRule = function(start) {
  20. return {
  21. token : "comment.doc.tag.storage.type",
  22. regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
  23. };
  24. };
  25. DocCommentHighlightRules.getStartRule = function(start) {
  26. return {
  27. token : "comment.doc", // doc comment
  28. regex : "\\/\\*(?=\\*)",
  29. next : start
  30. };
  31. };
  32. DocCommentHighlightRules.getEndRule = function (start) {
  33. return {
  34. token : "comment.doc", // closing comment
  35. regex : "\\*\\/",
  36. next : start
  37. };
  38. };
  39. exports.DocCommentHighlightRules = DocCommentHighlightRules;
  40. });
  41. define("ace/mode/javascript_highlight_rules",["ace_require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(ace_require, exports, module) {
  42. "use strict";
  43. var oop = ace_require("../lib/oop");
  44. var DocCommentHighlightRules = ace_require("./doc_comment_highlight_rules").DocCommentHighlightRules;
  45. var TextHighlightRules = ace_require("./text_highlight_rules").TextHighlightRules;
  46. var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
  47. var JavaScriptHighlightRules = function(options) {
  48. var keywordMapper = this.createKeywordMapper({
  49. "variable.language":
  50. "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
  51. "Namespace|QName|XML|XMLList|" + // E4X
  52. "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
  53. "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
  54. "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
  55. "SyntaxError|TypeError|URIError|" +
  56. "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
  57. "isNaN|parseFloat|parseInt|" +
  58. "JSON|Math|" + // Other
  59. "this|arguments|prototype|window|document" , // Pseudo
  60. "keyword":
  61. "const|yield|import|get|set|async|await|" +
  62. "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
  63. "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
  64. "__parent__|__count__|escape|unescape|with|__proto__|" +
  65. "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
  66. "storage.type":
  67. "const|let|var|function",
  68. "constant.language":
  69. "null|Infinity|NaN|undefined",
  70. "support.function":
  71. "alert",
  72. "constant.language.boolean": "true|false"
  73. }, "identifier");
  74. var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
  75. var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
  76. "u[0-9a-fA-F]{4}|" + // unicode
  77. "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
  78. "[0-2][0-7]{0,2}|" + // oct
  79. "3[0-7][0-7]?|" + // oct
  80. "[4-7][0-7]?|" + //oct
  81. ".)";
  82. this.$rules = {
  83. "no_regex" : [
  84. DocCommentHighlightRules.getStartRule("doc-start"),
  85. comments("no_regex"),
  86. {
  87. token : "string",
  88. regex : "'(?=.)",
  89. next : "qstring"
  90. }, {
  91. token : "string",
  92. regex : '"(?=.)',
  93. next : "qqstring"
  94. }, {
  95. token : "constant.numeric", // hexadecimal, octal and binary
  96. regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
  97. }, {
  98. token : "constant.numeric", // decimal integers and floats
  99. regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
  100. }, {
  101. token : [
  102. "storage.type", "punctuation.operator", "support.function",
  103. "punctuation.operator", "entity.name.function", "text","keyword.operator"
  104. ],
  105. regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
  106. next: "function_arguments"
  107. }, {
  108. token : [
  109. "storage.type", "punctuation.operator", "entity.name.function", "text",
  110. "keyword.operator", "text", "storage.type", "text", "paren.lparen"
  111. ],
  112. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  113. next: "function_arguments"
  114. }, {
  115. token : [
  116. "entity.name.function", "text", "keyword.operator", "text", "storage.type",
  117. "text", "paren.lparen"
  118. ],
  119. regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  120. next: "function_arguments"
  121. }, {
  122. token : [
  123. "storage.type", "punctuation.operator", "entity.name.function", "text",
  124. "keyword.operator", "text",
  125. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  126. ],
  127. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
  128. next: "function_arguments"
  129. }, {
  130. token : [
  131. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  132. ],
  133. regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
  134. next: "function_arguments"
  135. }, {
  136. token : [
  137. "entity.name.function", "text", "punctuation.operator",
  138. "text", "storage.type", "text", "paren.lparen"
  139. ],
  140. regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
  141. next: "function_arguments"
  142. }, {
  143. token : [
  144. "text", "text", "storage.type", "text", "paren.lparen"
  145. ],
  146. regex : "(:)(\\s*)(function)(\\s*)(\\()",
  147. next: "function_arguments"
  148. }, {
  149. token : "keyword",
  150. regex : "from(?=\\s*('|\"))"
  151. }, {
  152. token : "keyword",
  153. regex : "(?:" + kwBeforeRe + ")\\b",
  154. next : "start"
  155. }, {
  156. token : ["support.constant"],
  157. regex : /that\b/
  158. }, {
  159. token : ["storage.type", "punctuation.operator", "support.function.firebug"],
  160. regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
  161. }, {
  162. token : keywordMapper,
  163. regex : identifierRe
  164. }, {
  165. token : "punctuation.operator",
  166. regex : /[.](?![.])/,
  167. next : "property"
  168. }, {
  169. token : "storage.type",
  170. regex : /=>/,
  171. next : "start"
  172. }, {
  173. token : "keyword.operator",
  174. regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
  175. next : "start"
  176. }, {
  177. token : "punctuation.operator",
  178. regex : /[?:,;.]/,
  179. next : "start"
  180. }, {
  181. token : "paren.lparen",
  182. regex : /[\[({]/,
  183. next : "start"
  184. }, {
  185. token : "paren.rparen",
  186. regex : /[\])}]/
  187. }, {
  188. token: "comment",
  189. regex: /^#!.*$/
  190. }
  191. ],
  192. property: [{
  193. token : "text",
  194. regex : "\\s+"
  195. }, {
  196. token : [
  197. "storage.type", "punctuation.operator", "entity.name.function", "text",
  198. "keyword.operator", "text",
  199. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  200. ],
  201. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
  202. next: "function_arguments"
  203. }, {
  204. token : "punctuation.operator",
  205. regex : /[.](?![.])/
  206. }, {
  207. token : "support.function",
  208. regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
  209. }, {
  210. token : "support.function.dom",
  211. regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
  212. }, {
  213. token : "support.constant",
  214. regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
  215. }, {
  216. token : "identifier",
  217. regex : identifierRe
  218. }, {
  219. regex: "",
  220. token: "empty",
  221. next: "no_regex"
  222. }
  223. ],
  224. "start": [
  225. DocCommentHighlightRules.getStartRule("doc-start"),
  226. comments("start"),
  227. {
  228. token: "string.regexp",
  229. regex: "\\/",
  230. next: "regex"
  231. }, {
  232. token : "text",
  233. regex : "\\s+|^$",
  234. next : "start"
  235. }, {
  236. token: "empty",
  237. regex: "",
  238. next: "no_regex"
  239. }
  240. ],
  241. "regex": [
  242. {
  243. token: "regexp.keyword.operator",
  244. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  245. }, {
  246. token: "string.regexp",
  247. regex: "/[sxngimy]*",
  248. next: "no_regex"
  249. }, {
  250. token : "invalid",
  251. regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
  252. }, {
  253. token : "constant.language.escape",
  254. regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
  255. }, {
  256. token : "constant.language.delimiter",
  257. regex: /\|/
  258. }, {
  259. token: "constant.language.escape",
  260. regex: /\[\^?/,
  261. next: "regex_character_class"
  262. }, {
  263. token: "empty",
  264. regex: "$",
  265. next: "no_regex"
  266. }, {
  267. defaultToken: "string.regexp"
  268. }
  269. ],
  270. "regex_character_class": [
  271. {
  272. token: "regexp.charclass.keyword.operator",
  273. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  274. }, {
  275. token: "constant.language.escape",
  276. regex: "]",
  277. next: "regex"
  278. }, {
  279. token: "constant.language.escape",
  280. regex: "-"
  281. }, {
  282. token: "empty",
  283. regex: "$",
  284. next: "no_regex"
  285. }, {
  286. defaultToken: "string.regexp.charachterclass"
  287. }
  288. ],
  289. "function_arguments": [
  290. {
  291. token: "variable.parameter",
  292. regex: identifierRe
  293. }, {
  294. token: "punctuation.operator",
  295. regex: "[, ]+"
  296. }, {
  297. token: "punctuation.operator",
  298. regex: "$"
  299. }, {
  300. token: "empty",
  301. regex: "",
  302. next: "no_regex"
  303. }
  304. ],
  305. "qqstring" : [
  306. {
  307. token : "constant.language.escape",
  308. regex : escapedRe
  309. }, {
  310. token : "string",
  311. regex : "\\\\$",
  312. consumeLineEnd : true
  313. }, {
  314. token : "string",
  315. regex : '"|$',
  316. next : "no_regex"
  317. }, {
  318. defaultToken: "string"
  319. }
  320. ],
  321. "qstring" : [
  322. {
  323. token : "constant.language.escape",
  324. regex : escapedRe
  325. }, {
  326. token : "string",
  327. regex : "\\\\$",
  328. consumeLineEnd : true
  329. }, {
  330. token : "string",
  331. regex : "'|$",
  332. next : "no_regex"
  333. }, {
  334. defaultToken: "string"
  335. }
  336. ]
  337. };
  338. if (!options || !options.noES6) {
  339. this.$rules.no_regex.unshift({
  340. regex: "[{}]", onMatch: function(val, state, stack) {
  341. this.next = val == "{" ? this.nextState : "";
  342. if (val == "{" && stack.length) {
  343. stack.unshift("start", state);
  344. }
  345. else if (val == "}" && stack.length) {
  346. stack.shift();
  347. this.next = stack.shift();
  348. if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
  349. return "paren.quasi.end";
  350. }
  351. return val == "{" ? "paren.lparen" : "paren.rparen";
  352. },
  353. nextState: "start"
  354. }, {
  355. token : "string.quasi.start",
  356. regex : /`/,
  357. push : [{
  358. token : "constant.language.escape",
  359. regex : escapedRe
  360. }, {
  361. token : "paren.quasi.start",
  362. regex : /\${/,
  363. push : "start"
  364. }, {
  365. token : "string.quasi.end",
  366. regex : /`/,
  367. next : "pop"
  368. }, {
  369. defaultToken: "string.quasi"
  370. }]
  371. });
  372. if (!options || options.jsx != false)
  373. JSX.call(this);
  374. }
  375. this.embedRules(DocCommentHighlightRules, "doc-",
  376. [ DocCommentHighlightRules.getEndRule("no_regex") ]);
  377. this.normalizeRules();
  378. };
  379. oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
  380. function JSX() {
  381. var tagRegex = identifierRe.replace("\\d", "\\d\\-");
  382. var jsxTag = {
  383. onMatch : function(val, state, stack) {
  384. var offset = val.charAt(1) == "/" ? 2 : 1;
  385. if (offset == 1) {
  386. if (state != this.nextState)
  387. stack.unshift(this.next, this.nextState, 0);
  388. else
  389. stack.unshift(this.next);
  390. stack[2]++;
  391. } else if (offset == 2) {
  392. if (state == this.nextState) {
  393. stack[1]--;
  394. if (!stack[1] || stack[1] < 0) {
  395. stack.shift();
  396. stack.shift();
  397. }
  398. }
  399. }
  400. return [{
  401. type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
  402. value: val.slice(0, offset)
  403. }, {
  404. type: "meta.tag.tag-name.xml",
  405. value: val.substr(offset)
  406. }];
  407. },
  408. regex : "</?" + tagRegex + "",
  409. next: "jsxAttributes",
  410. nextState: "jsx"
  411. };
  412. this.$rules.start.unshift(jsxTag);
  413. var jsxJsRule = {
  414. regex: "{",
  415. token: "paren.quasi.start",
  416. push: "start"
  417. };
  418. this.$rules.jsx = [
  419. jsxJsRule,
  420. jsxTag,
  421. {include : "reference"},
  422. {defaultToken: "string"}
  423. ];
  424. this.$rules.jsxAttributes = [{
  425. token : "meta.tag.punctuation.tag-close.xml",
  426. regex : "/?>",
  427. onMatch : function(value, currentState, stack) {
  428. if (currentState == stack[0])
  429. stack.shift();
  430. if (value.length == 2) {
  431. if (stack[0] == this.nextState)
  432. stack[1]--;
  433. if (!stack[1] || stack[1] < 0) {
  434. stack.splice(0, 2);
  435. }
  436. }
  437. this.next = stack[0] || "start";
  438. return [{type: this.token, value: value}];
  439. },
  440. nextState: "jsx"
  441. },
  442. jsxJsRule,
  443. comments("jsxAttributes"),
  444. {
  445. token : "entity.other.attribute-name.xml",
  446. regex : tagRegex
  447. }, {
  448. token : "keyword.operator.attribute-equals.xml",
  449. regex : "="
  450. }, {
  451. token : "text.tag-whitespace.xml",
  452. regex : "\\s+"
  453. }, {
  454. token : "string.attribute-value.xml",
  455. regex : "'",
  456. stateName : "jsx_attr_q",
  457. push : [
  458. {token : "string.attribute-value.xml", regex: "'", next: "pop"},
  459. {include : "reference"},
  460. {defaultToken : "string.attribute-value.xml"}
  461. ]
  462. }, {
  463. token : "string.attribute-value.xml",
  464. regex : '"',
  465. stateName : "jsx_attr_qq",
  466. push : [
  467. {token : "string.attribute-value.xml", regex: '"', next: "pop"},
  468. {include : "reference"},
  469. {defaultToken : "string.attribute-value.xml"}
  470. ]
  471. },
  472. jsxTag
  473. ];
  474. this.$rules.reference = [{
  475. token : "constant.language.escape.reference.xml",
  476. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  477. }];
  478. }
  479. function comments(next) {
  480. return [
  481. {
  482. token : "comment", // multi line comment
  483. regex : /\/\*/,
  484. next: [
  485. DocCommentHighlightRules.getTagRule(),
  486. {token : "comment", regex : "\\*\\/", next : next || "pop"},
  487. {defaultToken : "comment", caseInsensitive: true}
  488. ]
  489. }, {
  490. token : "comment",
  491. regex : "\\/\\/",
  492. next: [
  493. DocCommentHighlightRules.getTagRule(),
  494. {token : "comment", regex : "$|^", next : next || "pop"},
  495. {defaultToken : "comment", caseInsensitive: true}
  496. ]
  497. }
  498. ];
  499. }
  500. exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
  501. });
  502. define("ace/mode/matching_brace_outdent",["ace_require","exports","module","ace/range"], function(ace_require, exports, module) {
  503. "use strict";
  504. var Range = ace_require("../range").Range;
  505. var MatchingBraceOutdent = function() {};
  506. (function() {
  507. this.checkOutdent = function(line, input) {
  508. if (! /^\s+$/.test(line))
  509. return false;
  510. return /^\s*\}/.test(input);
  511. };
  512. this.autoOutdent = function(doc, row) {
  513. var line = doc.getLine(row);
  514. var match = line.match(/^(\s*\})/);
  515. if (!match) return 0;
  516. var column = match[1].length;
  517. var openBracePos = doc.findMatchingBracket({row: row, column: column});
  518. if (!openBracePos || openBracePos.row == row) return 0;
  519. var indent = this.$getIndent(doc.getLine(openBracePos.row));
  520. doc.replace(new Range(row, 0, row, column-1), indent);
  521. };
  522. this.$getIndent = function(line) {
  523. return line.match(/^\s*/)[0];
  524. };
  525. }).call(MatchingBraceOutdent.prototype);
  526. exports.MatchingBraceOutdent = MatchingBraceOutdent;
  527. });
  528. define("ace/mode/folding/cstyle",["ace_require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(ace_require, exports, module) {
  529. "use strict";
  530. var oop = ace_require("../../lib/oop");
  531. var Range = ace_require("../../range").Range;
  532. var BaseFoldMode = ace_require("./fold_mode").FoldMode;
  533. var FoldMode = exports.FoldMode = function(commentRegex) {
  534. if (commentRegex) {
  535. this.foldingStartMarker = new RegExp(
  536. this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
  537. );
  538. this.foldingStopMarker = new RegExp(
  539. this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
  540. );
  541. }
  542. };
  543. oop.inherits(FoldMode, BaseFoldMode);
  544. (function() {
  545. this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
  546. this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
  547. this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
  548. this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
  549. this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
  550. this._getFoldWidgetBase = this.getFoldWidget;
  551. this.getFoldWidget = function(session, foldStyle, row) {
  552. var line = session.getLine(row);
  553. if (this.singleLineBlockCommentRe.test(line)) {
  554. if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
  555. return "";
  556. }
  557. var fw = this._getFoldWidgetBase(session, foldStyle, row);
  558. if (!fw && this.startRegionRe.test(line))
  559. return "start"; // lineCommentRegionStart
  560. return fw;
  561. };
  562. this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
  563. var line = session.getLine(row);
  564. if (this.startRegionRe.test(line))
  565. return this.getCommentRegionBlock(session, line, row);
  566. var match = line.match(this.foldingStartMarker);
  567. if (match) {
  568. var i = match.index;
  569. if (match[1])
  570. return this.openingBracketBlock(session, match[1], row, i);
  571. var range = session.getCommentFoldRange(row, i + match[0].length, 1);
  572. if (range && !range.isMultiLine()) {
  573. if (forceMultiline) {
  574. range = this.getSectionRange(session, row);
  575. } else if (foldStyle != "all")
  576. range = null;
  577. }
  578. return range;
  579. }
  580. if (foldStyle === "markbegin")
  581. return;
  582. var match = line.match(this.foldingStopMarker);
  583. if (match) {
  584. var i = match.index + match[0].length;
  585. if (match[1])
  586. return this.closingBracketBlock(session, match[1], row, i);
  587. return session.getCommentFoldRange(row, i, -1);
  588. }
  589. };
  590. this.getSectionRange = function(session, row) {
  591. var line = session.getLine(row);
  592. var startIndent = line.search(/\S/);
  593. var startRow = row;
  594. var startColumn = line.length;
  595. row = row + 1;
  596. var endRow = row;
  597. var maxRow = session.getLength();
  598. while (++row < maxRow) {
  599. line = session.getLine(row);
  600. var indent = line.search(/\S/);
  601. if (indent === -1)
  602. continue;
  603. if (startIndent > indent)
  604. break;
  605. var subRange = this.getFoldWidgetRange(session, "all", row);
  606. if (subRange) {
  607. if (subRange.start.row <= startRow) {
  608. break;
  609. } else if (subRange.isMultiLine()) {
  610. row = subRange.end.row;
  611. } else if (startIndent == indent) {
  612. break;
  613. }
  614. }
  615. endRow = row;
  616. }
  617. return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
  618. };
  619. this.getCommentRegionBlock = function(session, line, row) {
  620. var startColumn = line.search(/\s*$/);
  621. var maxRow = session.getLength();
  622. var startRow = row;
  623. var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
  624. var depth = 1;
  625. while (++row < maxRow) {
  626. line = session.getLine(row);
  627. var m = re.exec(line);
  628. if (!m) continue;
  629. if (m[1]) depth--;
  630. else depth++;
  631. if (!depth) break;
  632. }
  633. var endRow = row;
  634. if (endRow > startRow) {
  635. return new Range(startRow, startColumn, endRow, line.length);
  636. }
  637. };
  638. }).call(FoldMode.prototype);
  639. });
  640. define("ace/mode/javascript",["ace_require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(ace_require, exports, module) {
  641. "use strict";
  642. var oop = ace_require("../lib/oop");
  643. var TextMode = ace_require("./text").Mode;
  644. var JavaScriptHighlightRules = ace_require("./javascript_highlight_rules").JavaScriptHighlightRules;
  645. var MatchingBraceOutdent = ace_require("./matching_brace_outdent").MatchingBraceOutdent;
  646. var WorkerClient = ace_require("../worker/worker_client").WorkerClient;
  647. var CstyleBehaviour = ace_require("./behaviour/cstyle").CstyleBehaviour;
  648. var CStyleFoldMode = ace_require("./folding/cstyle").FoldMode;
  649. var Mode = function() {
  650. this.HighlightRules = JavaScriptHighlightRules;
  651. this.$outdent = new MatchingBraceOutdent();
  652. this.$behaviour = new CstyleBehaviour();
  653. this.foldingRules = new CStyleFoldMode();
  654. };
  655. oop.inherits(Mode, TextMode);
  656. (function() {
  657. this.lineCommentStart = "//";
  658. this.blockComment = {start: "/*", end: "*/"};
  659. this.$quotes = {'"': '"', "'": "'", "`": "`"};
  660. this.getNextLineIndent = function(state, line, tab) {
  661. var indent = this.$getIndent(line);
  662. var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
  663. var tokens = tokenizedLine.tokens;
  664. var endState = tokenizedLine.state;
  665. if (tokens.length && tokens[tokens.length-1].type == "comment") {
  666. return indent;
  667. }
  668. if (state == "start" || state == "no_regex") {
  669. var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
  670. if (match) {
  671. indent += tab;
  672. }
  673. } else if (state == "doc-start") {
  674. if (endState == "start" || endState == "no_regex") {
  675. return "";
  676. }
  677. var match = line.match(/^\s*(\/?)\*/);
  678. if (match) {
  679. if (match[1]) {
  680. indent += " ";
  681. }
  682. indent += "* ";
  683. }
  684. }
  685. return indent;
  686. };
  687. this.checkOutdent = function(state, line, input) {
  688. return this.$outdent.checkOutdent(line, input);
  689. };
  690. this.autoOutdent = function(state, doc, row) {
  691. this.$outdent.autoOutdent(doc, row);
  692. };
  693. this.createWorker = function(session) {
  694. var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
  695. worker.attachToDocument(session.getDocument());
  696. worker.on("annotate", function(results) {
  697. session.setAnnotations(results.data);
  698. });
  699. worker.on("terminate", function() {
  700. session.clearAnnotations();
  701. });
  702. return worker;
  703. };
  704. this.$id = "ace/mode/javascript";
  705. this.snippetFileId = "ace/snippets/javascript";
  706. }).call(Mode.prototype);
  707. exports.Mode = Mode;
  708. });
  709. define("ace/mode/xml_highlight_rules",["ace_require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(ace_require, exports, module) {
  710. "use strict";
  711. var oop = ace_require("../lib/oop");
  712. var TextHighlightRules = ace_require("./text_highlight_rules").TextHighlightRules;
  713. var XmlHighlightRules = function(normalize) {
  714. var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
  715. this.$rules = {
  716. start : [
  717. {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
  718. {
  719. token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
  720. regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction"
  721. },
  722. {token : "comment.start.xml", regex : "<\\!--", next : "comment"},
  723. {
  724. token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
  725. regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
  726. },
  727. {include : "tag"},
  728. {token : "text.end-tag-open.xml", regex: "</"},
  729. {token : "text.tag-open.xml", regex: "<"},
  730. {include : "reference"},
  731. {defaultToken : "text.xml"}
  732. ],
  733. processing_instruction : [{
  734. token : "entity.other.attribute-name.decl-attribute-name.xml",
  735. regex : tagRegex
  736. }, {
  737. token : "keyword.operator.decl-attribute-equals.xml",
  738. regex : "="
  739. }, {
  740. include: "whitespace"
  741. }, {
  742. include: "string"
  743. }, {
  744. token : "punctuation.xml-decl.xml",
  745. regex : "\\?>",
  746. next : "start"
  747. }],
  748. doctype : [
  749. {include : "whitespace"},
  750. {include : "string"},
  751. {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
  752. {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
  753. {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
  754. ],
  755. int_subset : [{
  756. token : "text.xml",
  757. regex : "\\s+"
  758. }, {
  759. token: "punctuation.int-subset.xml",
  760. regex: "]",
  761. next: "pop"
  762. }, {
  763. token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
  764. regex : "(<\\!)(" + tagRegex + ")",
  765. push : [{
  766. token : "text",
  767. regex : "\\s+"
  768. },
  769. {
  770. token : "punctuation.markup-decl.xml",
  771. regex : ">",
  772. next : "pop"
  773. },
  774. {include : "string"}]
  775. }],
  776. cdata : [
  777. {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
  778. {token : "text.xml", regex : "\\s+"},
  779. {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
  780. ],
  781. comment : [
  782. {token : "comment.end.xml", regex : "-->", next : "start"},
  783. {defaultToken : "comment.xml"}
  784. ],
  785. reference : [{
  786. token : "constant.language.escape.reference.xml",
  787. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  788. }],
  789. attr_reference : [{
  790. token : "constant.language.escape.reference.attribute-value.xml",
  791. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  792. }],
  793. tag : [{
  794. token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
  795. regex : "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
  796. next: [
  797. {include : "attributes"},
  798. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
  799. ]
  800. }],
  801. tag_whitespace : [
  802. {token : "text.tag-whitespace.xml", regex : "\\s+"}
  803. ],
  804. whitespace : [
  805. {token : "text.whitespace.xml", regex : "\\s+"}
  806. ],
  807. string: [{
  808. token : "string.xml",
  809. regex : "'",
  810. push : [
  811. {token : "string.xml", regex: "'", next: "pop"},
  812. {defaultToken : "string.xml"}
  813. ]
  814. }, {
  815. token : "string.xml",
  816. regex : '"',
  817. push : [
  818. {token : "string.xml", regex: '"', next: "pop"},
  819. {defaultToken : "string.xml"}
  820. ]
  821. }],
  822. attributes: [{
  823. token : "entity.other.attribute-name.xml",
  824. regex : tagRegex
  825. }, {
  826. token : "keyword.operator.attribute-equals.xml",
  827. regex : "="
  828. }, {
  829. include: "tag_whitespace"
  830. }, {
  831. include: "attribute_value"
  832. }],
  833. attribute_value: [{
  834. token : "string.attribute-value.xml",
  835. regex : "'",
  836. push : [
  837. {token : "string.attribute-value.xml", regex: "'", next: "pop"},
  838. {include : "attr_reference"},
  839. {defaultToken : "string.attribute-value.xml"}
  840. ]
  841. }, {
  842. token : "string.attribute-value.xml",
  843. regex : '"',
  844. push : [
  845. {token : "string.attribute-value.xml", regex: '"', next: "pop"},
  846. {include : "attr_reference"},
  847. {defaultToken : "string.attribute-value.xml"}
  848. ]
  849. }]
  850. };
  851. if (this.constructor === XmlHighlightRules)
  852. this.normalizeRules();
  853. };
  854. (function() {
  855. this.embedTagRules = function(HighlightRules, prefix, tag){
  856. this.$rules.tag.unshift({
  857. token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  858. regex : "(<)(" + tag + "(?=\\s|>|$))",
  859. next: [
  860. {include : "attributes"},
  861. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
  862. ]
  863. });
  864. this.$rules[tag + "-end"] = [
  865. {include : "attributes"},
  866. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
  867. onMatch : function(value, currentState, stack) {
  868. stack.splice(0);
  869. return this.token;
  870. }}
  871. ];
  872. this.embedRules(HighlightRules, prefix, [{
  873. token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  874. regex : "(</)(" + tag + "(?=\\s|>|$))",
  875. next: tag + "-end"
  876. }, {
  877. token: "string.cdata.xml",
  878. regex : "<\\!\\[CDATA\\["
  879. }, {
  880. token: "string.cdata.xml",
  881. regex : "\\]\\]>"
  882. }]);
  883. };
  884. }).call(TextHighlightRules.prototype);
  885. oop.inherits(XmlHighlightRules, TextHighlightRules);
  886. exports.XmlHighlightRules = XmlHighlightRules;
  887. });
  888. define("ace/mode/behaviour/xml",["ace_require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(ace_require, exports, module) {
  889. "use strict";
  890. var oop = ace_require("../../lib/oop");
  891. var Behaviour = ace_require("../behaviour").Behaviour;
  892. var TokenIterator = ace_require("../../token_iterator").TokenIterator;
  893. var lang = ace_require("../../lib/lang");
  894. function is(token, type) {
  895. return token && token.type.lastIndexOf(type + ".xml") > -1;
  896. }
  897. var XmlBehaviour = function () {
  898. this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
  899. if (text == '"' || text == "'") {
  900. var quote = text;
  901. var selected = session.doc.getTextRange(editor.getSelectionRange());
  902. if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
  903. return {
  904. text: quote + selected + quote,
  905. selection: false
  906. };
  907. }
  908. var cursor = editor.getCursorPosition();
  909. var line = session.doc.getLine(cursor.row);
  910. var rightChar = line.substring(cursor.column, cursor.column + 1);
  911. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  912. var token = iterator.getCurrentToken();
  913. if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
  914. return {
  915. text: "",
  916. selection: [1, 1]
  917. };
  918. }
  919. if (!token)
  920. token = iterator.stepBackward();
  921. if (!token)
  922. return;
  923. while (is(token, "tag-whitespace") || is(token, "whitespace")) {
  924. token = iterator.stepBackward();
  925. }
  926. var rightSpace = !rightChar || rightChar.match(/\s/);
  927. if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
  928. return {
  929. text: quote + quote,
  930. selection: [1, 1]
  931. };
  932. }
  933. }
  934. });
  935. this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
  936. var selected = session.doc.getTextRange(range);
  937. if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
  938. var line = session.doc.getLine(range.start.row);
  939. var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
  940. if (rightChar == selected) {
  941. range.end.column++;
  942. return range;
  943. }
  944. }
  945. });
  946. this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
  947. if (text == '>') {
  948. var position = editor.getSelectionRange().start;
  949. var iterator = new TokenIterator(session, position.row, position.column);
  950. var token = iterator.getCurrentToken() || iterator.stepBackward();
  951. if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
  952. return;
  953. if (is(token, "reference.attribute-value"))
  954. return;
  955. if (is(token, "attribute-value")) {
  956. var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
  957. if (position.column < tokenEndColumn)
  958. return;
  959. if (position.column == tokenEndColumn) {
  960. var nextToken = iterator.stepForward();
  961. if (nextToken && is(nextToken, "attribute-value"))
  962. return;
  963. iterator.stepBackward();
  964. }
  965. }
  966. if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
  967. return;
  968. while (!is(token, "tag-name")) {
  969. token = iterator.stepBackward();
  970. if (token.value == "<") {
  971. token = iterator.stepForward();
  972. break;
  973. }
  974. }
  975. var tokenRow = iterator.getCurrentTokenRow();
  976. var tokenColumn = iterator.getCurrentTokenColumn();
  977. if (is(iterator.stepBackward(), "end-tag-open"))
  978. return;
  979. var element = token.value;
  980. if (tokenRow == position.row)
  981. element = element.substring(0, position.column - tokenColumn);
  982. if (this.voidElements.hasOwnProperty(element.toLowerCase()))
  983. return;
  984. return {
  985. text: ">" + "</" + element + ">",
  986. selection: [1, 1]
  987. };
  988. }
  989. });
  990. this.add("autoindent", "insertion", function (state, action, editor, session, text) {
  991. if (text == "\n") {
  992. var cursor = editor.getCursorPosition();
  993. var line = session.getLine(cursor.row);
  994. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  995. var token = iterator.getCurrentToken();
  996. if (token && token.type.indexOf("tag-close") !== -1) {
  997. if (token.value == "/>")
  998. return;
  999. while (token && token.type.indexOf("tag-name") === -1) {
  1000. token = iterator.stepBackward();
  1001. }
  1002. if (!token) {
  1003. return;
  1004. }
  1005. var tag = token.value;
  1006. var row = iterator.getCurrentTokenRow();
  1007. token = iterator.stepBackward();
  1008. if (!token || token.type.indexOf("end-tag") !== -1) {
  1009. return;
  1010. }
  1011. if (this.voidElements && !this.voidElements[tag]) {
  1012. var nextToken = session.getTokenAt(cursor.row, cursor.column+1);
  1013. var line = session.getLine(row);
  1014. var nextIndent = this.$getIndent(line);
  1015. var indent = nextIndent + session.getTabString();
  1016. if (nextToken && nextToken.value === "</") {
  1017. return {
  1018. text: "\n" + indent + "\n" + nextIndent,
  1019. selection: [1, indent.length, 1, indent.length]
  1020. };
  1021. } else {
  1022. return {
  1023. text: "\n" + indent
  1024. };
  1025. }
  1026. }
  1027. }
  1028. }
  1029. });
  1030. };
  1031. oop.inherits(XmlBehaviour, Behaviour);
  1032. exports.XmlBehaviour = XmlBehaviour;
  1033. });
  1034. define("ace/mode/folding/xml",["ace_require","exports","module","ace/lib/oop","ace/lib/lang","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"], function(ace_require, exports, module) {
  1035. "use strict";
  1036. var oop = ace_require("../../lib/oop");
  1037. var lang = ace_require("../../lib/lang");
  1038. var Range = ace_require("../../range").Range;
  1039. var BaseFoldMode = ace_require("./fold_mode").FoldMode;
  1040. var TokenIterator = ace_require("../../token_iterator").TokenIterator;
  1041. var FoldMode = exports.FoldMode = function(voidElements, optionalEndTags) {
  1042. BaseFoldMode.call(this);
  1043. this.voidElements = voidElements || {};
  1044. this.optionalEndTags = oop.mixin({}, this.voidElements);
  1045. if (optionalEndTags)
  1046. oop.mixin(this.optionalEndTags, optionalEndTags);
  1047. };
  1048. oop.inherits(FoldMode, BaseFoldMode);
  1049. var Tag = function() {
  1050. this.tagName = "";
  1051. this.closing = false;
  1052. this.selfClosing = false;
  1053. this.start = {row: 0, column: 0};
  1054. this.end = {row: 0, column: 0};
  1055. };
  1056. function is(token, type) {
  1057. return token.type.lastIndexOf(type + ".xml") > -1;
  1058. }
  1059. (function() {
  1060. this.getFoldWidget = function(session, foldStyle, row) {
  1061. var tag = this._getFirstTagInLine(session, row);
  1062. if (!tag)
  1063. return this.getCommentFoldWidget(session, row);
  1064. if (tag.closing || (!tag.tagName && tag.selfClosing))
  1065. return foldStyle == "markbeginend" ? "end" : "";
  1066. if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
  1067. return "";
  1068. if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
  1069. return "";
  1070. return "start";
  1071. };
  1072. this.getCommentFoldWidget = function(session, row) {
  1073. if (/comment/.test(session.getState(row)) && /<!-/.test(session.getLine(row)))
  1074. return "start";
  1075. return "";
  1076. };
  1077. this._getFirstTagInLine = function(session, row) {
  1078. var tokens = session.getTokens(row);
  1079. var tag = new Tag();
  1080. for (var i = 0; i < tokens.length; i++) {
  1081. var token = tokens[i];
  1082. if (is(token, "tag-open")) {
  1083. tag.end.column = tag.start.column + token.value.length;
  1084. tag.closing = is(token, "end-tag-open");
  1085. token = tokens[++i];
  1086. if (!token)
  1087. return null;
  1088. tag.tagName = token.value;
  1089. tag.end.column += token.value.length;
  1090. for (i++; i < tokens.length; i++) {
  1091. token = tokens[i];
  1092. tag.end.column += token.value.length;
  1093. if (is(token, "tag-close")) {
  1094. tag.selfClosing = token.value == '/>';
  1095. break;
  1096. }
  1097. }
  1098. return tag;
  1099. } else if (is(token, "tag-close")) {
  1100. tag.selfClosing = token.value == '/>';
  1101. return tag;
  1102. }
  1103. tag.start.column += token.value.length;
  1104. }
  1105. return null;
  1106. };
  1107. this._findEndTagInLine = function(session, row, tagName, startColumn) {
  1108. var tokens = session.getTokens(row);
  1109. var column = 0;
  1110. for (var i = 0; i < tokens.length; i++) {
  1111. var token = tokens[i];
  1112. column += token.value.length;
  1113. if (column < startColumn)
  1114. continue;
  1115. if (is(token, "end-tag-open")) {
  1116. token = tokens[i + 1];
  1117. if (token && token.value == tagName)
  1118. return true;
  1119. }
  1120. }
  1121. return false;
  1122. };
  1123. this._readTagForward = function(iterator) {
  1124. var token = iterator.getCurrentToken();
  1125. if (!token)
  1126. return null;
  1127. var tag = new Tag();
  1128. do {
  1129. if (is(token, "tag-open")) {
  1130. tag.closing = is(token, "end-tag-open");
  1131. tag.start.row = iterator.getCurrentTokenRow();
  1132. tag.start.column = iterator.getCurrentTokenColumn();
  1133. } else if (is(token, "tag-name")) {
  1134. tag.tagName = token.value;
  1135. } else if (is(token, "tag-close")) {
  1136. tag.selfClosing = token.value == "/>";
  1137. tag.end.row = iterator.getCurrentTokenRow();
  1138. tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
  1139. iterator.stepForward();
  1140. return tag;
  1141. }
  1142. } while(token = iterator.stepForward());
  1143. return null;
  1144. };
  1145. this._readTagBackward = function(iterator) {
  1146. var token = iterator.getCurrentToken();
  1147. if (!token)
  1148. return null;
  1149. var tag = new Tag();
  1150. do {
  1151. if (is(token, "tag-open")) {
  1152. tag.closing = is(token, "end-tag-open");
  1153. tag.start.row = iterator.getCurrentTokenRow();
  1154. tag.start.column = iterator.getCurrentTokenColumn();
  1155. iterator.stepBackward();
  1156. return tag;
  1157. } else if (is(token, "tag-name")) {
  1158. tag.tagName = token.value;
  1159. } else if (is(token, "tag-close")) {
  1160. tag.selfClosing = token.value == "/>";
  1161. tag.end.row = iterator.getCurrentTokenRow();
  1162. tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
  1163. }
  1164. } while(token = iterator.stepBackward());
  1165. return null;
  1166. };
  1167. this._pop = function(stack, tag) {
  1168. while (stack.length) {
  1169. var top = stack[stack.length-1];
  1170. if (!tag || top.tagName == tag.tagName) {
  1171. return stack.pop();
  1172. }
  1173. else if (this.optionalEndTags.hasOwnProperty(top.tagName)) {
  1174. stack.pop();
  1175. continue;
  1176. } else {
  1177. return null;
  1178. }
  1179. }
  1180. };
  1181. this.getFoldWidgetRange = function(session, foldStyle, row) {
  1182. var firstTag = this._getFirstTagInLine(session, row);
  1183. if (!firstTag) {
  1184. return this.getCommentFoldWidget(session, row)
  1185. && session.getCommentFoldRange(row, session.getLine(row).length);
  1186. }
  1187. var isBackward = firstTag.closing || firstTag.selfClosing;
  1188. var stack = [];
  1189. var tag;
  1190. if (!isBackward) {
  1191. var iterator = new TokenIterator(session, row, firstTag.start.column);
  1192. var start = {
  1193. row: row,
  1194. column: firstTag.start.column + firstTag.tagName.length + 2
  1195. };
  1196. if (firstTag.start.row == firstTag.end.row)
  1197. start.column = firstTag.end.column;
  1198. while (tag = this._readTagForward(iterator)) {
  1199. if (tag.selfClosing) {
  1200. if (!stack.length) {
  1201. tag.start.column += tag.tagName.length + 2;
  1202. tag.end.column -= 2;
  1203. return Range.fromPoints(tag.start, tag.end);
  1204. } else
  1205. continue;
  1206. }
  1207. if (tag.closing) {
  1208. this._pop(stack, tag);
  1209. if (stack.length == 0)
  1210. return Range.fromPoints(start, tag.start);
  1211. }
  1212. else {
  1213. stack.push(tag);
  1214. }
  1215. }
  1216. }
  1217. else {
  1218. var iterator = new TokenIterator(session, row, firstTag.end.column);
  1219. var end = {
  1220. row: row,
  1221. column: firstTag.start.column
  1222. };
  1223. while (tag = this._readTagBackward(iterator)) {
  1224. if (tag.selfClosing) {
  1225. if (!stack.length) {
  1226. tag.start.column += tag.tagName.length + 2;
  1227. tag.end.column -= 2;
  1228. return Range.fromPoints(tag.start, tag.end);
  1229. } else
  1230. continue;
  1231. }
  1232. if (!tag.closing) {
  1233. this._pop(stack, tag);
  1234. if (stack.length == 0) {
  1235. tag.start.column += tag.tagName.length + 2;
  1236. if (tag.start.row == tag.end.row && tag.start.column < tag.end.column)
  1237. tag.start.column = tag.end.column;
  1238. return Range.fromPoints(tag.start, end);
  1239. }
  1240. }
  1241. else {
  1242. stack.push(tag);
  1243. }
  1244. }
  1245. }
  1246. };
  1247. }).call(FoldMode.prototype);
  1248. });
  1249. define("ace/mode/xml",["ace_require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml","ace/worker/worker_client"], function(ace_require, exports, module) {
  1250. "use strict";
  1251. var oop = ace_require("../lib/oop");
  1252. var lang = ace_require("../lib/lang");
  1253. var TextMode = ace_require("./text").Mode;
  1254. var XmlHighlightRules = ace_require("./xml_highlight_rules").XmlHighlightRules;
  1255. var XmlBehaviour = ace_require("./behaviour/xml").XmlBehaviour;
  1256. var XmlFoldMode = ace_require("./folding/xml").FoldMode;
  1257. var WorkerClient = ace_require("../worker/worker_client").WorkerClient;
  1258. var Mode = function() {
  1259. this.HighlightRules = XmlHighlightRules;
  1260. this.$behaviour = new XmlBehaviour();
  1261. this.foldingRules = new XmlFoldMode();
  1262. };
  1263. oop.inherits(Mode, TextMode);
  1264. (function() {
  1265. this.voidElements = lang.arrayToMap([]);
  1266. this.blockComment = {start: "<!--", end: "-->"};
  1267. this.createWorker = function(session) {
  1268. var worker = new WorkerClient(["ace"], "ace/mode/xml_worker", "Worker");
  1269. worker.attachToDocument(session.getDocument());
  1270. worker.on("error", function(e) {
  1271. session.setAnnotations(e.data);
  1272. });
  1273. worker.on("terminate", function() {
  1274. session.clearAnnotations();
  1275. });
  1276. return worker;
  1277. };
  1278. this.$id = "ace/mode/xml";
  1279. }).call(Mode.prototype);
  1280. exports.Mode = Mode;
  1281. });
  1282. define("ace/mode/css_highlight_rules",["ace_require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(ace_require, exports, module) {
  1283. "use strict";
  1284. var oop = ace_require("../lib/oop");
  1285. var lang = ace_require("../lib/lang");
  1286. var TextHighlightRules = ace_require("./text_highlight_rules").TextHighlightRules;
  1287. var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
  1288. var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
  1289. var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom";
  1290. var supportConstantColor = exports.supportConstantColor = "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen";
  1291. var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
  1292. var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))";
  1293. var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
  1294. var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";
  1295. var CssHighlightRules = function() {
  1296. var keywordMapper = this.createKeywordMapper({
  1297. "support.function": supportFunction,
  1298. "support.constant": supportConstant,
  1299. "support.type": supportType,
  1300. "support.constant.color": supportConstantColor,
  1301. "support.constant.fonts": supportConstantFonts
  1302. }, "text", true);
  1303. this.$rules = {
  1304. "start" : [{
  1305. include : ["strings", "url", "comments"]
  1306. }, {
  1307. token: "paren.lparen",
  1308. regex: "\\{",
  1309. next: "ruleset"
  1310. }, {
  1311. token: "paren.rparen",
  1312. regex: "\\}"
  1313. }, {
  1314. token: "string",
  1315. regex: "@(?!viewport)",
  1316. next: "media"
  1317. }, {
  1318. token: "keyword",
  1319. regex: "#[a-z0-9-_]+"
  1320. }, {
  1321. token: "keyword",
  1322. regex: "%"
  1323. }, {
  1324. token: "variable",
  1325. regex: "\\.[a-z0-9-_]+"
  1326. }, {
  1327. token: "string",
  1328. regex: ":[a-z0-9-_]+"
  1329. }, {
  1330. token : "constant.numeric",
  1331. regex : numRe
  1332. }, {
  1333. token: "constant",
  1334. regex: "[a-z0-9-_]+"
  1335. }, {
  1336. caseInsensitive: true
  1337. }],
  1338. "media": [{
  1339. include : ["strings", "url", "comments"]
  1340. }, {
  1341. token: "paren.lparen",
  1342. regex: "\\{",
  1343. next: "start"
  1344. }, {
  1345. token: "paren.rparen",
  1346. regex: "\\}",
  1347. next: "start"
  1348. }, {
  1349. token: "string",
  1350. regex: ";",
  1351. next: "start"
  1352. }, {
  1353. token: "keyword",
  1354. regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
  1355. + "|page|font|keyframes|viewport|counter-style|font-feature-values"
  1356. + "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
  1357. }],
  1358. "comments" : [{
  1359. token: "comment", // multi line comment
  1360. regex: "\\/\\*",
  1361. push: [{
  1362. token : "comment",
  1363. regex : "\\*\\/",
  1364. next : "pop"
  1365. }, {
  1366. defaultToken : "comment"
  1367. }]
  1368. }],
  1369. "ruleset" : [{
  1370. regex : "-(webkit|ms|moz|o)-",
  1371. token : "text"
  1372. }, {
  1373. token : "punctuation.operator",
  1374. regex : "[:;]"
  1375. }, {
  1376. token : "paren.rparen",
  1377. regex : "\\}",
  1378. next : "start"
  1379. }, {
  1380. include : ["strings", "url", "comments"]
  1381. }, {
  1382. token : ["constant.numeric", "keyword"],
  1383. regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"
  1384. }, {
  1385. token : "constant.numeric",
  1386. regex : numRe
  1387. }, {
  1388. token : "constant.numeric", // hex6 color
  1389. regex : "#[a-f0-9]{6}"
  1390. }, {
  1391. token : "constant.numeric", // hex3 color
  1392. regex : "#[a-f0-9]{3}"
  1393. }, {
  1394. token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
  1395. regex : pseudoElements
  1396. }, {
  1397. token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
  1398. regex : pseudoClasses
  1399. }, {
  1400. include: "url"
  1401. }, {
  1402. token : keywordMapper,
  1403. regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
  1404. }, {
  1405. caseInsensitive: true
  1406. }],
  1407. url: [{
  1408. token : "support.function",
  1409. regex : "(?:url(:?-prefix)?|domain|regexp)\\(",
  1410. push: [{
  1411. token : "support.function",
  1412. regex : "\\)",
  1413. next : "pop"
  1414. }, {
  1415. defaultToken: "string"
  1416. }]
  1417. }],
  1418. strings: [{
  1419. token : "string.start",
  1420. regex : "'",
  1421. push : [{
  1422. token : "string.end",
  1423. regex : "'|$",
  1424. next: "pop"
  1425. }, {
  1426. include : "escapes"
  1427. }, {
  1428. token : "constant.language.escape",
  1429. regex : /\\$/,
  1430. consumeLineEnd: true
  1431. }, {
  1432. defaultToken: "string"
  1433. }]
  1434. }, {
  1435. token : "string.start",
  1436. regex : '"',
  1437. push : [{
  1438. token : "string.end",
  1439. regex : '"|$',
  1440. next: "pop"
  1441. }, {
  1442. include : "escapes"
  1443. }, {
  1444. token : "constant.language.escape",
  1445. regex : /\\$/,
  1446. consumeLineEnd: true
  1447. }, {
  1448. defaultToken: "string"
  1449. }]
  1450. }],
  1451. escapes: [{
  1452. token : "constant.language.escape",
  1453. regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
  1454. }]
  1455. };
  1456. this.normalizeRules();
  1457. };
  1458. oop.inherits(CssHighlightRules, TextHighlightRules);
  1459. exports.CssHighlightRules = CssHighlightRules;
  1460. });
  1461. define("ace/mode/css_completions",["ace_require","exports","module"], function(ace_require, exports, module) {
  1462. "use strict";
  1463. var propertyMap = {
  1464. "background": {"#$0": 1},
  1465. "background-color": {"#$0": 1, "transparent": 1, "fixed": 1},
  1466. "background-image": {"url('/$0')": 1},
  1467. "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1},
  1468. "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2},
  1469. "background-attachment": {"scroll": 1, "fixed": 1},
  1470. "background-size": {"cover": 1, "contain": 1},
  1471. "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1},
  1472. "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1},
  1473. "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1},
  1474. "border-color": {"#$0": 1},
  1475. "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2},
  1476. "border-collapse": {"collapse": 1, "separate": 1},
  1477. "bottom": {"px": 1, "em": 1, "%": 1},
  1478. "clear": {"left": 1, "right": 1, "both": 1, "none": 1},
  1479. "color": {"#$0": 1, "rgb(#$00,0,0)": 1},
  1480. "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1},
  1481. "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1},
  1482. "empty-cells": {"show": 1, "hide": 1},
  1483. "float": {"left": 1, "right": 1, "none": 1},
  1484. "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1},
  1485. "font-size": {"px": 1, "em": 1, "%": 1},
  1486. "font-weight": {"bold": 1, "normal": 1},
  1487. "font-style": {"italic": 1, "normal": 1},
  1488. "font-variant": {"normal": 1, "small-caps": 1},
  1489. "height": {"px": 1, "em": 1, "%": 1},
  1490. "left": {"px": 1, "em": 1, "%": 1},
  1491. "letter-spacing": {"normal": 1},
  1492. "line-height": {"normal": 1},
  1493. "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1},
  1494. "margin": {"px": 1, "em": 1, "%": 1},
  1495. "margin-right": {"px": 1, "em": 1, "%": 1},
  1496. "margin-left": {"px": 1, "em": 1, "%": 1},
  1497. "margin-top": {"px": 1, "em": 1, "%": 1},
  1498. "margin-bottom": {"px": 1, "em": 1, "%": 1},
  1499. "max-height": {"px": 1, "em": 1, "%": 1},
  1500. "max-width": {"px": 1, "em": 1, "%": 1},
  1501. "min-height": {"px": 1, "em": 1, "%": 1},
  1502. "min-width": {"px": 1, "em": 1, "%": 1},
  1503. "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
  1504. "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
  1505. "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
  1506. "padding": {"px": 1, "em": 1, "%": 1},
  1507. "padding-top": {"px": 1, "em": 1, "%": 1},
  1508. "padding-right": {"px": 1, "em": 1, "%": 1},
  1509. "padding-bottom": {"px": 1, "em": 1, "%": 1},
  1510. "padding-left": {"px": 1, "em": 1, "%": 1},
  1511. "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
  1512. "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
  1513. "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1},
  1514. "right": {"px": 1, "em": 1, "%": 1},
  1515. "table-layout": {"fixed": 1, "auto": 1},
  1516. "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1},
  1517. "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1},
  1518. "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1},
  1519. "top": {"px": 1, "em": 1, "%": 1},
  1520. "vertical-align": {"top": 1, "bottom": 1},
  1521. "visibility": {"hidden": 1, "visible": 1},
  1522. "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1},
  1523. "width": {"px": 1, "em": 1, "%": 1},
  1524. "word-spacing": {"normal": 1},
  1525. "filter": {"alpha(opacity=$0100)": 1},
  1526. "text-shadow": {"$02px 2px 2px #777": 1},
  1527. "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},
  1528. "-moz-border-radius": 1,
  1529. "-moz-border-radius-topright": 1,
  1530. "-moz-border-radius-bottomright": 1,
  1531. "-moz-border-radius-topleft": 1,
  1532. "-moz-border-radius-bottomleft": 1,
  1533. "-webkit-border-radius": 1,
  1534. "-webkit-border-top-right-radius": 1,
  1535. "-webkit-border-top-left-radius": 1,
  1536. "-webkit-border-bottom-right-radius": 1,
  1537. "-webkit-border-bottom-left-radius": 1,
  1538. "-moz-box-shadow": 1,
  1539. "-webkit-box-shadow": 1,
  1540. "transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
  1541. "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
  1542. "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 }
  1543. };
  1544. var CssCompletions = function() {
  1545. };
  1546. (function() {
  1547. this.completionsDefined = false;
  1548. this.defineCompletions = function() {
  1549. if (document) {
  1550. var style = document.createElement('c').style;
  1551. for (var i in style) {
  1552. if (typeof style[i] !== 'string')
  1553. continue;
  1554. var name = i.replace(/[A-Z]/g, function(x) {
  1555. return '-' + x.toLowerCase();
  1556. });
  1557. if (!propertyMap.hasOwnProperty(name))
  1558. propertyMap[name] = 1;
  1559. }
  1560. }
  1561. this.completionsDefined = true;
  1562. };
  1563. this.getCompletions = function(state, session, pos, prefix) {
  1564. if (!this.completionsDefined) {
  1565. this.defineCompletions();
  1566. }
  1567. if (state==='ruleset' || session.$mode.$id == "ace/mode/scss") {
  1568. var line = session.getLine(pos.row).substr(0, pos.column);
  1569. if (/:[^;]+$/.test(line)) {
  1570. /([\w\-]+):[^:]*$/.test(line);
  1571. return this.getPropertyValueCompletions(state, session, pos, prefix);
  1572. } else {
  1573. return this.getPropertyCompletions(state, session, pos, prefix);
  1574. }
  1575. }
  1576. return [];
  1577. };
  1578. this.getPropertyCompletions = function(state, session, pos, prefix) {
  1579. var properties = Object.keys(propertyMap);
  1580. return properties.map(function(property){
  1581. return {
  1582. caption: property,
  1583. snippet: property + ': $0;',
  1584. meta: "property",
  1585. score: 1000000
  1586. };
  1587. });
  1588. };
  1589. this.getPropertyValueCompletions = function(state, session, pos, prefix) {
  1590. var line = session.getLine(pos.row).substr(0, pos.column);
  1591. var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
  1592. if (!property)
  1593. return [];
  1594. var values = [];
  1595. if (property in propertyMap && typeof propertyMap[property] === "object") {
  1596. values = Object.keys(propertyMap[property]);
  1597. }
  1598. return values.map(function(value){
  1599. return {
  1600. caption: value,
  1601. snippet: value,
  1602. meta: "property value",
  1603. score: 1000000
  1604. };
  1605. });
  1606. };
  1607. }).call(CssCompletions.prototype);
  1608. exports.CssCompletions = CssCompletions;
  1609. });
  1610. define("ace/mode/behaviour/css",["ace_require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(ace_require, exports, module) {
  1611. "use strict";
  1612. var oop = ace_require("../../lib/oop");
  1613. var Behaviour = ace_require("../behaviour").Behaviour;
  1614. var CstyleBehaviour = ace_require("./cstyle").CstyleBehaviour;
  1615. var TokenIterator = ace_require("../../token_iterator").TokenIterator;
  1616. var CssBehaviour = function () {
  1617. this.inherit(CstyleBehaviour);
  1618. this.add("colon", "insertion", function (state, action, editor, session, text) {
  1619. if (text === ':' && editor.selection.isEmpty()) {
  1620. var cursor = editor.getCursorPosition();
  1621. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  1622. var token = iterator.getCurrentToken();
  1623. if (token && token.value.match(/\s+/)) {
  1624. token = iterator.stepBackward();
  1625. }
  1626. if (token && token.type === 'support.type') {
  1627. var line = session.doc.getLine(cursor.row);
  1628. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1629. if (rightChar === ':') {
  1630. return {
  1631. text: '',
  1632. selection: [1, 1]
  1633. };
  1634. }
  1635. if (/^(\s+[^;]|\s*$)/.test(line.substring(cursor.column))) {
  1636. return {
  1637. text: ':;',
  1638. selection: [1, 1]
  1639. };
  1640. }
  1641. }
  1642. }
  1643. });
  1644. this.add("colon", "deletion", function (state, action, editor, session, range) {
  1645. var selected = session.doc.getTextRange(range);
  1646. if (!range.isMultiLine() && selected === ':') {
  1647. var cursor = editor.getCursorPosition();
  1648. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  1649. var token = iterator.getCurrentToken();
  1650. if (token && token.value.match(/\s+/)) {
  1651. token = iterator.stepBackward();
  1652. }
  1653. if (token && token.type === 'support.type') {
  1654. var line = session.doc.getLine(range.start.row);
  1655. var rightChar = line.substring(range.end.column, range.end.column + 1);
  1656. if (rightChar === ';') {
  1657. range.end.column ++;
  1658. return range;
  1659. }
  1660. }
  1661. }
  1662. });
  1663. this.add("semicolon", "insertion", function (state, action, editor, session, text) {
  1664. if (text === ';' && editor.selection.isEmpty()) {
  1665. var cursor = editor.getCursorPosition();
  1666. var line = session.doc.getLine(cursor.row);
  1667. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1668. if (rightChar === ';') {
  1669. return {
  1670. text: '',
  1671. selection: [1, 1]
  1672. };
  1673. }
  1674. }
  1675. });
  1676. this.add("!important", "insertion", function (state, action, editor, session, text) {
  1677. if (text === '!' && editor.selection.isEmpty()) {
  1678. var cursor = editor.getCursorPosition();
  1679. var line = session.doc.getLine(cursor.row);
  1680. if (/^\s*(;|}|$)/.test(line.substring(cursor.column))) {
  1681. return {
  1682. text: '!important',
  1683. selection: [10, 10]
  1684. };
  1685. }
  1686. }
  1687. });
  1688. };
  1689. oop.inherits(CssBehaviour, CstyleBehaviour);
  1690. exports.CssBehaviour = CssBehaviour;
  1691. });
  1692. define("ace/mode/css",["ace_require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(ace_require, exports, module) {
  1693. "use strict";
  1694. var oop = ace_require("../lib/oop");
  1695. var TextMode = ace_require("./text").Mode;
  1696. var CssHighlightRules = ace_require("./css_highlight_rules").CssHighlightRules;
  1697. var MatchingBraceOutdent = ace_require("./matching_brace_outdent").MatchingBraceOutdent;
  1698. var WorkerClient = ace_require("../worker/worker_client").WorkerClient;
  1699. var CssCompletions = ace_require("./css_completions").CssCompletions;
  1700. var CssBehaviour = ace_require("./behaviour/css").CssBehaviour;
  1701. var CStyleFoldMode = ace_require("./folding/cstyle").FoldMode;
  1702. var Mode = function() {
  1703. this.HighlightRules = CssHighlightRules;
  1704. this.$outdent = new MatchingBraceOutdent();
  1705. this.$behaviour = new CssBehaviour();
  1706. this.$completer = new CssCompletions();
  1707. this.foldingRules = new CStyleFoldMode();
  1708. };
  1709. oop.inherits(Mode, TextMode);
  1710. (function() {
  1711. this.foldingRules = "cStyle";
  1712. this.blockComment = {start: "/*", end: "*/"};
  1713. this.getNextLineIndent = function(state, line, tab) {
  1714. var indent = this.$getIndent(line);
  1715. var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
  1716. if (tokens.length && tokens[tokens.length-1].type == "comment") {
  1717. return indent;
  1718. }
  1719. var match = line.match(/^.*\{\s*$/);
  1720. if (match) {
  1721. indent += tab;
  1722. }
  1723. return indent;
  1724. };
  1725. this.checkOutdent = function(state, line, input) {
  1726. return this.$outdent.checkOutdent(line, input);
  1727. };
  1728. this.autoOutdent = function(state, doc, row) {
  1729. this.$outdent.autoOutdent(doc, row);
  1730. };
  1731. this.getCompletions = function(state, session, pos, prefix) {
  1732. return this.$completer.getCompletions(state, session, pos, prefix);
  1733. };
  1734. this.createWorker = function(session) {
  1735. var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
  1736. worker.attachToDocument(session.getDocument());
  1737. worker.on("annotate", function(e) {
  1738. session.setAnnotations(e.data);
  1739. });
  1740. worker.on("terminate", function() {
  1741. session.clearAnnotations();
  1742. });
  1743. return worker;
  1744. };
  1745. this.$id = "ace/mode/css";
  1746. this.snippetFileId = "ace/snippets/css";
  1747. }).call(Mode.prototype);
  1748. exports.Mode = Mode;
  1749. });
  1750. define("ace/mode/html_highlight_rules",["ace_require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(ace_require, exports, module) {
  1751. "use strict";
  1752. var oop = ace_require("../lib/oop");
  1753. var lang = ace_require("../lib/lang");
  1754. var CssHighlightRules = ace_require("./css_highlight_rules").CssHighlightRules;
  1755. var JavaScriptHighlightRules = ace_require("./javascript_highlight_rules").JavaScriptHighlightRules;
  1756. var XmlHighlightRules = ace_require("./xml_highlight_rules").XmlHighlightRules;
  1757. var tagMap = lang.createMap({
  1758. a : 'anchor',
  1759. button : 'form',
  1760. form : 'form',
  1761. img : 'image',
  1762. input : 'form',
  1763. label : 'form',
  1764. option : 'form',
  1765. script : 'script',
  1766. select : 'form',
  1767. textarea : 'form',
  1768. style : 'style',
  1769. table : 'table',
  1770. tbody : 'table',
  1771. td : 'table',
  1772. tfoot : 'table',
  1773. th : 'table',
  1774. tr : 'table'
  1775. });
  1776. var HtmlHighlightRules = function() {
  1777. XmlHighlightRules.call(this);
  1778. this.addRules({
  1779. attributes: [{
  1780. include : "tag_whitespace"
  1781. }, {
  1782. token : "entity.other.attribute-name.xml",
  1783. regex : "[-_a-zA-Z0-9:.]+"
  1784. }, {
  1785. token : "keyword.operator.attribute-equals.xml",
  1786. regex : "=",
  1787. push : [{
  1788. include: "tag_whitespace"
  1789. }, {
  1790. token : "string.unquoted.attribute-value.html",
  1791. regex : "[^<>='\"`\\s]+",
  1792. next : "pop"
  1793. }, {
  1794. token : "empty",
  1795. regex : "",
  1796. next : "pop"
  1797. }]
  1798. }, {
  1799. include : "attribute_value"
  1800. }],
  1801. tag: [{
  1802. token : function(start, tag) {
  1803. var group = tagMap[tag];
  1804. return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
  1805. "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
  1806. },
  1807. regex : "(</?)([-_a-zA-Z0-9:.]+)",
  1808. next: "tag_stuff"
  1809. }],
  1810. tag_stuff: [
  1811. {include : "attributes"},
  1812. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
  1813. ]
  1814. });
  1815. this.embedTagRules(CssHighlightRules, "css-", "style");
  1816. this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script");
  1817. if (this.constructor === HtmlHighlightRules)
  1818. this.normalizeRules();
  1819. };
  1820. oop.inherits(HtmlHighlightRules, XmlHighlightRules);
  1821. exports.HtmlHighlightRules = HtmlHighlightRules;
  1822. });
  1823. define("ace/mode/folding/mixed",["ace_require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(ace_require, exports, module) {
  1824. "use strict";
  1825. var oop = ace_require("../../lib/oop");
  1826. var BaseFoldMode = ace_require("./fold_mode").FoldMode;
  1827. var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
  1828. this.defaultMode = defaultMode;
  1829. this.subModes = subModes;
  1830. };
  1831. oop.inherits(FoldMode, BaseFoldMode);
  1832. (function() {
  1833. this.$getMode = function(state) {
  1834. if (typeof state != "string")
  1835. state = state[0];
  1836. for (var key in this.subModes) {
  1837. if (state.indexOf(key) === 0)
  1838. return this.subModes[key];
  1839. }
  1840. return null;
  1841. };
  1842. this.$tryMode = function(state, session, foldStyle, row) {
  1843. var mode = this.$getMode(state);
  1844. return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
  1845. };
  1846. this.getFoldWidget = function(session, foldStyle, row) {
  1847. return (
  1848. this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
  1849. this.$tryMode(session.getState(row), session, foldStyle, row) ||
  1850. this.defaultMode.getFoldWidget(session, foldStyle, row)
  1851. );
  1852. };
  1853. this.getFoldWidgetRange = function(session, foldStyle, row) {
  1854. var mode = this.$getMode(session.getState(row-1));
  1855. if (!mode || !mode.getFoldWidget(session, foldStyle, row))
  1856. mode = this.$getMode(session.getState(row));
  1857. if (!mode || !mode.getFoldWidget(session, foldStyle, row))
  1858. mode = this.defaultMode;
  1859. return mode.getFoldWidgetRange(session, foldStyle, row);
  1860. };
  1861. }).call(FoldMode.prototype);
  1862. });
  1863. define("ace/mode/folding/html",["ace_require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(ace_require, exports, module) {
  1864. "use strict";
  1865. var oop = ace_require("../../lib/oop");
  1866. var MixedFoldMode = ace_require("./mixed").FoldMode;
  1867. var XmlFoldMode = ace_require("./xml").FoldMode;
  1868. var CStyleFoldMode = ace_require("./cstyle").FoldMode;
  1869. var FoldMode = exports.FoldMode = function(voidElements, optionalTags) {
  1870. MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
  1871. "js-": new CStyleFoldMode(),
  1872. "css-": new CStyleFoldMode()
  1873. });
  1874. };
  1875. oop.inherits(FoldMode, MixedFoldMode);
  1876. });
  1877. define("ace/mode/html_completions",["ace_require","exports","module","ace/token_iterator"], function(ace_require, exports, module) {
  1878. "use strict";
  1879. var TokenIterator = ace_require("../token_iterator").TokenIterator;
  1880. var commonAttributes = [
  1881. "accesskey",
  1882. "class",
  1883. "contenteditable",
  1884. "contextmenu",
  1885. "dir",
  1886. "draggable",
  1887. "dropzone",
  1888. "hidden",
  1889. "id",
  1890. "inert",
  1891. "itemid",
  1892. "itemprop",
  1893. "itemref",
  1894. "itemscope",
  1895. "itemtype",
  1896. "lang",
  1897. "spellcheck",
  1898. "style",
  1899. "tabindex",
  1900. "title",
  1901. "translate"
  1902. ];
  1903. var eventAttributes = [
  1904. "onabort",
  1905. "onblur",
  1906. "oncancel",
  1907. "oncanplay",
  1908. "oncanplaythrough",
  1909. "onchange",
  1910. "onclick",
  1911. "onclose",
  1912. "oncontextmenu",
  1913. "oncuechange",
  1914. "ondblclick",
  1915. "ondrag",
  1916. "ondragend",
  1917. "ondragenter",
  1918. "ondragleave",
  1919. "ondragover",
  1920. "ondragstart",
  1921. "ondrop",
  1922. "ondurationchange",
  1923. "onemptied",
  1924. "onended",
  1925. "onerror",
  1926. "onfocus",
  1927. "oninput",
  1928. "oninvalid",
  1929. "onkeydown",
  1930. "onkeypress",
  1931. "onkeyup",
  1932. "onload",
  1933. "onloadeddata",
  1934. "onloadedmetadata",
  1935. "onloadstart",
  1936. "onmousedown",
  1937. "onmousemove",
  1938. "onmouseout",
  1939. "onmouseover",
  1940. "onmouseup",
  1941. "onmousewheel",
  1942. "onpause",
  1943. "onplay",
  1944. "onplaying",
  1945. "onprogress",
  1946. "onratechange",
  1947. "onreset",
  1948. "onscroll",
  1949. "onseeked",
  1950. "onseeking",
  1951. "onselect",
  1952. "onshow",
  1953. "onstalled",
  1954. "onsubmit",
  1955. "onsuspend",
  1956. "ontimeupdate",
  1957. "onvolumechange",
  1958. "onwaiting"
  1959. ];
  1960. var globalAttributes = commonAttributes.concat(eventAttributes);
  1961. var attributeMap = {
  1962. "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1},
  1963. "abbr": {},
  1964. "address": {},
  1965. "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1},
  1966. "article": {"pubdate": 1},
  1967. "aside": {},
  1968. "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }},
  1969. "b": {},
  1970. "base": {"href": 1, "target": 1},
  1971. "bdi": {},
  1972. "bdo": {},
  1973. "blockquote": {"cite": 1},
  1974. "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1},
  1975. "br": {},
  1976. "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}},
  1977. "canvas": {"width": 1, "height": 1},
  1978. "caption": {},
  1979. "cite": {},
  1980. "code": {},
  1981. "col": {"span": 1},
  1982. "colgroup": {"span": 1},
  1983. "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1},
  1984. "data": {},
  1985. "datalist": {},
  1986. "dd": {},
  1987. "del": {"cite": 1, "datetime": 1},
  1988. "details": {"open": 1},
  1989. "dfn": {},
  1990. "dialog": {"open": 1},
  1991. "div": {},
  1992. "dl": {},
  1993. "dt": {},
  1994. "em": {},
  1995. "embed": {"src": 1, "height": 1, "width": 1, "type": 1},
  1996. "fieldset": {"disabled": 1, "form": 1, "name": 1},
  1997. "figcaption": {},
  1998. "figure": {},
  1999. "footer": {},
  2000. "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}},
  2001. "h1": {},
  2002. "h2": {},
  2003. "h3": {},
  2004. "h4": {},
  2005. "h5": {},
  2006. "h6": {},
  2007. "head": {},
  2008. "header": {},
  2009. "hr": {},
  2010. "html": {"manifest": 1},
  2011. "i": {},
  2012. "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}},
  2013. "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1},
  2014. "input": {
  2015. "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1},
  2016. "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1},
  2017. "ins": {"cite": 1, "datetime": 1},
  2018. "kbd": {},
  2019. "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1},
  2020. "label": {"form": 1, "for": 1},
  2021. "legend": {},
  2022. "li": {"value": 1},
  2023. "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1},
  2024. "main": {},
  2025. "map": {"name": 1},
  2026. "mark": {},
  2027. "math": {},
  2028. "menu": {"type": 1, "label": 1},
  2029. "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1},
  2030. "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1},
  2031. "nav": {},
  2032. "noscript": {"href": 1},
  2033. "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1},
  2034. "ol": {"start": 1, "reversed": 1},
  2035. "optgroup": {"disabled": 1, "label": 1},
  2036. "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1},
  2037. "output": {"for": 1, "form": 1, "name": 1},
  2038. "p": {},
  2039. "param": {"name": 1, "value": 1},
  2040. "pre": {},
  2041. "progress": {"value": 1, "max": 1},
  2042. "q": {"cite": 1},
  2043. "rp": {},
  2044. "rt": {},
  2045. "ruby": {},
  2046. "s": {},
  2047. "samp": {},
  2048. "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1},
  2049. "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}},
  2050. "small": {},
  2051. "source": {"src": 1, "type": 1, "media": 1},
  2052. "span": {},
  2053. "strong": {},
  2054. "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1},
  2055. "sub": {},
  2056. "sup": {},
  2057. "svg": {},
  2058. "table": {"summary": 1},
  2059. "tbody": {},
  2060. "td": {"headers": 1, "rowspan": 1, "colspan": 1},
  2061. "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}},
  2062. "tfoot": {},
  2063. "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1},
  2064. "thead": {},
  2065. "time": {"datetime": 1},
  2066. "title": {},
  2067. "tr": {},
  2068. "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1},
  2069. "section": {},
  2070. "summary": {},
  2071. "u": {},
  2072. "ul": {},
  2073. "var": {},
  2074. "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}},
  2075. "wbr": {}
  2076. };
  2077. var elements = Object.keys(attributeMap);
  2078. function is(token, type) {
  2079. return token.type.lastIndexOf(type + ".xml") > -1;
  2080. }
  2081. function findTagName(session, pos) {
  2082. var iterator = new TokenIterator(session, pos.row, pos.column);
  2083. var token = iterator.getCurrentToken();
  2084. while (token && !is(token, "tag-name")){
  2085. token = iterator.stepBackward();
  2086. }
  2087. if (token)
  2088. return token.value;
  2089. }
  2090. function findAttributeName(session, pos) {
  2091. var iterator = new TokenIterator(session, pos.row, pos.column);
  2092. var token = iterator.getCurrentToken();
  2093. while (token && !is(token, "attribute-name")){
  2094. token = iterator.stepBackward();
  2095. }
  2096. if (token)
  2097. return token.value;
  2098. }
  2099. var HtmlCompletions = function() {
  2100. };
  2101. (function() {
  2102. this.getCompletions = function(state, session, pos, prefix) {
  2103. var token = session.getTokenAt(pos.row, pos.column);
  2104. if (!token)
  2105. return [];
  2106. if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
  2107. return this.getTagCompletions(state, session, pos, prefix);
  2108. if (is(token, "tag-whitespace") || is(token, "attribute-name"))
  2109. return this.getAttributeCompletions(state, session, pos, prefix);
  2110. if (is(token, "attribute-value"))
  2111. return this.getAttributeValueCompletions(state, session, pos, prefix);
  2112. var line = session.getLine(pos.row).substr(0, pos.column);
  2113. if (/&[a-z]*$/i.test(line))
  2114. return this.getHTMLEntityCompletions(state, session, pos, prefix);
  2115. return [];
  2116. };
  2117. this.getTagCompletions = function(state, session, pos, prefix) {
  2118. return elements.map(function(element){
  2119. return {
  2120. value: element,
  2121. meta: "tag",
  2122. score: 1000000
  2123. };
  2124. });
  2125. };
  2126. this.getAttributeCompletions = function(state, session, pos, prefix) {
  2127. var tagName = findTagName(session, pos);
  2128. if (!tagName)
  2129. return [];
  2130. var attributes = globalAttributes;
  2131. if (tagName in attributeMap) {
  2132. attributes = attributes.concat(Object.keys(attributeMap[tagName]));
  2133. }
  2134. return attributes.map(function(attribute){
  2135. return {
  2136. caption: attribute,
  2137. snippet: attribute + '="$0"',
  2138. meta: "attribute",
  2139. score: 1000000
  2140. };
  2141. });
  2142. };
  2143. this.getAttributeValueCompletions = function(state, session, pos, prefix) {
  2144. var tagName = findTagName(session, pos);
  2145. var attributeName = findAttributeName(session, pos);
  2146. if (!tagName)
  2147. return [];
  2148. var values = [];
  2149. if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
  2150. values = Object.keys(attributeMap[tagName][attributeName]);
  2151. }
  2152. return values.map(function(value){
  2153. return {
  2154. caption: value,
  2155. snippet: value,
  2156. meta: "attribute value",
  2157. score: 1000000
  2158. };
  2159. });
  2160. };
  2161. this.getHTMLEntityCompletions = function(state, session, pos, prefix) {
  2162. var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;'];
  2163. return values.map(function(value){
  2164. return {
  2165. caption: value,
  2166. snippet: value,
  2167. meta: "html entity",
  2168. score: 1000000
  2169. };
  2170. });
  2171. };
  2172. }).call(HtmlCompletions.prototype);
  2173. exports.HtmlCompletions = HtmlCompletions;
  2174. });
  2175. define("ace/mode/html",["ace_require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(ace_require, exports, module) {
  2176. "use strict";
  2177. var oop = ace_require("../lib/oop");
  2178. var lang = ace_require("../lib/lang");
  2179. var TextMode = ace_require("./text").Mode;
  2180. var JavaScriptMode = ace_require("./javascript").Mode;
  2181. var CssMode = ace_require("./css").Mode;
  2182. var HtmlHighlightRules = ace_require("./html_highlight_rules").HtmlHighlightRules;
  2183. var XmlBehaviour = ace_require("./behaviour/xml").XmlBehaviour;
  2184. var HtmlFoldMode = ace_require("./folding/html").FoldMode;
  2185. var HtmlCompletions = ace_require("./html_completions").HtmlCompletions;
  2186. var WorkerClient = ace_require("../worker/worker_client").WorkerClient;
  2187. var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
  2188. var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
  2189. var Mode = function(options) {
  2190. this.fragmentContext = options && options.fragmentContext;
  2191. this.HighlightRules = HtmlHighlightRules;
  2192. this.$behaviour = new XmlBehaviour();
  2193. this.$completer = new HtmlCompletions();
  2194. this.createModeDelegates({
  2195. "js-": JavaScriptMode,
  2196. "css-": CssMode
  2197. });
  2198. this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
  2199. };
  2200. oop.inherits(Mode, TextMode);
  2201. (function() {
  2202. this.blockComment = {start: "<!--", end: "-->"};
  2203. this.voidElements = lang.arrayToMap(voidElements);
  2204. this.getNextLineIndent = function(state, line, tab) {
  2205. return this.$getIndent(line);
  2206. };
  2207. this.checkOutdent = function(state, line, input) {
  2208. return false;
  2209. };
  2210. this.getCompletions = function(state, session, pos, prefix) {
  2211. return this.$completer.getCompletions(state, session, pos, prefix);
  2212. };
  2213. this.createWorker = function(session) {
  2214. if (this.constructor != Mode)
  2215. return;
  2216. var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
  2217. worker.attachToDocument(session.getDocument());
  2218. if (this.fragmentContext)
  2219. worker.call("setOptions", [{context: this.fragmentContext}]);
  2220. worker.on("error", function(e) {
  2221. session.setAnnotations(e.data);
  2222. });
  2223. worker.on("terminate", function() {
  2224. session.clearAnnotations();
  2225. });
  2226. return worker;
  2227. };
  2228. this.$id = "ace/mode/html";
  2229. this.snippetFileId = "ace/snippets/html";
  2230. }).call(Mode.prototype);
  2231. exports.Mode = Mode;
  2232. });
  2233. define("ace/mode/markdown_highlight_rules",["ace_require","exports","module","ace/config","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/html_highlight_rules"], function(ace_require, exports, module) {
  2234. "use strict";
  2235. var modes = ace_require("../config").$ace_modes;
  2236. var oop = ace_require("../lib/oop");
  2237. var lang = ace_require("../lib/lang");
  2238. var TextHighlightRules = ace_require("./text_highlight_rules").TextHighlightRules;
  2239. var HtmlHighlightRules = ace_require("./html_highlight_rules").HtmlHighlightRules;
  2240. var escaped = function(ch) {
  2241. return "(?:[^" + lang.escapeRegExp(ch) + "\\\\]|\\\\.)*";
  2242. };
  2243. var MarkdownHighlightRules = function() {
  2244. HtmlHighlightRules.call(this);
  2245. var codeBlockStartRule = {
  2246. token : "support.function",
  2247. regex : /^\s*(```+[^`]*|~~~+[^~]*)$/,
  2248. onMatch: function(value, state, stack, line) {
  2249. var m = value.match(/^(\s*)([`~]+)(.*)/);
  2250. var language = /[\w-]+|$/.exec(m[3])[0];
  2251. if (!modes[language])
  2252. language = "";
  2253. stack.unshift("githubblock", [], [m[1], m[2], language], state);
  2254. return this.token;
  2255. },
  2256. next : "githubblock"
  2257. };
  2258. var codeBlockRules = [{
  2259. token : "support.function",
  2260. regex : ".*",
  2261. onMatch: function(value, state, stack, line) {
  2262. var embedState = stack[1];
  2263. var indent = stack[2][0];
  2264. var endMarker = stack[2][1];
  2265. var language = stack[2][2];
  2266. var m = /^(\s*)(`+|~+)\s*$/.exec(value);
  2267. if (
  2268. m && m[1].length < indent.length + 3
  2269. && m[2].length >= endMarker.length && m[2][0] == endMarker[0]
  2270. ) {
  2271. stack.splice(0, 3);
  2272. this.next = stack.shift();
  2273. return this.token;
  2274. }
  2275. this.next = "";
  2276. if (language && modes[language]) {
  2277. var data = modes[language].getTokenizer().getLineTokens(value, embedState.slice(0));
  2278. stack[1] = data.state;
  2279. return data.tokens;
  2280. }
  2281. return this.token;
  2282. }
  2283. }];
  2284. this.$rules["start"].unshift({
  2285. token : "empty_line",
  2286. regex : '^$',
  2287. next: "allowBlock"
  2288. }, { // h1
  2289. token: "markup.heading.1",
  2290. regex: "^=+(?=\\s*$)"
  2291. }, { // h2
  2292. token: "markup.heading.2",
  2293. regex: "^\\-+(?=\\s*$)"
  2294. }, {
  2295. token : function(value) {
  2296. return "markup.heading." + value.length;
  2297. },
  2298. regex : /^#{1,6}(?=\s|$)/,
  2299. next : "header"
  2300. },
  2301. codeBlockStartRule,
  2302. { // block quote
  2303. token : "string.blockquote",
  2304. regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",
  2305. next : "blockquote"
  2306. }, { // HR * - _
  2307. token : "constant",
  2308. regex : "^ {0,3}(?:(?:\\* ?){3,}|(?:\\- ?){3,}|(?:\\_ ?){3,})\\s*$",
  2309. next: "allowBlock"
  2310. }, { // list
  2311. token : "markup.list",
  2312. regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
  2313. next : "listblock-start"
  2314. }, {
  2315. include : "basic"
  2316. });
  2317. this.addRules({
  2318. "basic" : [{
  2319. token : "constant.language.escape",
  2320. regex : /\\[\\`*_{}\[\]()#+\-.!]/
  2321. }, { // code span `
  2322. token : "support.function",
  2323. regex : "(`+)(.*?[^`])(\\1)"
  2324. }, { // reference
  2325. token : ["text", "constant", "text", "url", "string", "text"],
  2326. regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$"
  2327. }, { // link by reference
  2328. token : ["text", "string", "text", "constant", "text"],
  2329. regex : "(\\[)(" + escaped("]") + ")(\\]\\s*\\[)("+ escaped("]") + ")(\\])"
  2330. }, { // link by url
  2331. token : ["text", "string", "text", "markup.underline", "string", "text"],
  2332. regex : "(\\!?\\[)(" + // [
  2333. escaped("]") + // link text or alt text
  2334. ")(\\]\\()"+ // ](
  2335. '((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)' + // href or image
  2336. '(\\s*"' + escaped('"') + '"\\s*)?' + // "title"
  2337. "(\\))" // )
  2338. }, { // strong ** __
  2339. token : "string.strong",
  2340. regex : "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"
  2341. }, { // emphasis * _
  2342. token : "string.emphasis",
  2343. regex : "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"
  2344. }, { //
  2345. token : ["text", "url", "text"],
  2346. regex : "(<)("+
  2347. "(?:https?|ftp|dict):[^'\">\\s]+"+
  2348. "|"+
  2349. "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+
  2350. ")(>)"
  2351. }],
  2352. "allowBlock": [
  2353. {token : "support.function", regex : "^ {4}.+", next : "allowBlock"},
  2354. {token : "empty_line", regex : '^$', next: "allowBlock"},
  2355. {token : "empty", regex : "", next : "start"}
  2356. ],
  2357. "header" : [{
  2358. regex: "$",
  2359. next : "start"
  2360. }, {
  2361. include: "basic"
  2362. }, {
  2363. defaultToken : "heading"
  2364. } ],
  2365. "listblock-start" : [{
  2366. token : "support.variable",
  2367. regex : /(?:\[[ x]\])?/,
  2368. next : "listblock"
  2369. }],
  2370. "listblock" : [ { // Lists only escape on completely blank lines.
  2371. token : "empty_line",
  2372. regex : "^$",
  2373. next : "start"
  2374. }, { // list
  2375. token : "markup.list",
  2376. regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
  2377. next : "listblock-start"
  2378. }, {
  2379. include : "basic", noEscape: true
  2380. },
  2381. codeBlockStartRule,
  2382. {
  2383. defaultToken : "list" //do not use markup.list to allow stling leading `*` differntly
  2384. } ],
  2385. "blockquote" : [ { // Blockquotes only escape on blank lines.
  2386. token : "empty_line",
  2387. regex : "^\\s*$",
  2388. next : "start"
  2389. }, { // block quote
  2390. token : "string.blockquote",
  2391. regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",
  2392. next : "blockquote"
  2393. }, {
  2394. include : "basic", noEscape: true
  2395. }, {
  2396. defaultToken : "string.blockquote"
  2397. } ],
  2398. "githubblock" : codeBlockRules
  2399. });
  2400. this.normalizeRules();
  2401. };
  2402. oop.inherits(MarkdownHighlightRules, TextHighlightRules);
  2403. exports.MarkdownHighlightRules = MarkdownHighlightRules;
  2404. });
  2405. define("ace/mode/folding/markdown",["ace_require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(ace_require, exports, module) {
  2406. "use strict";
  2407. var oop = ace_require("../../lib/oop");
  2408. var BaseFoldMode = ace_require("./fold_mode").FoldMode;
  2409. var Range = ace_require("../../range").Range;
  2410. var FoldMode = exports.FoldMode = function() {};
  2411. oop.inherits(FoldMode, BaseFoldMode);
  2412. (function() {
  2413. this.foldingStartMarker = /^(?:[=-]+\s*$|#{1,6} |`{3})/;
  2414. this.getFoldWidget = function(session, foldStyle, row) {
  2415. var line = session.getLine(row);
  2416. if (!this.foldingStartMarker.test(line))
  2417. return "";
  2418. if (line[0] == "`") {
  2419. if (session.bgTokenizer.getState(row) == "start")
  2420. return "end";
  2421. return "start";
  2422. }
  2423. return "start";
  2424. };
  2425. this.getFoldWidgetRange = function(session, foldStyle, row) {
  2426. var line = session.getLine(row);
  2427. var startColumn = line.length;
  2428. var maxRow = session.getLength();
  2429. var startRow = row;
  2430. var endRow = row;
  2431. if (!line.match(this.foldingStartMarker))
  2432. return;
  2433. if (line[0] == "`") {
  2434. if (session.bgTokenizer.getState(row) !== "start") {
  2435. while (++row < maxRow) {
  2436. line = session.getLine(row);
  2437. if (line[0] == "`" & line.substring(0, 3) == "```")
  2438. break;
  2439. }
  2440. return new Range(startRow, startColumn, row, 0);
  2441. } else {
  2442. while (row -- > 0) {
  2443. line = session.getLine(row);
  2444. if (line[0] == "`" & line.substring(0, 3) == "```")
  2445. break;
  2446. }
  2447. return new Range(row, line.length, startRow, 0);
  2448. }
  2449. }
  2450. var token;
  2451. function isHeading(row) {
  2452. token = session.getTokens(row)[0];
  2453. return token && token.type.lastIndexOf(heading, 0) === 0;
  2454. }
  2455. var heading = "markup.heading";
  2456. function getLevel() {
  2457. var ch = token.value[0];
  2458. if (ch == "=") return 6;
  2459. if (ch == "-") return 5;
  2460. return 7 - token.value.search(/[^#]|$/);
  2461. }
  2462. if (isHeading(row)) {
  2463. var startHeadingLevel = getLevel();
  2464. while (++row < maxRow) {
  2465. if (!isHeading(row))
  2466. continue;
  2467. var level = getLevel();
  2468. if (level >= startHeadingLevel)
  2469. break;
  2470. }
  2471. endRow = row - (!token || ["=", "-"].indexOf(token.value[0]) == -1 ? 1 : 2);
  2472. if (endRow > startRow) {
  2473. while (endRow > startRow && /^\s*$/.test(session.getLine(endRow)))
  2474. endRow--;
  2475. }
  2476. if (endRow > startRow) {
  2477. var endColumn = session.getLine(endRow).length;
  2478. return new Range(startRow, startColumn, endRow, endColumn);
  2479. }
  2480. }
  2481. };
  2482. }).call(FoldMode.prototype);
  2483. });
  2484. define("ace/mode/sh_highlight_rules",["ace_require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(ace_require, exports, module) {
  2485. "use strict";
  2486. var oop = ace_require("../lib/oop");
  2487. var TextHighlightRules = ace_require("./text_highlight_rules").TextHighlightRules;
  2488. var reservedKeywords = exports.reservedKeywords = (
  2489. '!|{|}|case|do|done|elif|else|'+
  2490. 'esac|fi|for|if|in|then|until|while|'+
  2491. '&|;|export|local|read|typeset|unset|'+
  2492. 'elif|select|set|function|declare|readonly'
  2493. );
  2494. var languageConstructs = exports.languageConstructs = (
  2495. '[|]|alias|bg|bind|break|builtin|'+
  2496. 'cd|command|compgen|complete|continue|'+
  2497. 'dirs|disown|echo|enable|eval|exec|'+
  2498. 'exit|fc|fg|getopts|hash|help|history|'+
  2499. 'jobs|kill|let|logout|popd|printf|pushd|'+
  2500. 'pwd|return|set|shift|shopt|source|'+
  2501. 'suspend|test|times|trap|type|ulimit|'+
  2502. 'umask|unalias|wait'
  2503. );
  2504. var ShHighlightRules = function() {
  2505. var keywordMapper = this.createKeywordMapper({
  2506. "keyword": reservedKeywords,
  2507. "support.function.builtin": languageConstructs,
  2508. "invalid.deprecated": "debugger"
  2509. }, "identifier");
  2510. var integer = "(?:(?:[1-9]\\d*)|(?:0))";
  2511. var fraction = "(?:\\.\\d+)";
  2512. var intPart = "(?:\\d+)";
  2513. var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
  2514. var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + ")";
  2515. var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
  2516. var fileDescriptor = "(?:&" + intPart + ")";
  2517. var variableName = "[a-zA-Z_][a-zA-Z0-9_]*";
  2518. var variable = "(?:" + variableName + "(?==))";
  2519. var builtinVariable = "(?:\\$(?:SHLVL|\\$|\\!|\\?))";
  2520. var func = "(?:" + variableName + "\\s*\\(\\))";
  2521. this.$rules = {
  2522. "start" : [{
  2523. token : "constant",
  2524. regex : /\\./
  2525. }, {
  2526. token : ["text", "comment"],
  2527. regex : /(^|\s)(#.*)$/
  2528. }, {
  2529. token : "string.start",
  2530. regex : '"',
  2531. push : [{
  2532. token : "constant.language.escape",
  2533. regex : /\\(?:[$`"\\]|$)/
  2534. }, {
  2535. include : "variables"
  2536. }, {
  2537. token : "keyword.operator",
  2538. regex : /`/ // TODO highlight `
  2539. }, {
  2540. token : "string.end",
  2541. regex : '"',
  2542. next: "pop"
  2543. }, {
  2544. defaultToken: "string"
  2545. }]
  2546. }, {
  2547. token : "string",
  2548. regex : "\\$'",
  2549. push : [{
  2550. token : "constant.language.escape",
  2551. regex : /\\(?:[abeEfnrtv\\'"]|x[a-fA-F\d]{1,2}|u[a-fA-F\d]{4}([a-fA-F\d]{4})?|c.|\d{1,3})/
  2552. }, {
  2553. token : "string",
  2554. regex : "'",
  2555. next: "pop"
  2556. }, {
  2557. defaultToken: "string"
  2558. }]
  2559. }, {
  2560. regex : "<<<",
  2561. token : "keyword.operator"
  2562. }, {
  2563. stateName: "heredoc",
  2564. regex : "(<<-?)(\\s*)(['\"`]?)([\\w\\-]+)(['\"`]?)",
  2565. onMatch : function(value, currentState, stack) {
  2566. var next = value[2] == '-' ? "indentedHeredoc" : "heredoc";
  2567. var tokens = value.split(this.splitRegex);
  2568. stack.push(next, tokens[4]);
  2569. return [
  2570. {type:"constant", value: tokens[1]},
  2571. {type:"text", value: tokens[2]},
  2572. {type:"string", value: tokens[3]},
  2573. {type:"support.class", value: tokens[4]},
  2574. {type:"string", value: tokens[5]}
  2575. ];
  2576. },
  2577. rules: {
  2578. heredoc: [{
  2579. onMatch: function(value, currentState, stack) {
  2580. if (value === stack[1]) {
  2581. stack.shift();
  2582. stack.shift();
  2583. this.next = stack[0] || "start";
  2584. return "support.class";
  2585. }
  2586. this.next = "";
  2587. return "string";
  2588. },
  2589. regex: ".*$",
  2590. next: "start"
  2591. }],
  2592. indentedHeredoc: [{
  2593. token: "string",
  2594. regex: "^\t+"
  2595. }, {
  2596. onMatch: function(value, currentState, stack) {
  2597. if (value === stack[1]) {
  2598. stack.shift();
  2599. stack.shift();
  2600. this.next = stack[0] || "start";
  2601. return "support.class";
  2602. }
  2603. this.next = "";
  2604. return "string";
  2605. },
  2606. regex: ".*$",
  2607. next: "start"
  2608. }]
  2609. }
  2610. }, {
  2611. regex : "$",
  2612. token : "empty",
  2613. next : function(currentState, stack) {
  2614. if (stack[0] === "heredoc" || stack[0] === "indentedHeredoc")
  2615. return stack[0];
  2616. return currentState;
  2617. }
  2618. }, {
  2619. token : ["keyword", "text", "text", "text", "variable"],
  2620. regex : /(declare|local|readonly)(\s+)(?:(-[fixar]+)(\s+))?([a-zA-Z_][a-zA-Z0-9_]*\b)/
  2621. }, {
  2622. token : "variable.language",
  2623. regex : builtinVariable
  2624. }, {
  2625. token : "variable",
  2626. regex : variable
  2627. }, {
  2628. include : "variables"
  2629. }, {
  2630. token : "support.function",
  2631. regex : func
  2632. }, {
  2633. token : "support.function",
  2634. regex : fileDescriptor
  2635. }, {
  2636. token : "string", // ' string
  2637. start : "'", end : "'"
  2638. }, {
  2639. token : "constant.numeric", // float
  2640. regex : floatNumber
  2641. }, {
  2642. token : "constant.numeric", // integer
  2643. regex : integer + "\\b"
  2644. }, {
  2645. token : keywordMapper,
  2646. regex : "[a-zA-Z_][a-zA-Z0-9_]*\\b"
  2647. }, {
  2648. token : "keyword.operator",
  2649. regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|~|<|>|<=|=>|=|!=|[%&|`]"
  2650. }, {
  2651. token : "punctuation.operator",
  2652. regex : ";"
  2653. }, {
  2654. token : "paren.lparen",
  2655. regex : "[\\[\\(\\{]"
  2656. }, {
  2657. token : "paren.rparen",
  2658. regex : "[\\]]"
  2659. }, {
  2660. token : "paren.rparen",
  2661. regex : "[\\)\\}]",
  2662. next : "pop"
  2663. }],
  2664. variables: [{
  2665. token : "variable",
  2666. regex : /(\$)(\w+)/
  2667. }, {
  2668. token : ["variable", "paren.lparen"],
  2669. regex : /(\$)(\()/,
  2670. push : "start"
  2671. }, {
  2672. token : ["variable", "paren.lparen", "keyword.operator", "variable", "keyword.operator"],
  2673. regex : /(\$)(\{)([#!]?)(\w+|[*@#?\-$!0_])(:[?+\-=]?|##?|%%?|,,?\/|\^\^?)?/,
  2674. push : "start"
  2675. }, {
  2676. token : "variable",
  2677. regex : /\$[*@#?\-$!0_]/
  2678. }, {
  2679. token : ["variable", "paren.lparen"],
  2680. regex : /(\$)(\{)/,
  2681. push : "start"
  2682. }]
  2683. };
  2684. this.normalizeRules();
  2685. };
  2686. oop.inherits(ShHighlightRules, TextHighlightRules);
  2687. exports.ShHighlightRules = ShHighlightRules;
  2688. });
  2689. define("ace/mode/sh",["ace_require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sh_highlight_rules","ace/range","ace/mode/folding/cstyle","ace/mode/behaviour/cstyle"], function(ace_require, exports, module) {
  2690. "use strict";
  2691. var oop = ace_require("../lib/oop");
  2692. var TextMode = ace_require("./text").Mode;
  2693. var ShHighlightRules = ace_require("./sh_highlight_rules").ShHighlightRules;
  2694. var Range = ace_require("../range").Range;
  2695. var CStyleFoldMode = ace_require("./folding/cstyle").FoldMode;
  2696. var CstyleBehaviour = ace_require("./behaviour/cstyle").CstyleBehaviour;
  2697. var Mode = function() {
  2698. this.HighlightRules = ShHighlightRules;
  2699. this.foldingRules = new CStyleFoldMode();
  2700. this.$behaviour = new CstyleBehaviour();
  2701. };
  2702. oop.inherits(Mode, TextMode);
  2703. (function() {
  2704. this.lineCommentStart = "#";
  2705. this.getNextLineIndent = function(state, line, tab) {
  2706. var indent = this.$getIndent(line);
  2707. var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
  2708. var tokens = tokenizedLine.tokens;
  2709. if (tokens.length && tokens[tokens.length-1].type == "comment") {
  2710. return indent;
  2711. }
  2712. if (state == "start") {
  2713. var match = line.match(/^.*[\{\(\[:]\s*$/);
  2714. if (match) {
  2715. indent += tab;
  2716. }
  2717. }
  2718. return indent;
  2719. };
  2720. var outdents = {
  2721. "pass": 1,
  2722. "return": 1,
  2723. "raise": 1,
  2724. "break": 1,
  2725. "continue": 1
  2726. };
  2727. this.checkOutdent = function(state, line, input) {
  2728. if (input !== "\r\n" && input !== "\r" && input !== "\n")
  2729. return false;
  2730. var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
  2731. if (!tokens)
  2732. return false;
  2733. do {
  2734. var last = tokens.pop();
  2735. } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
  2736. if (!last)
  2737. return false;
  2738. return (last.type == "keyword" && outdents[last.value]);
  2739. };
  2740. this.autoOutdent = function(state, doc, row) {
  2741. row += 1;
  2742. var indent = this.$getIndent(doc.getLine(row));
  2743. var tab = doc.getTabString();
  2744. if (indent.slice(-tab.length) == tab)
  2745. doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
  2746. };
  2747. this.$id = "ace/mode/sh";
  2748. this.snippetFileId = "ace/snippets/sh";
  2749. }).call(Mode.prototype);
  2750. exports.Mode = Mode;
  2751. });
  2752. define("ace/mode/markdown",["ace_require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/html","ace/mode/markdown_highlight_rules","ace/mode/folding/markdown","ace/mode/javascript","ace/mode/html","ace/mode/sh","ace/mode/sh","ace/mode/xml","ace/mode/css"], function(ace_require, exports, module) {
  2753. "use strict";
  2754. var oop = ace_require("../lib/oop");
  2755. var TextMode = ace_require("./text").Mode;
  2756. var JavaScriptMode = ace_require("./javascript").Mode;
  2757. var XmlMode = ace_require("./xml").Mode;
  2758. var HtmlMode = ace_require("./html").Mode;
  2759. var MarkdownHighlightRules = ace_require("./markdown_highlight_rules").MarkdownHighlightRules;
  2760. var MarkdownFoldMode = ace_require("./folding/markdown").FoldMode;
  2761. var Mode = function() {
  2762. this.HighlightRules = MarkdownHighlightRules;
  2763. this.createModeDelegates({
  2764. javascript: ace_require("./javascript").Mode,
  2765. html: ace_require("./html").Mode,
  2766. bash: ace_require("./sh").Mode,
  2767. sh: ace_require("./sh").Mode,
  2768. xml: ace_require("./xml").Mode,
  2769. css: ace_require("./css").Mode
  2770. });
  2771. this.foldingRules = new MarkdownFoldMode();
  2772. this.$behaviour = this.$defaultBehaviour;
  2773. };
  2774. oop.inherits(Mode, TextMode);
  2775. (function() {
  2776. this.type = "text";
  2777. this.blockComment = {start: "<!--", end: "-->"};
  2778. this.$quotes = {'"': '"', "`": "`"};
  2779. this.getNextLineIndent = function(state, line, tab) {
  2780. if (state == "listblock") {
  2781. var match = /^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(line);
  2782. if (!match)
  2783. return "";
  2784. var marker = match[2];
  2785. if (!marker)
  2786. marker = parseInt(match[3], 10) + 1 + ".";
  2787. return match[1] + marker + match[4];
  2788. } else {
  2789. return this.$getIndent(line);
  2790. }
  2791. };
  2792. this.$id = "ace/mode/markdown";
  2793. this.snippetFileId = "ace/snippets/markdown";
  2794. }).call(Mode.prototype);
  2795. exports.Mode = Mode;
  2796. }); (function() {
  2797. window.ace_require(["ace/mode/markdown"], function(m) {
  2798. if (typeof module == "object" && typeof exports == "object" && module) {
  2799. module.exports = m;
  2800. }
  2801. });
  2802. })();