roojs-core.js
authorAlan Knowles <alan@roojs.com>
Fri, 7 Feb 2020 07:01:08 +0000 (15:01 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 7 Feb 2020 07:01:08 +0000 (15:01 +0800)
roojs-core-debug.js
roojs-all.js
roojs-debug.js
Roo/Markdown.js

Roo/Markdown.js
roojs-all.js
roojs-core-debug.js
roojs-core.js
roojs-debug.js

index 1982c7a..71e4c47 100644 (file)
@@ -796,7 +796,7 @@ Roo.Markdown.toHtml = function(text) {
      * Renderer
      */
     
-    function Renderer(options) {
+    var Renderer   = function (options) {
       this.options = options || {};
     }
     
index b4c5ecf..f774cab 100644 (file)
@@ -688,57 +688,57 @@ return Roo.Markdown.marked(A);};(function(){var A={newline:/^\n+/,code:/^( {4}[^
 A._tag='(?!(?:'+'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'+'|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'+'|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';A.html=replace(A.html)('comment',/<!--[\s\S]*?-->/)('closed',/<(tag)[\s\S]+?<\/\1>/)('closing',/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,A._tag)();
 A.paragraph=replace(A.paragraph)('hr',A.hr)('heading',A.heading)('lheading',A.lheading)('blockquote',A.blockquote)('tag','<'+A._tag)('def',A.def)();A.normal=merge({},A);A.gfm=merge({},A.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}
 );A.gfm.paragraph=replace(A.paragraph)('(?!','(?!'+A.gfm.fences.source.replace('\\1','\\2')+'|'+A.list.source.replace('\\1','\\3')+'|')();A.tables=merge({},A.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}
-);var B=function(D){this.tokens=[];this.tokens.links={};this.options=D||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}};B.rules=A;B.lex=function(D,E){var F=new B(E);return F.lex(D);
-};B.prototype.lex=function(D){D=D.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(D,true);};B.prototype.token=function(D,E,bq){var D=D.replace(/^ +$/gm,''),F,G,H,I,b,J,K,i,l;while(D){if(H=this.rules.newline.exec(D)){D=D.substring(H[0].length);
-if(H[0].length>1){this.tokens.push({type:'space'});}}if(H=this.rules.code.exec(D)){D=D.substring(H[0].length);H=H[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?H.replace(/\n+$/,''):H});continue;}if(H=this.rules.fences.exec(D)){D=D.substring(H[0].length);
-this.tokens.push({type:'code',lang:H[2],text:H[3]||''});continue;}if(H=this.rules.heading.exec(D)){D=D.substring(H[0].length);this.tokens.push({type:'heading',depth:H[1].length,text:H[2]});continue;}if(E&&(H=this.rules.nptable.exec(D))){D=D.substring(H[0].length);
-J={type:'table',header:H[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:H[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:H[3].replace(/\n$/,'').split('\n')};for(i=0;i<J.align.length;i++){if(/^ *-+: *$/.test(J.align[i])){J.align[i]='right';}else if(/^ *:-+: *$/.test(J.align[i])){J.align[i]='center';
-}else if(/^ *:-+ *$/.test(J.align[i])){J.align[i]='left';}else{J.align[i]=null;}}for(i=0;i<J.cells.length;i++){J.cells[i]=J.cells[i].split(/ *\| */);}this.tokens.push(J);continue;}if(H=this.rules.lheading.exec(D)){D=D.substring(H[0].length);this.tokens.push({type:'heading',depth:H[2]==='='?1:2,text:H[1]}
-);continue;}if(H=this.rules.hr.exec(D)){D=D.substring(H[0].length);this.tokens.push({type:'hr'});continue;}if(H=this.rules.blockquote.exec(D)){D=D.substring(H[0].length);this.tokens.push({type:'blockquote_start'});H=H[0].replace(/^ *> ?/gm,'');this.token(H,E,true);
-this.tokens.push({type:'blockquote_end'});continue;}if(H=this.rules.list.exec(D)){D=D.substring(H[0].length);I=H[2];this.tokens.push({type:'list_start',ordered:I.length>1});H=H[0].match(this.rules.item);F=false;l=H.length;i=0;for(;i<l;i++){J=H[i];K=J.length;
-J=J.replace(/^ *([*+-]|\d+\.) +/,'');if(~J.indexOf('\n ')){K-=J.length;J=!this.options.pedantic?J.replace(new RegExp('^ {1,'+K+'}','gm'),''):J.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(H[i+1])[0];if(I!==b&&!(I.length>1&&b.length>1)){D=H.slice(i+1).join('\n')+D;
-i=l-1;}}G=F||/\n\n(?!\s*$)/.test(J);if(i!==l-1){F=J.charAt(J.length-1)==='\n';if(!G){G=F;}}this.tokens.push({type:G?'loose_item_start':'list_item_start'});this.token(J,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
-continue;}if(H=this.rules.html.exec(D)){D=D.substring(H[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(H[1]==='pre'||H[1]==='script'||H[1]==='style'),text:H[0]});continue;}if((!bq&&E)&&(H=this.rules.def.exec(D))){D=D.substring(H[0].length);
-this.tokens.links[H[1].toLowerCase()]={href:H[2],title:H[3]};continue;}if(E&&(H=this.rules.table.exec(D))){D=D.substring(H[0].length);J={type:'table',header:H[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:H[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:H[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
-;for(i=0;i<J.align.length;i++){if(/^ *-+: *$/.test(J.align[i])){J.align[i]='right';}else if(/^ *:-+: *$/.test(J.align[i])){J.align[i]='center';}else if(/^ *:-+ *$/.test(J.align[i])){J.align[i]='left';}else{J.align[i]=null;}}for(i=0;i<J.cells.length;i++){J.cells[i]=J.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
-}this.tokens.push(J);continue;}if(E&&(H=this.rules.paragraph.exec(D))){D=D.substring(H[0].length);this.tokens.push({type:'paragraph',text:H[1].charAt(H[1].length-1)==='\n'?H[1].slice(0,-1):H[1]});continue;}if(H=this.rules.text.exec(D)){D=D.substring(H[0].length);
-this.tokens.push({type:'text',text:H[0]});continue;}if(D){throw new Error('Infinite loop on byte: '+D.charCodeAt(0));}}return this.tokens;};var C={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/}
+);var B=function(E){this.tokens=[];this.tokens.links={};this.options=E||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}};B.rules=A;B.lex=function(E,F){var G=new B(F);return G.lex(E);
+};B.prototype.lex=function(E){E=E.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(E,true);};B.prototype.token=function(E,F,bq){var E=E.replace(/^ +$/gm,''),G,H,I,J,b,K,L,i,l;while(E){if(I=this.rules.newline.exec(E)){E=E.substring(I[0].length);
+if(I[0].length>1){this.tokens.push({type:'space'});}}if(I=this.rules.code.exec(E)){E=E.substring(I[0].length);I=I[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?I.replace(/\n+$/,''):I});continue;}if(I=this.rules.fences.exec(E)){E=E.substring(I[0].length);
+this.tokens.push({type:'code',lang:I[2],text:I[3]||''});continue;}if(I=this.rules.heading.exec(E)){E=E.substring(I[0].length);this.tokens.push({type:'heading',depth:I[1].length,text:I[2]});continue;}if(F&&(I=this.rules.nptable.exec(E))){E=E.substring(I[0].length);
+K={type:'table',header:I[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:I[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:I[3].replace(/\n$/,'').split('\n')};for(i=0;i<K.align.length;i++){if(/^ *-+: *$/.test(K.align[i])){K.align[i]='right';}else if(/^ *:-+: *$/.test(K.align[i])){K.align[i]='center';
+}else if(/^ *:-+ *$/.test(K.align[i])){K.align[i]='left';}else{K.align[i]=null;}}for(i=0;i<K.cells.length;i++){K.cells[i]=K.cells[i].split(/ *\| */);}this.tokens.push(K);continue;}if(I=this.rules.lheading.exec(E)){E=E.substring(I[0].length);this.tokens.push({type:'heading',depth:I[2]==='='?1:2,text:I[1]}
+);continue;}if(I=this.rules.hr.exec(E)){E=E.substring(I[0].length);this.tokens.push({type:'hr'});continue;}if(I=this.rules.blockquote.exec(E)){E=E.substring(I[0].length);this.tokens.push({type:'blockquote_start'});I=I[0].replace(/^ *> ?/gm,'');this.token(I,F,true);
+this.tokens.push({type:'blockquote_end'});continue;}if(I=this.rules.list.exec(E)){E=E.substring(I[0].length);J=I[2];this.tokens.push({type:'list_start',ordered:J.length>1});I=I[0].match(this.rules.item);G=false;l=I.length;i=0;for(;i<l;i++){K=I[i];L=K.length;
+K=K.replace(/^ *([*+-]|\d+\.) +/,'');if(~K.indexOf('\n ')){L-=K.length;K=!this.options.pedantic?K.replace(new RegExp('^ {1,'+L+'}','gm'),''):K.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(I[i+1])[0];if(J!==b&&!(J.length>1&&b.length>1)){E=I.slice(i+1).join('\n')+E;
+i=l-1;}}H=G||/\n\n(?!\s*$)/.test(K);if(i!==l-1){G=K.charAt(K.length-1)==='\n';if(!H){H=G;}}this.tokens.push({type:H?'loose_item_start':'list_item_start'});this.token(K,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
+continue;}if(I=this.rules.html.exec(E)){E=E.substring(I[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(I[1]==='pre'||I[1]==='script'||I[1]==='style'),text:I[0]});continue;}if((!bq&&F)&&(I=this.rules.def.exec(E))){E=E.substring(I[0].length);
+this.tokens.links[I[1].toLowerCase()]={href:I[2],title:I[3]};continue;}if(F&&(I=this.rules.table.exec(E))){E=E.substring(I[0].length);K={type:'table',header:I[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:I[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:I[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
+;for(i=0;i<K.align.length;i++){if(/^ *-+: *$/.test(K.align[i])){K.align[i]='right';}else if(/^ *:-+: *$/.test(K.align[i])){K.align[i]='center';}else if(/^ *:-+ *$/.test(K.align[i])){K.align[i]='left';}else{K.align[i]=null;}}for(i=0;i<K.cells.length;i++){K.cells[i]=K.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
+}this.tokens.push(K);continue;}if(F&&(I=this.rules.paragraph.exec(E))){E=E.substring(I[0].length);this.tokens.push({type:'paragraph',text:I[1].charAt(I[1].length-1)==='\n'?I[1].slice(0,-1):I[1]});continue;}if(I=this.rules.text.exec(E)){E=E.substring(I[0].length);
+this.tokens.push({type:'text',text:I[0]});continue;}if(E){throw new Error('Infinite loop on byte: '+E.charCodeAt(0));}}return this.tokens;};var C={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/}
 ;C._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;C._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;C.link=replace(C.link)('inside',C._inside)('href',C._href)();C.reflink=replace(C.reflink)('inside',C._inside)();C.normal=merge({},C);C.pedantic=merge({}
 ,C.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});C.gfm=merge({},C.normal,{escape:replace(C.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(C.text)(']|','~]|')('|','|https?://|')()}
-);C.breaks=merge({},C.gfm,{br:replace(C.br)('{2,}','*')(),text:replace(C.gfm.text)('{2,}','*')()});function InlineLexer(D,E){this.options=E||marked.defaults;this.links=D;this.rules=C.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;
-if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=C.breaks;}else{this.rules=C.gfm;}}else if(this.options.pedantic){this.rules=C.pedantic;}}InlineLexer.rules=C;InlineLexer.output=function(D,E,F){var G=new InlineLexer(E,F);
-return G.output(D);};InlineLexer.prototype.output=function(D){var E='',F,G,H,I;while(D){if(I=this.rules.escape.exec(D)){D=D.substring(I[0].length);E+=I[1];continue;}if(I=this.rules.autolink.exec(D)){D=D.substring(I[0].length);if(I[2]==='@'){G=I[1].charAt(6)===':'?this.mangle(I[1].substring(7)):this.mangle(I[1]);
-H=this.mangle('mailto:')+G;}else{G=escape(I[1]);H=G;}E+=this.renderer.link(H,null,G);continue;}if(!this.inLink&&(I=this.rules.url.exec(D))){D=D.substring(I[0].length);G=escape(I[1]);H=G;E+=this.renderer.link(H,null,G);continue;}if(I=this.rules.tag.exec(D)){if(!this.inLink&&/^<a /i.test(I[0])){this.inLink=true;
-}else if(this.inLink&&/^<\/a>/i.test(I[0])){this.inLink=false;}D=D.substring(I[0].length);E+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(I[0]):escape(I[0]):I[0];continue;}if(I=this.rules.link.exec(D)){D=D.substring(I[0].length);this.inLink=true;
-E+=this.outputLink(I,{href:I[2],title:I[3]});this.inLink=false;continue;}if((I=this.rules.reflink.exec(D))||(I=this.rules.nolink.exec(D))){D=D.substring(I[0].length);F=(I[2]||I[1]).replace(/\s+/g,' ');F=this.links[F.toLowerCase()];if(!F||!F.href){E+=I[0].charAt(0);
-D=I[0].substring(1)+D;continue;}this.inLink=true;E+=this.outputLink(I,F);this.inLink=false;continue;}if(I=this.rules.strong.exec(D)){D=D.substring(I[0].length);E+=this.renderer.strong(this.output(I[2]||I[1]));continue;}if(I=this.rules.em.exec(D)){D=D.substring(I[0].length);
-E+=this.renderer.em(this.output(I[2]||I[1]));continue;}if(I=this.rules.code.exec(D)){D=D.substring(I[0].length);E+=this.renderer.codespan(escape(I[2],true));continue;}if(I=this.rules.br.exec(D)){D=D.substring(I[0].length);E+=this.renderer.br();continue;}if(I=this.rules.del.exec(D)){D=D.substring(I[0].length);
-E+=this.renderer.del(this.output(I[1]));continue;}if(I=this.rules.text.exec(D)){D=D.substring(I[0].length);E+=this.renderer.text(escape(this.smartypants(I[0])));continue;}if(D){throw new Error('Infinite loop on byte: '+D.charCodeAt(0));}}return E;};InlineLexer.prototype.outputLink=function(D,E){var F=escape(E.href),G=E.title?escape(E.title):null;
-return D[0].charAt(0)!=='!'?this.renderer.link(F,G,this.output(D[1])):this.renderer.image(F,G,escape(D[1]));};InlineLexer.prototype.smartypants=function(D){if(!this.options.smartypants){return D;}return D.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201c').replace(/"/g,'\u201d').replace(/\.{3}/g,'\u2026');
-};InlineLexer.prototype.mangle=function(D){if(!this.options.mangle){return D;}var E='',l=D.length,i=0,ch;for(;i<l;i++){ch=D.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}E+='&#'+ch+';';}return E;};function Renderer(D){this.options=D||{};}Renderer.prototype.code=function(D,E,F){if(this.options.highlight){var G=this.options.highlight(D,E);
-if(G!=null&&G!==D){F=true;D=G;}}else{F=true;}if(!E){return '<pre><code>'+(F?D:escape(D,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+escape(E,true)+'">'+(F?D:escape(D,true))+'\n</code></pre>\n';};Renderer.prototype.blockquote=function(D){return '<blockquote>\n'+D+'</blockquote>\n';
-};Renderer.prototype.html=function(D){return D;};Renderer.prototype.heading=function(D,E,F){return '<h'+E+' id="'+this.options.headerPrefix+F.toLowerCase().replace(/[^\w]+/g,'-')+'">'+D+'</h'+E+'>\n';};Renderer.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
-};Renderer.prototype.list=function(D,E){var F=E?'ol':'ul';return '<'+F+'>\n'+D+'</'+F+'>\n';};Renderer.prototype.listitem=function(D){return '<li>'+D+'</li>\n';};Renderer.prototype.paragraph=function(D){return '<p>'+D+'</p>\n';};Renderer.prototype.table=function(D,E){return '<table class="table table-striped">\n'+'<thead>\n'+D+'</thead>\n'+'<tbody>\n'+E+'</tbody>\n'+'</table>\n';
-};Renderer.prototype.tablerow=function(D){return '<tr>\n'+D+'</tr>\n';};Renderer.prototype.tablecell=function(D,E){var F=E.header?'th':'td';var G=E.align?'<'+F+' style="text-align:'+E.align+'">':'<'+F+'>';return G+D+'</'+F+'>\n';};Renderer.prototype.strong=function(D){return '<strong>'+D+'</strong>';
-};Renderer.prototype.em=function(D){return '<em>'+D+'</em>';};Renderer.prototype.codespan=function(D){return '<code>'+D+'</code>';};Renderer.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};Renderer.prototype.del=function(D){return '<del>'+D+'</del>';
-};Renderer.prototype.link=function(D,E,F){if(this.options.sanitize){try{var G=decodeURIComponent(unescape(D)).replace(/[^\w:]/g,'').toLowerCase();}catch(e){return '';}if(G.indexOf('javascript:')===0||G.indexOf('vbscript:')===0){return '';}}var H='<a href="'+D+'"';
-if(E){H+=' title="'+E+'"';}H+='>'+F+'</a>';return H;};Renderer.prototype.image=function(D,E,F){var G='<img src="'+D+'" alt="'+F+'"';if(E){G+=' title="'+E+'"';}G+=this.options.xhtml?'/>':'>';return G;};Renderer.prototype.text=function(D){return D;};function Parser(D){this.tokens=[];
-this.token=null;this.options=D||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options;}Parser.parse=function(D,E,F){var G=new Parser(E,F);return G.parse(D);};Parser.prototype.parse=function(D){this.inline=new InlineLexer(D.links,this.options,this.renderer);
-this.tokens=D.reverse();var E='';while(this.next()){E+=this.tok();}return E;};Parser.prototype.next=function(){return this.token=this.tokens.pop();};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};Parser.prototype.parseText=function(){var D=this.token.text;
-while(this.peek().type==='text'){D+='\n'+this.next().text;}return this.inline.output(D);};Parser.prototype.tok=function(){switch(this.token.type){case 'space':{return '';}case 'hr':{return this.renderer.hr();}case 'heading':{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);
-}case 'code':{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);}case 'table':{var D='',E='',i,F,G,H,j;G='';for(i=0;i<this.token.header.length;i++){H={header:true,align:this.token.align[i]};G+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]}
-);}D+=this.renderer.tablerow(G);for(i=0;i<this.token.cells.length;i++){F=this.token.cells[i];G='';for(j=0;j<F.length;j++){G+=this.renderer.tablecell(this.inline.output(F[j]),{header:false,align:this.token.align[j]});}E+=this.renderer.tablerow(G);}return this.renderer.table(D,E);
-}case 'blockquote_start':{var E='';while(this.next().type!=='blockquote_end'){E+=this.tok();}return this.renderer.blockquote(E);}case 'list_start':{var E='',I=this.token.ordered;while(this.next().type!=='list_end'){E+=this.tok();}return this.renderer.list(E,I);
-}case 'list_item_start':{var E='';while(this.next().type!=='list_item_end'){E+=this.token.type==='text'?this.parseText():this.tok();}return this.renderer.listitem(E);}case 'loose_item_start':{var E='';while(this.next().type!=='list_item_end'){E+=this.tok();
-}return this.renderer.listitem(E);}case 'html':{var J=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;return this.renderer.html(J);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));
-}case 'text':{return this.renderer.paragraph(this.parseText());}}};function escape(D,E){return D.replace(!E?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');}function unescape(D){return D.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(_,n){n=n.toLowerCase();
-if(n==='colon'){return ':';}if(n.charAt(0)==='#'){return n.charAt(1)==='x'?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1));}return '';});}function replace(D,E){D=D.source;E=E||'';return function F(G,H){if(!G){return new RegExp(D,E);
-}H=H.source||H;H=H.replace(/(^|[^\[])\^/g,'$1');D=D.replace(G,H);return F;};}function noop(){}noop.exec=noop;function merge(D){var i=1,E,F;for(;i<arguments.length;i++){E=arguments[i];for(F in E){if(Object.prototype.hasOwnProperty.call(E,F)){D[F]=E[F];}}}return D;
-}function marked(D,E,F){if(F||typeof E==='function'){if(!F){F=E;E=null;}E=merge({},marked.defaults,E||{});var G=E.highlight,H,I,i=0;try{H=B.lex(D,E)}catch(e){return F(e);}I=H.length;var J=function(K){if(K){E.highlight=G;return F(K);}var L;try{L=Parser.parse(H,E);
-}catch(e){K=e;}E.highlight=G;return K?F(K):F(null,L);};if(!G||G.length<3){return J();}delete E.highlight;if(!I){return J();}for(;i<H.length;i++){(function(K){if(K.type!=='code'){return --I||J();}return G(K.text,K.lang,function(L,M){if(L){return J(L);}if(M==null||M===K.text){return --I||J();
-}K.text=M;K.escaped=true;--I||J();});})(H[i]);}return;}try{if(E){E=merge({},marked.defaults,E);}return Parser.parse(B.lex(D,E),E);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';if((E||marked.defaults).silent){return '<p>An error occured:</p><pre>'+escape(e.message+'',true)+'</pre>';
-}throw e;}}marked.options=marked.setOptions=function(D){merge(marked.defaults,D);return marked;};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new Renderer,xhtml:false}
-;marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=B;marked.lexer=B.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;Roo.Markdown.marked=marked;})();
+);C.breaks=merge({},C.gfm,{br:replace(C.br)('{2,}','*')(),text:replace(C.gfm.text)('{2,}','*')()});var D=function(E,F){this.options=F||marked.defaults;this.links=E;this.rules=C.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;
+if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=C.breaks;}else{this.rules=C.gfm;}}else if(this.options.pedantic){this.rules=C.pedantic;}};D.rules=C;D.output=function(E,F,G){var H=new D(F,G);
+return H.output(E);};D.prototype.output=function(E){var F='',G,H,I,J;while(E){if(J=this.rules.escape.exec(E)){E=E.substring(J[0].length);F+=J[1];continue;}if(J=this.rules.autolink.exec(E)){E=E.substring(J[0].length);if(J[2]==='@'){H=J[1].charAt(6)===':'?this.mangle(J[1].substring(7)):this.mangle(J[1]);
+I=this.mangle('mailto:')+H;}else{H=escape(J[1]);I=H;}F+=this.renderer.link(I,null,H);continue;}if(!this.inLink&&(J=this.rules.url.exec(E))){E=E.substring(J[0].length);H=escape(J[1]);I=H;F+=this.renderer.link(I,null,H);continue;}if(J=this.rules.tag.exec(E)){if(!this.inLink&&/^<a /i.test(J[0])){this.inLink=true;
+}else if(this.inLink&&/^<\/a>/i.test(J[0])){this.inLink=false;}E=E.substring(J[0].length);F+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(J[0]):escape(J[0]):J[0];continue;}if(J=this.rules.link.exec(E)){E=E.substring(J[0].length);this.inLink=true;
+F+=this.outputLink(J,{href:J[2],title:J[3]});this.inLink=false;continue;}if((J=this.rules.reflink.exec(E))||(J=this.rules.nolink.exec(E))){E=E.substring(J[0].length);G=(J[2]||J[1]).replace(/\s+/g,' ');G=this.links[G.toLowerCase()];if(!G||!G.href){F+=J[0].charAt(0);
+E=J[0].substring(1)+E;continue;}this.inLink=true;F+=this.outputLink(J,G);this.inLink=false;continue;}if(J=this.rules.strong.exec(E)){E=E.substring(J[0].length);F+=this.renderer.strong(this.output(J[2]||J[1]));continue;}if(J=this.rules.em.exec(E)){E=E.substring(J[0].length);
+F+=this.renderer.em(this.output(J[2]||J[1]));continue;}if(J=this.rules.code.exec(E)){E=E.substring(J[0].length);F+=this.renderer.codespan(escape(J[2],true));continue;}if(J=this.rules.br.exec(E)){E=E.substring(J[0].length);F+=this.renderer.br();continue;}if(J=this.rules.del.exec(E)){E=E.substring(J[0].length);
+F+=this.renderer.del(this.output(J[1]));continue;}if(J=this.rules.text.exec(E)){E=E.substring(J[0].length);F+=this.renderer.text(escape(this.smartypants(J[0])));continue;}if(E){throw new Error('Infinite loop on byte: '+E.charCodeAt(0));}}return F;};D.prototype.outputLink=function(E,F){var G=escape(F.href),H=F.title?escape(F.title):null;
+return E[0].charAt(0)!=='!'?this.renderer.link(G,H,this.output(E[1])):this.renderer.image(G,H,escape(E[1]));};D.prototype.smartypants=function(E){if(!this.options.smartypants){return E;}return E.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201c').replace(/"/g,'\u201d').replace(/\.{3}/g,'\u2026');
+};D.prototype.mangle=function(E){if(!this.options.mangle){return E;}var F='',l=E.length,i=0,ch;for(;i<l;i++){ch=E.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}F+='&#'+ch+';';}return F;};function Renderer(E){this.options=E||{};}Renderer.prototype.code=function(E,F,G){if(this.options.highlight){var H=this.options.highlight(E,F);
+if(H!=null&&H!==E){G=true;E=H;}}else{G=true;}if(!F){return '<pre><code>'+(G?E:escape(E,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+escape(F,true)+'">'+(G?E:escape(E,true))+'\n</code></pre>\n';};Renderer.prototype.blockquote=function(E){return '<blockquote>\n'+E+'</blockquote>\n';
+};Renderer.prototype.html=function(E){return E;};Renderer.prototype.heading=function(E,F,G){return '<h'+F+' id="'+this.options.headerPrefix+G.toLowerCase().replace(/[^\w]+/g,'-')+'">'+E+'</h'+F+'>\n';};Renderer.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
+};Renderer.prototype.list=function(E,F){var G=F?'ol':'ul';return '<'+G+'>\n'+E+'</'+G+'>\n';};Renderer.prototype.listitem=function(E){return '<li>'+E+'</li>\n';};Renderer.prototype.paragraph=function(E){return '<p>'+E+'</p>\n';};Renderer.prototype.table=function(E,F){return '<table class="table table-striped">\n'+'<thead>\n'+E+'</thead>\n'+'<tbody>\n'+F+'</tbody>\n'+'</table>\n';
+};Renderer.prototype.tablerow=function(E){return '<tr>\n'+E+'</tr>\n';};Renderer.prototype.tablecell=function(E,F){var G=F.header?'th':'td';var H=F.align?'<'+G+' style="text-align:'+F.align+'">':'<'+G+'>';return H+E+'</'+G+'>\n';};Renderer.prototype.strong=function(E){return '<strong>'+E+'</strong>';
+};Renderer.prototype.em=function(E){return '<em>'+E+'</em>';};Renderer.prototype.codespan=function(E){return '<code>'+E+'</code>';};Renderer.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};Renderer.prototype.del=function(E){return '<del>'+E+'</del>';
+};Renderer.prototype.link=function(E,F,G){if(this.options.sanitize){try{var H=decodeURIComponent(unescape(E)).replace(/[^\w:]/g,'').toLowerCase();}catch(e){return '';}if(H.indexOf('javascript:')===0||H.indexOf('vbscript:')===0){return '';}}var I='<a href="'+E+'"';
+if(F){I+=' title="'+F+'"';}I+='>'+G+'</a>';return I;};Renderer.prototype.image=function(E,F,G){var H='<img src="'+E+'" alt="'+G+'"';if(F){H+=' title="'+F+'"';}H+=this.options.xhtml?'/>':'>';return H;};Renderer.prototype.text=function(E){return E;};function Parser(E){this.tokens=[];
+this.token=null;this.options=E||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options;}Parser.parse=function(E,F,G){var H=new Parser(F,G);return H.parse(E);};Parser.prototype.parse=function(E){this.inline=new D(E.links,this.options,this.renderer);
+this.tokens=E.reverse();var F='';while(this.next()){F+=this.tok();}return F;};Parser.prototype.next=function(){return this.token=this.tokens.pop();};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};Parser.prototype.parseText=function(){var E=this.token.text;
+while(this.peek().type==='text'){E+='\n'+this.next().text;}return this.inline.output(E);};Parser.prototype.tok=function(){switch(this.token.type){case 'space':{return '';}case 'hr':{return this.renderer.hr();}case 'heading':{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);
+}case 'code':{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);}case 'table':{var E='',F='',i,G,H,I,j;H='';for(i=0;i<this.token.header.length;i++){I={header:true,align:this.token.align[i]};H+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]}
+);}E+=this.renderer.tablerow(H);for(i=0;i<this.token.cells.length;i++){G=this.token.cells[i];H='';for(j=0;j<G.length;j++){H+=this.renderer.tablecell(this.inline.output(G[j]),{header:false,align:this.token.align[j]});}F+=this.renderer.tablerow(H);}return this.renderer.table(E,F);
+}case 'blockquote_start':{var F='';while(this.next().type!=='blockquote_end'){F+=this.tok();}return this.renderer.blockquote(F);}case 'list_start':{var F='',J=this.token.ordered;while(this.next().type!=='list_end'){F+=this.tok();}return this.renderer.list(F,J);
+}case 'list_item_start':{var F='';while(this.next().type!=='list_item_end'){F+=this.token.type==='text'?this.parseText():this.tok();}return this.renderer.listitem(F);}case 'loose_item_start':{var F='';while(this.next().type!=='list_item_end'){F+=this.tok();
+}return this.renderer.listitem(F);}case 'html':{var K=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;return this.renderer.html(K);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));
+}case 'text':{return this.renderer.paragraph(this.parseText());}}};function escape(E,F){return E.replace(!F?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');}function unescape(E){return E.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(_,n){n=n.toLowerCase();
+if(n==='colon'){return ':';}if(n.charAt(0)==='#'){return n.charAt(1)==='x'?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1));}return '';});}function replace(E,F){E=E.source;F=F||'';return function G(H,I){if(!H){return new RegExp(E,F);
+}I=I.source||I;I=I.replace(/(^|[^\[])\^/g,'$1');E=E.replace(H,I);return G;};}function noop(){}noop.exec=noop;function merge(E){var i=1,F,G;for(;i<arguments.length;i++){F=arguments[i];for(G in F){if(Object.prototype.hasOwnProperty.call(F,G)){E[G]=F[G];}}}return E;
+}function marked(E,F,G){if(G||typeof F==='function'){if(!G){G=F;F=null;}F=merge({},marked.defaults,F||{});var H=F.highlight,I,J,i=0;try{I=B.lex(E,F)}catch(e){return G(e);}J=I.length;var K=function(L){if(L){F.highlight=H;return G(L);}var M;try{M=Parser.parse(I,F);
+}catch(e){L=e;}F.highlight=H;return L?G(L):G(null,M);};if(!H||H.length<3){return K();}delete F.highlight;if(!J){return K();}for(;i<I.length;i++){(function(L){if(L.type!=='code'){return --J||K();}return H(L.text,L.lang,function(M,N){if(M){return K(M);}if(N==null||N===L.text){return --J||K();
+}L.text=N;L.escaped=true;--J||K();});})(I[i]);}return;}try{if(F){F=merge({},marked.defaults,F);}return Parser.parse(B.lex(E,F),F);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';if((F||marked.defaults).silent){return '<p>An error occured:</p><pre>'+escape(e.message+'',true)+'</pre>';
+}throw e;}}marked.options=marked.setOptions=function(E){merge(marked.defaults,E);return marked;};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new Renderer,xhtml:false}
+;marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=B;marked.lexer=B.lex;marked.InlineLexer=D;marked.inlineLexer=D.output;marked.parse=marked;Roo.Markdown.marked=marked;})();
 // Roo/dd/DragDrop.js
 (function(){var A=Roo.EventManager;var B=Roo.lib.Dom;Roo.dd.DragDrop=function(id,C,D){if(id){this.init(id,C,D);}};Roo.extend(Roo.dd.DragDrop,Roo.util.Observable,{id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;
 },unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){}
index 4a7002a..aecbedb 100644 (file)
@@ -17316,7 +17316,7 @@ Roo.Markdown.toHtml = function(text) {
      * Inline Lexer & Compiler
      */
     
-    function InlineLexer(links, options) {
+    var InlineLexer  = function (links, options) {
       this.options = options || marked.defaults;
       this.links = links;
       this.rules = inline.normal;
index ced0599..4300a79 100644 (file)
@@ -688,57 +688,57 @@ return Roo.Markdown.marked(A);};(function(){var A={newline:/^\n+/,code:/^( {4}[^
 A._tag='(?!(?:'+'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'+'|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'+'|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';A.html=replace(A.html)('comment',/<!--[\s\S]*?-->/)('closed',/<(tag)[\s\S]+?<\/\1>/)('closing',/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,A._tag)();
 A.paragraph=replace(A.paragraph)('hr',A.hr)('heading',A.heading)('lheading',A.lheading)('blockquote',A.blockquote)('tag','<'+A._tag)('def',A.def)();A.normal=merge({},A);A.gfm=merge({},A.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}
 );A.gfm.paragraph=replace(A.paragraph)('(?!','(?!'+A.gfm.fences.source.replace('\\1','\\2')+'|'+A.list.source.replace('\\1','\\3')+'|')();A.tables=merge({},A.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}
-);var B=function(D){this.tokens=[];this.tokens.links={};this.options=D||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}};B.rules=A;B.lex=function(D,E){var F=new B(E);return F.lex(D);
-};B.prototype.lex=function(D){D=D.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(D,true);};B.prototype.token=function(D,E,bq){var D=D.replace(/^ +$/gm,''),F,G,H,I,b,J,K,i,l;while(D){if(H=this.rules.newline.exec(D)){D=D.substring(H[0].length);
-if(H[0].length>1){this.tokens.push({type:'space'});}}if(H=this.rules.code.exec(D)){D=D.substring(H[0].length);H=H[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?H.replace(/\n+$/,''):H});continue;}if(H=this.rules.fences.exec(D)){D=D.substring(H[0].length);
-this.tokens.push({type:'code',lang:H[2],text:H[3]||''});continue;}if(H=this.rules.heading.exec(D)){D=D.substring(H[0].length);this.tokens.push({type:'heading',depth:H[1].length,text:H[2]});continue;}if(E&&(H=this.rules.nptable.exec(D))){D=D.substring(H[0].length);
-J={type:'table',header:H[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:H[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:H[3].replace(/\n$/,'').split('\n')};for(i=0;i<J.align.length;i++){if(/^ *-+: *$/.test(J.align[i])){J.align[i]='right';}else if(/^ *:-+: *$/.test(J.align[i])){J.align[i]='center';
-}else if(/^ *:-+ *$/.test(J.align[i])){J.align[i]='left';}else{J.align[i]=null;}}for(i=0;i<J.cells.length;i++){J.cells[i]=J.cells[i].split(/ *\| */);}this.tokens.push(J);continue;}if(H=this.rules.lheading.exec(D)){D=D.substring(H[0].length);this.tokens.push({type:'heading',depth:H[2]==='='?1:2,text:H[1]}
-);continue;}if(H=this.rules.hr.exec(D)){D=D.substring(H[0].length);this.tokens.push({type:'hr'});continue;}if(H=this.rules.blockquote.exec(D)){D=D.substring(H[0].length);this.tokens.push({type:'blockquote_start'});H=H[0].replace(/^ *> ?/gm,'');this.token(H,E,true);
-this.tokens.push({type:'blockquote_end'});continue;}if(H=this.rules.list.exec(D)){D=D.substring(H[0].length);I=H[2];this.tokens.push({type:'list_start',ordered:I.length>1});H=H[0].match(this.rules.item);F=false;l=H.length;i=0;for(;i<l;i++){J=H[i];K=J.length;
-J=J.replace(/^ *([*+-]|\d+\.) +/,'');if(~J.indexOf('\n ')){K-=J.length;J=!this.options.pedantic?J.replace(new RegExp('^ {1,'+K+'}','gm'),''):J.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(H[i+1])[0];if(I!==b&&!(I.length>1&&b.length>1)){D=H.slice(i+1).join('\n')+D;
-i=l-1;}}G=F||/\n\n(?!\s*$)/.test(J);if(i!==l-1){F=J.charAt(J.length-1)==='\n';if(!G){G=F;}}this.tokens.push({type:G?'loose_item_start':'list_item_start'});this.token(J,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
-continue;}if(H=this.rules.html.exec(D)){D=D.substring(H[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(H[1]==='pre'||H[1]==='script'||H[1]==='style'),text:H[0]});continue;}if((!bq&&E)&&(H=this.rules.def.exec(D))){D=D.substring(H[0].length);
-this.tokens.links[H[1].toLowerCase()]={href:H[2],title:H[3]};continue;}if(E&&(H=this.rules.table.exec(D))){D=D.substring(H[0].length);J={type:'table',header:H[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:H[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:H[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
-;for(i=0;i<J.align.length;i++){if(/^ *-+: *$/.test(J.align[i])){J.align[i]='right';}else if(/^ *:-+: *$/.test(J.align[i])){J.align[i]='center';}else if(/^ *:-+ *$/.test(J.align[i])){J.align[i]='left';}else{J.align[i]=null;}}for(i=0;i<J.cells.length;i++){J.cells[i]=J.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
-}this.tokens.push(J);continue;}if(E&&(H=this.rules.paragraph.exec(D))){D=D.substring(H[0].length);this.tokens.push({type:'paragraph',text:H[1].charAt(H[1].length-1)==='\n'?H[1].slice(0,-1):H[1]});continue;}if(H=this.rules.text.exec(D)){D=D.substring(H[0].length);
-this.tokens.push({type:'text',text:H[0]});continue;}if(D){throw new Error('Infinite loop on byte: '+D.charCodeAt(0));}}return this.tokens;};var C={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/}
+);var B=function(E){this.tokens=[];this.tokens.links={};this.options=E||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}};B.rules=A;B.lex=function(E,F){var G=new B(F);return G.lex(E);
+};B.prototype.lex=function(E){E=E.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(E,true);};B.prototype.token=function(E,F,bq){var E=E.replace(/^ +$/gm,''),G,H,I,J,b,K,L,i,l;while(E){if(I=this.rules.newline.exec(E)){E=E.substring(I[0].length);
+if(I[0].length>1){this.tokens.push({type:'space'});}}if(I=this.rules.code.exec(E)){E=E.substring(I[0].length);I=I[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?I.replace(/\n+$/,''):I});continue;}if(I=this.rules.fences.exec(E)){E=E.substring(I[0].length);
+this.tokens.push({type:'code',lang:I[2],text:I[3]||''});continue;}if(I=this.rules.heading.exec(E)){E=E.substring(I[0].length);this.tokens.push({type:'heading',depth:I[1].length,text:I[2]});continue;}if(F&&(I=this.rules.nptable.exec(E))){E=E.substring(I[0].length);
+K={type:'table',header:I[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:I[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:I[3].replace(/\n$/,'').split('\n')};for(i=0;i<K.align.length;i++){if(/^ *-+: *$/.test(K.align[i])){K.align[i]='right';}else if(/^ *:-+: *$/.test(K.align[i])){K.align[i]='center';
+}else if(/^ *:-+ *$/.test(K.align[i])){K.align[i]='left';}else{K.align[i]=null;}}for(i=0;i<K.cells.length;i++){K.cells[i]=K.cells[i].split(/ *\| */);}this.tokens.push(K);continue;}if(I=this.rules.lheading.exec(E)){E=E.substring(I[0].length);this.tokens.push({type:'heading',depth:I[2]==='='?1:2,text:I[1]}
+);continue;}if(I=this.rules.hr.exec(E)){E=E.substring(I[0].length);this.tokens.push({type:'hr'});continue;}if(I=this.rules.blockquote.exec(E)){E=E.substring(I[0].length);this.tokens.push({type:'blockquote_start'});I=I[0].replace(/^ *> ?/gm,'');this.token(I,F,true);
+this.tokens.push({type:'blockquote_end'});continue;}if(I=this.rules.list.exec(E)){E=E.substring(I[0].length);J=I[2];this.tokens.push({type:'list_start',ordered:J.length>1});I=I[0].match(this.rules.item);G=false;l=I.length;i=0;for(;i<l;i++){K=I[i];L=K.length;
+K=K.replace(/^ *([*+-]|\d+\.) +/,'');if(~K.indexOf('\n ')){L-=K.length;K=!this.options.pedantic?K.replace(new RegExp('^ {1,'+L+'}','gm'),''):K.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(I[i+1])[0];if(J!==b&&!(J.length>1&&b.length>1)){E=I.slice(i+1).join('\n')+E;
+i=l-1;}}H=G||/\n\n(?!\s*$)/.test(K);if(i!==l-1){G=K.charAt(K.length-1)==='\n';if(!H){H=G;}}this.tokens.push({type:H?'loose_item_start':'list_item_start'});this.token(K,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
+continue;}if(I=this.rules.html.exec(E)){E=E.substring(I[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(I[1]==='pre'||I[1]==='script'||I[1]==='style'),text:I[0]});continue;}if((!bq&&F)&&(I=this.rules.def.exec(E))){E=E.substring(I[0].length);
+this.tokens.links[I[1].toLowerCase()]={href:I[2],title:I[3]};continue;}if(F&&(I=this.rules.table.exec(E))){E=E.substring(I[0].length);K={type:'table',header:I[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:I[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:I[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
+;for(i=0;i<K.align.length;i++){if(/^ *-+: *$/.test(K.align[i])){K.align[i]='right';}else if(/^ *:-+: *$/.test(K.align[i])){K.align[i]='center';}else if(/^ *:-+ *$/.test(K.align[i])){K.align[i]='left';}else{K.align[i]=null;}}for(i=0;i<K.cells.length;i++){K.cells[i]=K.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
+}this.tokens.push(K);continue;}if(F&&(I=this.rules.paragraph.exec(E))){E=E.substring(I[0].length);this.tokens.push({type:'paragraph',text:I[1].charAt(I[1].length-1)==='\n'?I[1].slice(0,-1):I[1]});continue;}if(I=this.rules.text.exec(E)){E=E.substring(I[0].length);
+this.tokens.push({type:'text',text:I[0]});continue;}if(E){throw new Error('Infinite loop on byte: '+E.charCodeAt(0));}}return this.tokens;};var C={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/}
 ;C._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;C._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;C.link=replace(C.link)('inside',C._inside)('href',C._href)();C.reflink=replace(C.reflink)('inside',C._inside)();C.normal=merge({},C);C.pedantic=merge({}
 ,C.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});C.gfm=merge({},C.normal,{escape:replace(C.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(C.text)(']|','~]|')('|','|https?://|')()}
-);C.breaks=merge({},C.gfm,{br:replace(C.br)('{2,}','*')(),text:replace(C.gfm.text)('{2,}','*')()});function InlineLexer(D,E){this.options=E||marked.defaults;this.links=D;this.rules=C.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;
-if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=C.breaks;}else{this.rules=C.gfm;}}else if(this.options.pedantic){this.rules=C.pedantic;}}InlineLexer.rules=C;InlineLexer.output=function(D,E,F){var G=new InlineLexer(E,F);
-return G.output(D);};InlineLexer.prototype.output=function(D){var E='',F,G,H,I;while(D){if(I=this.rules.escape.exec(D)){D=D.substring(I[0].length);E+=I[1];continue;}if(I=this.rules.autolink.exec(D)){D=D.substring(I[0].length);if(I[2]==='@'){G=I[1].charAt(6)===':'?this.mangle(I[1].substring(7)):this.mangle(I[1]);
-H=this.mangle('mailto:')+G;}else{G=escape(I[1]);H=G;}E+=this.renderer.link(H,null,G);continue;}if(!this.inLink&&(I=this.rules.url.exec(D))){D=D.substring(I[0].length);G=escape(I[1]);H=G;E+=this.renderer.link(H,null,G);continue;}if(I=this.rules.tag.exec(D)){if(!this.inLink&&/^<a /i.test(I[0])){this.inLink=true;
-}else if(this.inLink&&/^<\/a>/i.test(I[0])){this.inLink=false;}D=D.substring(I[0].length);E+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(I[0]):escape(I[0]):I[0];continue;}if(I=this.rules.link.exec(D)){D=D.substring(I[0].length);this.inLink=true;
-E+=this.outputLink(I,{href:I[2],title:I[3]});this.inLink=false;continue;}if((I=this.rules.reflink.exec(D))||(I=this.rules.nolink.exec(D))){D=D.substring(I[0].length);F=(I[2]||I[1]).replace(/\s+/g,' ');F=this.links[F.toLowerCase()];if(!F||!F.href){E+=I[0].charAt(0);
-D=I[0].substring(1)+D;continue;}this.inLink=true;E+=this.outputLink(I,F);this.inLink=false;continue;}if(I=this.rules.strong.exec(D)){D=D.substring(I[0].length);E+=this.renderer.strong(this.output(I[2]||I[1]));continue;}if(I=this.rules.em.exec(D)){D=D.substring(I[0].length);
-E+=this.renderer.em(this.output(I[2]||I[1]));continue;}if(I=this.rules.code.exec(D)){D=D.substring(I[0].length);E+=this.renderer.codespan(escape(I[2],true));continue;}if(I=this.rules.br.exec(D)){D=D.substring(I[0].length);E+=this.renderer.br();continue;}if(I=this.rules.del.exec(D)){D=D.substring(I[0].length);
-E+=this.renderer.del(this.output(I[1]));continue;}if(I=this.rules.text.exec(D)){D=D.substring(I[0].length);E+=this.renderer.text(escape(this.smartypants(I[0])));continue;}if(D){throw new Error('Infinite loop on byte: '+D.charCodeAt(0));}}return E;};InlineLexer.prototype.outputLink=function(D,E){var F=escape(E.href),G=E.title?escape(E.title):null;
-return D[0].charAt(0)!=='!'?this.renderer.link(F,G,this.output(D[1])):this.renderer.image(F,G,escape(D[1]));};InlineLexer.prototype.smartypants=function(D){if(!this.options.smartypants){return D;}return D.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201c').replace(/"/g,'\u201d').replace(/\.{3}/g,'\u2026');
-};InlineLexer.prototype.mangle=function(D){if(!this.options.mangle){return D;}var E='',l=D.length,i=0,ch;for(;i<l;i++){ch=D.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}E+='&#'+ch+';';}return E;};function Renderer(D){this.options=D||{};}Renderer.prototype.code=function(D,E,F){if(this.options.highlight){var G=this.options.highlight(D,E);
-if(G!=null&&G!==D){F=true;D=G;}}else{F=true;}if(!E){return '<pre><code>'+(F?D:escape(D,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+escape(E,true)+'">'+(F?D:escape(D,true))+'\n</code></pre>\n';};Renderer.prototype.blockquote=function(D){return '<blockquote>\n'+D+'</blockquote>\n';
-};Renderer.prototype.html=function(D){return D;};Renderer.prototype.heading=function(D,E,F){return '<h'+E+' id="'+this.options.headerPrefix+F.toLowerCase().replace(/[^\w]+/g,'-')+'">'+D+'</h'+E+'>\n';};Renderer.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
-};Renderer.prototype.list=function(D,E){var F=E?'ol':'ul';return '<'+F+'>\n'+D+'</'+F+'>\n';};Renderer.prototype.listitem=function(D){return '<li>'+D+'</li>\n';};Renderer.prototype.paragraph=function(D){return '<p>'+D+'</p>\n';};Renderer.prototype.table=function(D,E){return '<table class="table table-striped">\n'+'<thead>\n'+D+'</thead>\n'+'<tbody>\n'+E+'</tbody>\n'+'</table>\n';
-};Renderer.prototype.tablerow=function(D){return '<tr>\n'+D+'</tr>\n';};Renderer.prototype.tablecell=function(D,E){var F=E.header?'th':'td';var G=E.align?'<'+F+' style="text-align:'+E.align+'">':'<'+F+'>';return G+D+'</'+F+'>\n';};Renderer.prototype.strong=function(D){return '<strong>'+D+'</strong>';
-};Renderer.prototype.em=function(D){return '<em>'+D+'</em>';};Renderer.prototype.codespan=function(D){return '<code>'+D+'</code>';};Renderer.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};Renderer.prototype.del=function(D){return '<del>'+D+'</del>';
-};Renderer.prototype.link=function(D,E,F){if(this.options.sanitize){try{var G=decodeURIComponent(unescape(D)).replace(/[^\w:]/g,'').toLowerCase();}catch(e){return '';}if(G.indexOf('javascript:')===0||G.indexOf('vbscript:')===0){return '';}}var H='<a href="'+D+'"';
-if(E){H+=' title="'+E+'"';}H+='>'+F+'</a>';return H;};Renderer.prototype.image=function(D,E,F){var G='<img src="'+D+'" alt="'+F+'"';if(E){G+=' title="'+E+'"';}G+=this.options.xhtml?'/>':'>';return G;};Renderer.prototype.text=function(D){return D;};function Parser(D){this.tokens=[];
-this.token=null;this.options=D||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options;}Parser.parse=function(D,E,F){var G=new Parser(E,F);return G.parse(D);};Parser.prototype.parse=function(D){this.inline=new InlineLexer(D.links,this.options,this.renderer);
-this.tokens=D.reverse();var E='';while(this.next()){E+=this.tok();}return E;};Parser.prototype.next=function(){return this.token=this.tokens.pop();};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};Parser.prototype.parseText=function(){var D=this.token.text;
-while(this.peek().type==='text'){D+='\n'+this.next().text;}return this.inline.output(D);};Parser.prototype.tok=function(){switch(this.token.type){case 'space':{return '';}case 'hr':{return this.renderer.hr();}case 'heading':{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);
-}case 'code':{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);}case 'table':{var D='',E='',i,F,G,H,j;G='';for(i=0;i<this.token.header.length;i++){H={header:true,align:this.token.align[i]};G+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]}
-);}D+=this.renderer.tablerow(G);for(i=0;i<this.token.cells.length;i++){F=this.token.cells[i];G='';for(j=0;j<F.length;j++){G+=this.renderer.tablecell(this.inline.output(F[j]),{header:false,align:this.token.align[j]});}E+=this.renderer.tablerow(G);}return this.renderer.table(D,E);
-}case 'blockquote_start':{var E='';while(this.next().type!=='blockquote_end'){E+=this.tok();}return this.renderer.blockquote(E);}case 'list_start':{var E='',I=this.token.ordered;while(this.next().type!=='list_end'){E+=this.tok();}return this.renderer.list(E,I);
-}case 'list_item_start':{var E='';while(this.next().type!=='list_item_end'){E+=this.token.type==='text'?this.parseText():this.tok();}return this.renderer.listitem(E);}case 'loose_item_start':{var E='';while(this.next().type!=='list_item_end'){E+=this.tok();
-}return this.renderer.listitem(E);}case 'html':{var J=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;return this.renderer.html(J);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));
-}case 'text':{return this.renderer.paragraph(this.parseText());}}};function escape(D,E){return D.replace(!E?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');}function unescape(D){return D.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(_,n){n=n.toLowerCase();
-if(n==='colon'){return ':';}if(n.charAt(0)==='#'){return n.charAt(1)==='x'?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1));}return '';});}function replace(D,E){D=D.source;E=E||'';return function F(G,H){if(!G){return new RegExp(D,E);
-}H=H.source||H;H=H.replace(/(^|[^\[])\^/g,'$1');D=D.replace(G,H);return F;};}function noop(){}noop.exec=noop;function merge(D){var i=1,E,F;for(;i<arguments.length;i++){E=arguments[i];for(F in E){if(Object.prototype.hasOwnProperty.call(E,F)){D[F]=E[F];}}}return D;
-}function marked(D,E,F){if(F||typeof E==='function'){if(!F){F=E;E=null;}E=merge({},marked.defaults,E||{});var G=E.highlight,H,I,i=0;try{H=B.lex(D,E)}catch(e){return F(e);}I=H.length;var J=function(K){if(K){E.highlight=G;return F(K);}var L;try{L=Parser.parse(H,E);
-}catch(e){K=e;}E.highlight=G;return K?F(K):F(null,L);};if(!G||G.length<3){return J();}delete E.highlight;if(!I){return J();}for(;i<H.length;i++){(function(K){if(K.type!=='code'){return --I||J();}return G(K.text,K.lang,function(L,M){if(L){return J(L);}if(M==null||M===K.text){return --I||J();
-}K.text=M;K.escaped=true;--I||J();});})(H[i]);}return;}try{if(E){E=merge({},marked.defaults,E);}return Parser.parse(B.lex(D,E),E);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';if((E||marked.defaults).silent){return '<p>An error occured:</p><pre>'+escape(e.message+'',true)+'</pre>';
-}throw e;}}marked.options=marked.setOptions=function(D){merge(marked.defaults,D);return marked;};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new Renderer,xhtml:false}
-;marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=B;marked.lexer=B.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;Roo.Markdown.marked=marked;})();
+);C.breaks=merge({},C.gfm,{br:replace(C.br)('{2,}','*')(),text:replace(C.gfm.text)('{2,}','*')()});var D=function(E,F){this.options=F||marked.defaults;this.links=E;this.rules=C.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;
+if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=C.breaks;}else{this.rules=C.gfm;}}else if(this.options.pedantic){this.rules=C.pedantic;}};D.rules=C;D.output=function(E,F,G){var H=new D(F,G);
+return H.output(E);};D.prototype.output=function(E){var F='',G,H,I,J;while(E){if(J=this.rules.escape.exec(E)){E=E.substring(J[0].length);F+=J[1];continue;}if(J=this.rules.autolink.exec(E)){E=E.substring(J[0].length);if(J[2]==='@'){H=J[1].charAt(6)===':'?this.mangle(J[1].substring(7)):this.mangle(J[1]);
+I=this.mangle('mailto:')+H;}else{H=escape(J[1]);I=H;}F+=this.renderer.link(I,null,H);continue;}if(!this.inLink&&(J=this.rules.url.exec(E))){E=E.substring(J[0].length);H=escape(J[1]);I=H;F+=this.renderer.link(I,null,H);continue;}if(J=this.rules.tag.exec(E)){if(!this.inLink&&/^<a /i.test(J[0])){this.inLink=true;
+}else if(this.inLink&&/^<\/a>/i.test(J[0])){this.inLink=false;}E=E.substring(J[0].length);F+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(J[0]):escape(J[0]):J[0];continue;}if(J=this.rules.link.exec(E)){E=E.substring(J[0].length);this.inLink=true;
+F+=this.outputLink(J,{href:J[2],title:J[3]});this.inLink=false;continue;}if((J=this.rules.reflink.exec(E))||(J=this.rules.nolink.exec(E))){E=E.substring(J[0].length);G=(J[2]||J[1]).replace(/\s+/g,' ');G=this.links[G.toLowerCase()];if(!G||!G.href){F+=J[0].charAt(0);
+E=J[0].substring(1)+E;continue;}this.inLink=true;F+=this.outputLink(J,G);this.inLink=false;continue;}if(J=this.rules.strong.exec(E)){E=E.substring(J[0].length);F+=this.renderer.strong(this.output(J[2]||J[1]));continue;}if(J=this.rules.em.exec(E)){E=E.substring(J[0].length);
+F+=this.renderer.em(this.output(J[2]||J[1]));continue;}if(J=this.rules.code.exec(E)){E=E.substring(J[0].length);F+=this.renderer.codespan(escape(J[2],true));continue;}if(J=this.rules.br.exec(E)){E=E.substring(J[0].length);F+=this.renderer.br();continue;}if(J=this.rules.del.exec(E)){E=E.substring(J[0].length);
+F+=this.renderer.del(this.output(J[1]));continue;}if(J=this.rules.text.exec(E)){E=E.substring(J[0].length);F+=this.renderer.text(escape(this.smartypants(J[0])));continue;}if(E){throw new Error('Infinite loop on byte: '+E.charCodeAt(0));}}return F;};D.prototype.outputLink=function(E,F){var G=escape(F.href),H=F.title?escape(F.title):null;
+return E[0].charAt(0)!=='!'?this.renderer.link(G,H,this.output(E[1])):this.renderer.image(G,H,escape(E[1]));};D.prototype.smartypants=function(E){if(!this.options.smartypants){return E;}return E.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201c').replace(/"/g,'\u201d').replace(/\.{3}/g,'\u2026');
+};D.prototype.mangle=function(E){if(!this.options.mangle){return E;}var F='',l=E.length,i=0,ch;for(;i<l;i++){ch=E.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}F+='&#'+ch+';';}return F;};function Renderer(E){this.options=E||{};}Renderer.prototype.code=function(E,F,G){if(this.options.highlight){var H=this.options.highlight(E,F);
+if(H!=null&&H!==E){G=true;E=H;}}else{G=true;}if(!F){return '<pre><code>'+(G?E:escape(E,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+escape(F,true)+'">'+(G?E:escape(E,true))+'\n</code></pre>\n';};Renderer.prototype.blockquote=function(E){return '<blockquote>\n'+E+'</blockquote>\n';
+};Renderer.prototype.html=function(E){return E;};Renderer.prototype.heading=function(E,F,G){return '<h'+F+' id="'+this.options.headerPrefix+G.toLowerCase().replace(/[^\w]+/g,'-')+'">'+E+'</h'+F+'>\n';};Renderer.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
+};Renderer.prototype.list=function(E,F){var G=F?'ol':'ul';return '<'+G+'>\n'+E+'</'+G+'>\n';};Renderer.prototype.listitem=function(E){return '<li>'+E+'</li>\n';};Renderer.prototype.paragraph=function(E){return '<p>'+E+'</p>\n';};Renderer.prototype.table=function(E,F){return '<table class="table table-striped">\n'+'<thead>\n'+E+'</thead>\n'+'<tbody>\n'+F+'</tbody>\n'+'</table>\n';
+};Renderer.prototype.tablerow=function(E){return '<tr>\n'+E+'</tr>\n';};Renderer.prototype.tablecell=function(E,F){var G=F.header?'th':'td';var H=F.align?'<'+G+' style="text-align:'+F.align+'">':'<'+G+'>';return H+E+'</'+G+'>\n';};Renderer.prototype.strong=function(E){return '<strong>'+E+'</strong>';
+};Renderer.prototype.em=function(E){return '<em>'+E+'</em>';};Renderer.prototype.codespan=function(E){return '<code>'+E+'</code>';};Renderer.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};Renderer.prototype.del=function(E){return '<del>'+E+'</del>';
+};Renderer.prototype.link=function(E,F,G){if(this.options.sanitize){try{var H=decodeURIComponent(unescape(E)).replace(/[^\w:]/g,'').toLowerCase();}catch(e){return '';}if(H.indexOf('javascript:')===0||H.indexOf('vbscript:')===0){return '';}}var I='<a href="'+E+'"';
+if(F){I+=' title="'+F+'"';}I+='>'+G+'</a>';return I;};Renderer.prototype.image=function(E,F,G){var H='<img src="'+E+'" alt="'+G+'"';if(F){H+=' title="'+F+'"';}H+=this.options.xhtml?'/>':'>';return H;};Renderer.prototype.text=function(E){return E;};function Parser(E){this.tokens=[];
+this.token=null;this.options=E||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options;}Parser.parse=function(E,F,G){var H=new Parser(F,G);return H.parse(E);};Parser.prototype.parse=function(E){this.inline=new D(E.links,this.options,this.renderer);
+this.tokens=E.reverse();var F='';while(this.next()){F+=this.tok();}return F;};Parser.prototype.next=function(){return this.token=this.tokens.pop();};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};Parser.prototype.parseText=function(){var E=this.token.text;
+while(this.peek().type==='text'){E+='\n'+this.next().text;}return this.inline.output(E);};Parser.prototype.tok=function(){switch(this.token.type){case 'space':{return '';}case 'hr':{return this.renderer.hr();}case 'heading':{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);
+}case 'code':{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);}case 'table':{var E='',F='',i,G,H,I,j;H='';for(i=0;i<this.token.header.length;i++){I={header:true,align:this.token.align[i]};H+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]}
+);}E+=this.renderer.tablerow(H);for(i=0;i<this.token.cells.length;i++){G=this.token.cells[i];H='';for(j=0;j<G.length;j++){H+=this.renderer.tablecell(this.inline.output(G[j]),{header:false,align:this.token.align[j]});}F+=this.renderer.tablerow(H);}return this.renderer.table(E,F);
+}case 'blockquote_start':{var F='';while(this.next().type!=='blockquote_end'){F+=this.tok();}return this.renderer.blockquote(F);}case 'list_start':{var F='',J=this.token.ordered;while(this.next().type!=='list_end'){F+=this.tok();}return this.renderer.list(F,J);
+}case 'list_item_start':{var F='';while(this.next().type!=='list_item_end'){F+=this.token.type==='text'?this.parseText():this.tok();}return this.renderer.listitem(F);}case 'loose_item_start':{var F='';while(this.next().type!=='list_item_end'){F+=this.tok();
+}return this.renderer.listitem(F);}case 'html':{var K=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;return this.renderer.html(K);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));
+}case 'text':{return this.renderer.paragraph(this.parseText());}}};function escape(E,F){return E.replace(!F?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');}function unescape(E){return E.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(_,n){n=n.toLowerCase();
+if(n==='colon'){return ':';}if(n.charAt(0)==='#'){return n.charAt(1)==='x'?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1));}return '';});}function replace(E,F){E=E.source;F=F||'';return function G(H,I){if(!H){return new RegExp(E,F);
+}I=I.source||I;I=I.replace(/(^|[^\[])\^/g,'$1');E=E.replace(H,I);return G;};}function noop(){}noop.exec=noop;function merge(E){var i=1,F,G;for(;i<arguments.length;i++){F=arguments[i];for(G in F){if(Object.prototype.hasOwnProperty.call(F,G)){E[G]=F[G];}}}return E;
+}function marked(E,F,G){if(G||typeof F==='function'){if(!G){G=F;F=null;}F=merge({},marked.defaults,F||{});var H=F.highlight,I,J,i=0;try{I=B.lex(E,F)}catch(e){return G(e);}J=I.length;var K=function(L){if(L){F.highlight=H;return G(L);}var M;try{M=Parser.parse(I,F);
+}catch(e){L=e;}F.highlight=H;return L?G(L):G(null,M);};if(!H||H.length<3){return K();}delete F.highlight;if(!J){return K();}for(;i<I.length;i++){(function(L){if(L.type!=='code'){return --J||K();}return H(L.text,L.lang,function(M,N){if(M){return K(M);}if(N==null||N===L.text){return --J||K();
+}L.text=N;L.escaped=true;--J||K();});})(I[i]);}return;}try{if(F){F=merge({},marked.defaults,F);}return Parser.parse(B.lex(E,F),F);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';if((F||marked.defaults).silent){return '<p>An error occured:</p><pre>'+escape(e.message+'',true)+'</pre>';
+}throw e;}}marked.options=marked.setOptions=function(E){merge(marked.defaults,E);return marked;};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new Renderer,xhtml:false}
+;marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=B;marked.lexer=B.lex;marked.InlineLexer=D;marked.inlineLexer=D.output;marked.parse=marked;Roo.Markdown.marked=marked;})();
 // Roo/dd/DragDrop.js
 (function(){var A=Roo.EventManager;var B=Roo.lib.Dom;Roo.dd.DragDrop=function(id,C,D){if(id){this.init(id,C,D);}};Roo.extend(Roo.dd.DragDrop,Roo.util.Observable,{id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;
 },unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){}
index 0a37da0..a6b7c02 100644 (file)
@@ -17316,7 +17316,7 @@ Roo.Markdown.toHtml = function(text) {
      * Inline Lexer & Compiler
      */
     
-    function InlineLexer(links, options) {
+    var InlineLexer  = function (links, options) {
       this.options = options || marked.defaults;
       this.links = links;
       this.rules = inline.normal;