From 7e195ec5bc27b0b21c4d1f04402ae14bdaf99cf5 Mon Sep 17 00:00:00 2001 From: Gk0Wk Date: Fri, 27 Aug 2021 01:59:32 +0800 Subject: [PATCH] Some bug fix. --- build.json | 8 ++++---- src/readme-zh.tw5 | 17 ----------------- src/readme.tw5 | 5 +++++ src/style.css | 2 +- src/style.min.css | 2 +- src/tw5-autohint.js | 26 +++++++++++++------------- src/tw5-autohint.min.js | 2 +- src/tw5-mode.js | 6 +++--- src/tw5-mode.min.js | 2 +- 9 files changed, 29 insertions(+), 41 deletions(-) delete mode 100644 src/readme-zh.tw5 create mode 100644 src/readme.tw5 diff --git a/build.json b/build.json index c039645..6dd0946 100644 --- a/build.json +++ b/build.json @@ -1,12 +1,12 @@ { "meta": { - "version": "0.0.2", + "version": "0.0.3", "type": "application/json", "title": "$:/plugins/Gk0Wk/codemirror-mode-tiddlywiki5", "plugin-type": "plugin", "parent-plugin": "$:/plugins/tiddlywiki/codemirror", "name": "CodeMirror Mode TiddlyWiki5", - "list": "readme-zh", + "list": "readme", "description": "TiddlyWiki5 highlighting mode for CodeMirror", "dependents": "$:/plugins/tiddlywiki/codemirror-mode-xml" }, @@ -41,10 +41,10 @@ }, { "type": "external", - "src": "./src/readme-zh.tw5", + "src": "./src/readme.tw5", "meta": { "type": "", - "title": "$:/plugins/Gk0Wk/codemirror-mode-tiddlywiki5/readme-zh", + "title": "$:/plugins/Gk0Wk/codemirror-mode-tiddlywiki5/readme", "tags": "" } }, diff --git a/src/readme-zh.tw5 b/src/readme-zh.tw5 deleted file mode 100644 index 3e9763e..0000000 --- a/src/readme-zh.tw5 +++ /dev/null @@ -1,17 +0,0 @@ -[[GitHub Repo|https://github.com/Gk0Wk/CodeMirror-Mode-TiddlyWiki5]] - -!! 插件说明 - -增加 [[CodeMirror|http://codemirror.net]] 对~TiddlyWiki5语法高亮的支持,所有类型留空或者为`text/vnd.tiddlywiki`的tiddler都会有高亮。请首先安装最新版[[CodeMirror plugin|$:/plugins/tiddlywiki/codemirror]]主插件和~CodeMirror XML附插件(不然会报错)。 - -插件还在开发中,如有任何建议或者bug请在[[GitHub|https://github.com/Gk0Wk/CodeMirror-Mode-TiddlyWiki5]]上提Issue,如果墙翻不过去的同学,可以联系我(Email: nmg_wk@yeah.net)。 - -如果插件报错了,不必惊慌,因为插件不会对~TiddlyWiki本体内容做修改,所以只需要卸载就能够消除问题,但保险起见''__还是建议先备份再安装__''。 - -!! 开发感想 - -在使用~TiddlyWiki之后,一直苦于~TiddlyWiki5语法没有高亮支持,写作体验不是很好。之前有也在网上找到一些相关的解决办法,例如在[[Google Group|https://groups.google.com/g/tiddlywiki/c/c3y-PycRP4M]]上面有人建议[[用TiddlyWiki2的语法进行Hack|https://www.gitmemory.com/issue/Jermolene/TiddlyWiki5/3685/770313436]]。 - -也有人编写了一个可用的~CodeMirror的扩展版本[[TW5-CodeMirror-Plus|https://github.com/adithya-badidey/TW5-codemirror-plus]],虽然是可用的,但是有两个问题:一个是语法高亮的内容有限,另一个是该插件直接基于theme而非mode进行开发,这就导致''如果想要用TW5的高亮就必须舍弃其他语法高亮,并且无法自定义主题''。所以最终还是打算自己写一个XD - -本插件其实也是基于[[TW5-CodeMirror-Plus|https://github.com/adithya-badidey/TW5-codemirror-plus]]开发的,只不过魔改了很多,基本上是两个插件了。 diff --git a/src/readme.tw5 b/src/readme.tw5 new file mode 100644 index 0000000..ce4dcda --- /dev/null +++ b/src/readme.tw5 @@ -0,0 +1,5 @@ +View more on [[GitHub Repo|https://github.com/Gk0Wk/CodeMirror-Mode-TiddlyWiki5]]. + +Adds Syntax Highlighting for TiddlyWiki5 tiddlers (`text/vnd.tiddlywiki`) to the CodeMirror, along with some other useful editor addon (wikilink hint, macro hint, etc.). Now is under development. + +为TiddlyWiki的CodeMirror编辑器添加TiddlyWiki5(`text/vnd.tiddlywiki`)语法高亮,同时还有其他有用的编辑器插件(如Wiki链接自动提示、宏提示等)。现在正在开发中。 diff --git a/src/style.css b/src/style.css index 53090ac..378c643 100644 --- a/src/style.css +++ b/src/style.css @@ -1,6 +1,6 @@ .CodeMirror-hints { /* 以免提示框被压在tiddler下面 */ - z-index: 999999999999 !important; + z-index: 200 !important; } span.cm-underlined { diff --git a/src/style.min.css b/src/style.min.css index e43606e..26838e3 100644 --- a/src/style.min.css +++ b/src/style.min.css @@ -1 +1 @@ -.CodeMirror-hints{z-index:999999999999!important}span.cm-underlined{text-decoration-line:underline}span.cm-superscript{vertical-align:super;font-size:.7em;line-height:.1em}span.cm-subscript{font-size:.7em;line-height:.5}span.cm-quote{font-style:italic;padding-left:.6em;border-left:#444 solid .2em}span.cm-h1{font-weight:700;font-size:1.383em;line-height:1.802em}span.cm-h2{font-weight:600;font-size:1.296em;line-height:1.602em}span.cm-h3{font-weight:500;font-size:1.215em;line-height:1.424em}span.cm-h4{font-weight:400;font-size:1.138em;line-height:1.266em}span.cm-h5{font-weight:400;font-size:1.067em;line-height:1.125em}span.cm-h6{font-weight:400}span.link{font-weight:600}span.cm-internallink{text-decoration:none} \ No newline at end of file +.CodeMirror-hints{z-index:200!important}span.cm-underlined{text-decoration-line:underline}span.cm-superscript{vertical-align:super;font-size:.7em;line-height:.1em}span.cm-subscript{font-size:.7em;line-height:.5}span.cm-quote{font-style:italic;padding-left:.6em;border-left:#444 solid .2em}span.cm-h1{font-weight:700;font-size:1.383em;line-height:1.802em}span.cm-h2{font-weight:600;font-size:1.296em;line-height:1.602em}span.cm-h3{font-weight:500;font-size:1.215em;line-height:1.424em}span.cm-h4{font-weight:400;font-size:1.138em;line-height:1.266em}span.cm-h5{font-weight:400;font-size:1.067em;line-height:1.125em}span.cm-h6{font-weight:400}span.link{font-weight:600}span.cm-internallink{text-decoration:none} \ No newline at end of file diff --git a/src/tw5-autohint.js b/src/tw5-autohint.js index 43c48ae..2352085 100644 --- a/src/tw5-autohint.js +++ b/src/tw5-autohint.js @@ -1,7 +1,7 @@ (function(mod) { - if (typeof exports == "object" && typeof module == "object") // CommonJS + if (typeof exports === "object" && typeof module === "object") // CommonJS mod(require("../../lib/codemirror")); - else if (typeof define == "function" && define.amd) // AMD + else if (typeof define === "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); @@ -9,15 +9,15 @@ "use strict"; // 有新的editor实例创建,就Hook一下,达到实时提示的效果 - CodeMirror.defineInitHook(editor => { + CodeMirror.defineInitHook(function (editor) { // 如果补全建议中只有一个,不会自动补全,否则体验会非常糟糕 editor.options.hintOptions = { completeSingle: false }; // 当光标移动(输入、删除、光标移动)时进行补全 - editor.on("cursorActivity", () => { - if (!editor.state.completeActive) { - editor.showHint(); + editor.on("change", function (cm, event) { + if (!cm.state.completeActive && typeof cm.showHint === 'function') { + cm.showHint(); } }); }); @@ -32,12 +32,12 @@ // wikilin匹配 // 向前找,找到[{|"为止,而如果找到]}.>或者到头,就不要继续找 - var escapeChars = ['.', ']', '}', '>'] - var stopChars = ['[', '{', '|', '"'] + var escapeChars = ['.', ']', '}', '>']; + var stopChars = ['[', '{', '|', '"']; while (pointer) { - var ch = curLine.charAt(pointer - 1) + var ch = curLine.charAt(pointer - 1); if (end - pointer > max_length || escapeChars.includes(ch)) { - return null + return null; } if (!(stopChars.includes(ch))) { pointer--; @@ -52,13 +52,13 @@ list: $tw.wiki.filterTiddlers(`[all[tiddlers]search:title:literal[${curWord}]!prefix[$:/state]]`), from: CodeMirror.Pos(cur.line, pointer), to: CodeMirror.Pos(cur.line, end) - } + }; } else { return { list: $tw.wiki.filterTiddlers(`[all[tiddlers]!is[system]!is[shadow]search:title:literal[${curWord}]!prefix[$:/state]]`), from: CodeMirror.Pos(cur.line, pointer), to: CodeMirror.Pos(cur.line, end) - } + }; } - }) + }); }); diff --git a/src/tw5-autohint.min.js b/src/tw5-autohint.min.js index 2f76d35..a6de9ef 100644 --- a/src/tw5-autohint.min.js +++ b/src/tw5-autohint.min.js @@ -1 +1 @@ -(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";e.defineInitHook(e=>{e.options.hintOptions={completeSingle:!1},e.on("cursorActivity",()=>{e.state.completeActive||e.showHint()})}),e.registerHelper("hint","tiddlywiki5",function(i){for(var t=i.getCursor(),r=i.getLine(t.line),l=t.ch,o=t.ch,n=30,s=[".","]","}",">"],c=["[","{","|",'"'];l;){var d=r.charAt(l-1);if(o-l>n||s.includes(d))return null;if(c.includes(d))break;l--}if(0==l)return null;var f=l!==o&&r.slice(l,o);return"$"==r.charAt(l)?{list:$tw.wiki.filterTiddlers(`[all[tiddlers]search:title:literal[${f}]!prefix[$:/state]]`),from:e.Pos(t.line,l),to:e.Pos(t.line,o)}:{list:$tw.wiki.filterTiddlers(`[all[tiddlers]!is[system]!is[shadow]search:title:literal[${f}]!prefix[$:/state]]`),from:e.Pos(t.line,l),to:e.Pos(t.line,o)}})}); \ No newline at end of file +(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)})(function(e){"use strict";e.defineInitHook(function(e){e.options.hintOptions={completeSingle:!1},e.on("change",function(e,i){e.state.completeActive||"function"!=typeof e.showHint||e.showHint()})}),e.registerHelper("hint","tiddlywiki5",function(i){for(var t=i.getCursor(),r=i.getLine(t.line),o=t.ch,n=t.ch,l=30,s=[".","]","}",">"],c=["[","{","|",'"'];o;){var f=r.charAt(o-1);if(n-o>l||s.includes(f))return null;if(c.includes(f))break;o--}if(0==o)return null;var d=o!==n&&r.slice(o,n);return"$"==r.charAt(o)?{list:$tw.wiki.filterTiddlers(`[all[tiddlers]search:title:literal[${d}]!prefix[$:/state]]`),from:e.Pos(t.line,o),to:e.Pos(t.line,n)}:{list:$tw.wiki.filterTiddlers(`[all[tiddlers]!is[system]!is[shadow]search:title:literal[${d}]!prefix[$:/state]]`),from:e.Pos(t.line,o),to:e.Pos(t.line,n)}})}); \ No newline at end of file diff --git a/src/tw5-mode.js b/src/tw5-mode.js index 7c0d336..b0b03a2 100644 --- a/src/tw5-mode.js +++ b/src/tw5-mode.js @@ -1,9 +1,9 @@ /* Enhance from and specially thank to https://github.com/adithya-badidey/TW5-codemirror-plus */ (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS - mod(require("../../lib/codemirror"), require("../xml/xml")); + mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD - define(["../../lib/codemirror", "../xml/xml"], mod); + define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { @@ -539,7 +539,7 @@ }, }; return mode; - }, "xml"); + }); CodeMirror.defineMIME("text/vnd.tiddlywiki", "tiddlywiki5"); CodeMirror.defineMIME("", "tiddlywiki5"); diff --git a/src/tw5-mode.min.js b/src/tw5-mode.min.js index 176f71f..e460bba 100644 --- a/src/tw5-mode.min.js +++ b/src/tw5-mode.min.js @@ -1 +1 @@ -(function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml"],e):e(CodeMirror)})(function(e){"use strict";e.defineMode("tiddlywiki5",function(t,o){function n(o){if(e.findModeByName){var n=e.findModeByName(o);n&&(o=n.mime||n.mimes[0])}var i=e.getMode(t,o);return"null"==i.name?null:i}function i(e,t,o){return t.tokenize=o,o(e,t)}function r(e){e.line++,e.listLevel=0,e.boldLine=!1}function a(e,t){var o=e.sol(),n=l(o,e,t);return null==n&&(n=""),t.quoteLevel>0&&o&&(n+=" quote quote-"+t.quoteLevel),null!=t.codeBlockModeState&&(n+=" comment"),t.listLevel>0&&(n+=" list "+h.rainbow[t.listLevel%h.rainbow.length]),t.boldLine&&(n+=" strong"),n}function l(e,t,o){var n=t.peek();if(e&&/[<\/\*{}\-`]/.test(n)){if(t.match(B))return S(t,o);if(t.match(L))return"hr";var r=null;if(r=t.match(y,!1))return b(t,o,r)}var a=null;if(e&&(a=t.match(/^\s*([\/\*!#;:>|])/))){if(n=a[1],"!"===n){for(var l=1;t.eat("!");)l++;return t.skipToEnd(),"header h"+l}if(/[\*#;:]/.test(n)){l=1;for(var x=n;n=t.eat(/[\*#;:]/);)l++,x=n;return o.boldLine=";"===x,o.listLevel=l,"list "+h.rainbow[l%h.rainbow.length]+(";"===x?" strong":"")}if(">"===n)return t.eatWhile(">"),"quote";if("|"===n)return"header"}return t.next(),/[hf]/i.test(n)&&/[ti]/i.test(t.peek())&&t.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i,!0)?"externallink link":"$"==n&&t.match("$",!1)&&!t.match("$$",!1)?(t.next(),p(t,o)):"`"==n?i(t,o,c):"/"==n&&t.eat("/")?i(t,o,u):"{"==n&&t.eat("{")?i(t,o,f):"["==n&&t.eat("[")?i(t,o,k):"_"==n&&t.eat("_")?i(t,o,s):"^"==n&&t.eat("^")?i(t,o,v):","==n&&t.eat(",")?i(t,o,m):"~"==n&&t.eat("~")?i(t,o,M):"'"==n&&t.eat("'")?i(t,o,d):"<"==n&&t.eat("<")?i(t,o,g):null}function d(e,t){for(var o,n=!1;o=e.next();){if("'"==o&&n){t.tokenize=a;break}n="'"==o}return"strong"}function c(e,t){for(var o;o=e.next();)if("`"==o){t.tokenize=a;break}return"comment"}function u(e,t){for(var o,n=!1;o=e.next();){if("/"==o&&n){t.tokenize=a;break}n="/"==o}return"em"}function f(e,t){for(var o,n=!1;o=e.next();){if("}"==o&&n){t.tokenize=a;break}n="}"==o}return"builtin"}function k(e,t){if("[["==e.current())return t.pastDivider=!1,"link";if("]"==e.peek()&&(e.next(),"]"==e.next()))return t.tokenize=a,"link";for(var o,n=t.pastDivider;o=e.peek();){if(!n&&"|"==o)return e.next(),t.pastDivider=!0,"internallink link";if("]"==o&&"]"==e.peek())return"internallink link";if(o=e.next(),/[hf]/i.test(o)&&/[ti]/i.test(e.peek())&&e.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i,!0))return"externallink link";e.eatWhile(/[^|\]]/)}return null}function s(e,t){for(var o,n=!1;o=e.next();){if("_"==o&&n){t.tokenize=a;break}n="_"==o}return"underlined"}function m(e,t){for(var o,n=!1;o=e.next();){if(","==o&&n){t.tokenize=a;break}n=","==o}return"string subscript"}function v(e,t){for(var o,n=!1;o=e.next();){if("^"==o&&n){t.tokenize=a;break}n="^"==o}return"string superscript"}function M(e,t){for(var o,n=!1;o=e.next();){if("~"==o&&n){t.tokenize=a;break}n="~"==o}return"strikethrough"}function p(t,i){i.tokenize=a;var r=o.fencedCodeBlockHighlighting&&n("text/x-latex");return i.LaTeXModeState=r?{mode:r,state:e.startState(r)}:"unknown","comment"}function b(t,i,r){return i.tokenize=function(t,i){i.tokenize=a;var l=o.fencedCodeBlockHighlighting&&n(r[1]||o.fencedCodeBlockDefaultMode);return i.codeBlockModeState=l?{mode:l,state:e.startState(l)}:"unknown",r[1]?(t.skipToEnd(),"tag"):null},t.match("```"),"comment"}function S(e,t){for(var o=1;e.match(B);)o++;return t.quoteLevel==o?(t.quoteLevel--,"quote"):t.quoteLevel"==o&&">"==e.peek()?(e.next(),t.tokenize=a,"macro"):(e.eatWhile(/[\w\$_]/),x.propertyIsEnumerable(e.current())?"keyword":"macro"):(t.tokenize=a,null)}var h={rainbow:["keyword","variable-2","variable-3"]},x={changecount:!0,colour:!0,"colour-picker":!0,contrastcolour:!0,"copy-to-clipboard":!0,csvtiddlers:!0,datauri:!0,dumpvariables:!0,"image-picker":!0,jsontiddler:!0,jsontiddlers:!0,lingo:!0,"list-links":!0,"list-links-draggable":!0,"list-tagged-draggable":!0,"list-thumbnails":!0,makedatauri:!0,now:!0,qualify:!0,resolvepath:!0,"box-shadow":!0,filter:!0,transition:!0,"background-linear-gradient":!0,"transform-origin":!0,toc:!0,"toc-expandable":!0,"toc-selective-expandable":!0,"toc-tabbed-internal-nav":!0,"toc-tabbed-external-nav":!0,tabs:!0,tag:!0,"tag-picker":!0,"tag-pill":!0,thumbnail:!0,timeline:!0,tree:!0,unusedtitle:!0,version:!0};void 0===o.fencedCodeBlockHighlighting&&(o.fencedCodeBlockHighlighting=!0),void 0===o.fencedCodeBlockDefaultMode&&(o.fencedCodeBlockDefaultMode="text/plain");var L=/^\-\-\-+$/,B=/^<<0&&o&&(n+=" quote quote-"+t.quoteLevel),null!=t.codeBlockModeState&&(n+=" comment"),t.listLevel>0&&(n+=" list "+h.rainbow[t.listLevel%h.rainbow.length]),t.boldLine&&(n+=" strong"),n}function l(e,t,o){var n=t.peek();if(e&&/[<\/\*{}\-`]/.test(n)){if(t.match(x))return S(t,o);if(t.match(B))return"hr";var r=null;if(r=t.match(y,!1))return b(t,o,r)}var a=null;if(e&&(a=t.match(/^\s*([\/\*!#;:>|])/))){if(n=a[1],"!"===n){for(var l=1;t.eat("!");)l++;return t.skipToEnd(),"header h"+l}if(/[\*#;:]/.test(n)){for(var L=1,T=n;n=t.eat(/[\*#;:]/);)L++,T=n;return o.boldLine=";"===T,o.listLevel=L,"list "+h.rainbow[L%h.rainbow.length]+(";"===T?" strong":"")}if(">"===n)return t.eatWhile(">"),"quote";if("|"===n)return"header"}return t.next(),/[hf]/i.test(n)&&/[ti]/i.test(t.peek())&&t.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i,!0)?"externallink link":"$"==n&&t.match("$",!1)&&!t.match("$$",!1)?(t.next(),p(t,o)):"`"==n?i(t,o,c):"/"==n&&t.eat("/")?i(t,o,u):"{"==n&&t.eat("{")?i(t,o,f):"["==n&&t.eat("[")?i(t,o,k):"_"==n&&t.eat("_")?i(t,o,s):"^"==n&&t.eat("^")?i(t,o,v):","==n&&t.eat(",")?i(t,o,m):"~"==n&&t.eat("~")?i(t,o,M):"'"==n&&t.eat("'")?i(t,o,d):"<"==n&&t.eat("<")?i(t,o,g):null}function d(e,t){for(var o,n=!1;o=e.next();){if("'"==o&&n){t.tokenize=a;break}n="'"==o}return"strong"}function c(e,t){for(var o;o=e.next();)if("`"==o){t.tokenize=a;break}return"comment"}function u(e,t){for(var o,n=!1;o=e.next();){if("/"==o&&n){t.tokenize=a;break}n="/"==o}return"em"}function f(e,t){for(var o,n=!1;o=e.next();){if("}"==o&&n){t.tokenize=a;break}n="}"==o}return"builtin"}function k(e,t){if("[["==e.current())return t.pastDivider=!1,"link";if("]"==e.peek()&&(e.next(),"]"==e.next()))return t.tokenize=a,"link";for(var o,n=t.pastDivider;o=e.peek();){if(!n&&"|"==o)return e.next(),t.pastDivider=!0,"internallink link";if("]"==o&&"]"==e.peek())return"internallink link";if(o=e.next(),/[hf]/i.test(o)&&/[ti]/i.test(e.peek())&&e.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i,!0))return"externallink link";e.eatWhile(/[^|\]]/)}return null}function s(e,t){for(var o,n=!1;o=e.next();){if("_"==o&&n){t.tokenize=a;break}n="_"==o}return"underlined"}function m(e,t){for(var o,n=!1;o=e.next();){if(","==o&&n){t.tokenize=a;break}n=","==o}return"string subscript"}function v(e,t){for(var o,n=!1;o=e.next();){if("^"==o&&n){t.tokenize=a;break}n="^"==o}return"string superscript"}function M(e,t){for(var o,n=!1;o=e.next();){if("~"==o&&n){t.tokenize=a;break}n="~"==o}return"strikethrough"}function p(t,i){i.tokenize=a;var r=o.fencedCodeBlockHighlighting&&n("text/x-latex");return i.LaTeXModeState=r?{mode:r,state:e.startState(r)}:"unknown","comment"}function b(t,i,r){return i.tokenize=function(t,i){i.tokenize=a;var l=o.fencedCodeBlockHighlighting&&n(r[1]||o.fencedCodeBlockDefaultMode);return i.codeBlockModeState=l?{mode:l,state:e.startState(l)}:"unknown",r[1]?(t.skipToEnd(),"tag"):null},t.match("```"),"comment"}function S(e,t){for(var o=1;e.match(x);)o++;return t.quoteLevel==o?t.quoteLevel--:t.quoteLevel"==o&&">"==e.peek()?(e.next(),t.tokenize=a,"macro"):(e.eatWhile(/[\w\$_]/),L.propertyIsEnumerable(e.current())?"keyword":"macro"):(t.tokenize=a,null)}var h={rainbow:["keyword","variable-2","variable-3"]},L={changecount:!0,colour:!0,"colour-picker":!0,contrastcolour:!0,"copy-to-clipboard":!0,csvtiddlers:!0,datauri:!0,dumpvariables:!0,"image-picker":!0,jsontiddler:!0,jsontiddlers:!0,lingo:!0,"list-links":!0,"list-links-draggable":!0,"list-tagged-draggable":!0,"list-thumbnails":!0,makedatauri:!0,now:!0,qualify:!0,resolvepath:!0,"box-shadow":!0,filter:!0,transition:!0,"background-linear-gradient":!0,"transform-origin":!0,toc:!0,"toc-expandable":!0,"toc-selective-expandable":!0,"toc-tabbed-internal-nav":!0,"toc-tabbed-external-nav":!0,tabs:!0,tag:!0,"tag-picker":!0,"tag-pill":!0,thumbnail:!0,timeline:!0,tree:!0,unusedtitle:!0,version:!0};void 0===o.fencedCodeBlockHighlighting&&(o.fencedCodeBlockHighlighting=!0),void 0===o.fencedCodeBlockDefaultMode&&(o.fencedCodeBlockDefaultMode="text/plain");var B=/^\-\-\-+$/,x=/^<<