roojs-core.js
authorEdward <edward@roojs.com>
Thu, 7 Mar 2019 03:31:38 +0000 (11:31 +0800)
committerEdward <edward@roojs.com>
Thu, 7 Mar 2019 03:31:38 +0000 (11:31 +0800)
roojs-core-debug.js
roojs-all.js
roojs-debug.js

roojs-all.js
roojs-core-debug.js
roojs-core.js
roojs-debug.js

index ddea60d..64711fc 100644 (file)
@@ -687,56 +687,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*/}
-);function Lexer(H){this.tokens=[];this.tokens.links={};this.options=H||G.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}}Lexer.rules=A;Lexer.lex=function(H,I){var J=new Lexer(I);return J.lex(H);
-};Lexer.prototype.lex=function(H){H=H.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(H,true);};Lexer.prototype.token=function(H,I,bq){var H=H.replace(/^ +$/gm,''),J,K,L,M,b,N,O,i,l;while(H){if(L=this.rules.newline.exec(H)){H=H.substring(L[0].length);
-if(L[0].length>1){this.tokens.push({type:'space'});}}if(L=this.rules.code.exec(H)){H=H.substring(L[0].length);L=L[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?L.replace(/\n+$/,''):L});continue;}if(L=this.rules.fences.exec(H)){H=H.substring(L[0].length);
-this.tokens.push({type:'code',lang:L[2],text:L[3]||''});continue;}if(L=this.rules.heading.exec(H)){H=H.substring(L[0].length);this.tokens.push({type:'heading',depth:L[1].length,text:L[2]});continue;}if(I&&(L=this.rules.nptable.exec(H))){H=H.substring(L[0].length);
-N={type:'table',header:L[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:L[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:L[3].replace(/\n$/,'').split('\n')};for(i=0;i<N.align.length;i++){if(/^ *-+: *$/.test(N.align[i])){N.align[i]='right';}else if(/^ *:-+: *$/.test(N.align[i])){N.align[i]='center';
-}else if(/^ *:-+ *$/.test(N.align[i])){N.align[i]='left';}else{N.align[i]=null;}}for(i=0;i<N.cells.length;i++){N.cells[i]=N.cells[i].split(/ *\| */);}this.tokens.push(N);continue;}if(L=this.rules.lheading.exec(H)){H=H.substring(L[0].length);this.tokens.push({type:'heading',depth:L[2]==='='?1:2,text:L[1]}
-);continue;}if(L=this.rules.hr.exec(H)){H=H.substring(L[0].length);this.tokens.push({type:'hr'});continue;}if(L=this.rules.blockquote.exec(H)){H=H.substring(L[0].length);this.tokens.push({type:'blockquote_start'});L=L[0].replace(/^ *> ?/gm,'');this.token(L,I,true);
-this.tokens.push({type:'blockquote_end'});continue;}if(L=this.rules.list.exec(H)){H=H.substring(L[0].length);M=L[2];this.tokens.push({type:'list_start',ordered:M.length>1});L=L[0].match(this.rules.item);J=false;l=L.length;i=0;for(;i<l;i++){N=L[i];O=N.length;
-N=N.replace(/^ *([*+-]|\d+\.) +/,'');if(~N.indexOf('\n ')){O-=N.length;N=!this.options.pedantic?N.replace(new RegExp('^ {1,'+O+'}','gm'),''):N.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(L[i+1])[0];if(M!==b&&!(M.length>1&&b.length>1)){H=L.slice(i+1).join('\n')+H;
-i=l-1;}}K=J||/\n\n(?!\s*$)/.test(N);if(i!==l-1){J=N.charAt(N.length-1)==='\n';if(!K){K=J;}}this.tokens.push({type:K?'loose_item_start':'list_item_start'});this.token(N,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
-continue;}if(L=this.rules.html.exec(H)){H=H.substring(L[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(L[1]==='pre'||L[1]==='script'||L[1]==='style'),text:L[0]});continue;}if((!bq&&I)&&(L=this.rules.def.exec(H))){H=H.substring(L[0].length);
-this.tokens.links[L[1].toLowerCase()]={href:L[2],title:L[3]};continue;}if(I&&(L=this.rules.table.exec(H))){H=H.substring(L[0].length);N={type:'table',header:L[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:L[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:L[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
-;for(i=0;i<N.align.length;i++){if(/^ *-+: *$/.test(N.align[i])){N.align[i]='right';}else if(/^ *:-+: *$/.test(N.align[i])){N.align[i]='center';}else if(/^ *:-+ *$/.test(N.align[i])){N.align[i]='left';}else{N.align[i]=null;}}for(i=0;i<N.cells.length;i++){N.cells[i]=N.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
-}this.tokens.push(N);continue;}if(I&&(L=this.rules.paragraph.exec(H))){H=H.substring(L[0].length);this.tokens.push({type:'paragraph',text:L[1].charAt(L[1].length-1)==='\n'?L[1].slice(0,-1):L[1]});continue;}if(L=this.rules.text.exec(H)){H=H.substring(L[0].length);
-this.tokens.push({type:'text',text:L[0]});continue;}if(H){throw new Error('Infinite loop on byte: '+H.charCodeAt(0));}}return this.tokens;};var B={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|$)/}
+);function Lexer(C){this.tokens=[];this.tokens.links={};this.options=C||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}}Lexer.rules=A;Lexer.lex=function(C,D){var E=new Lexer(D);
+return E.lex(C);};Lexer.prototype.lex=function(C){C=C.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(C,true);};Lexer.prototype.token=function(C,D,bq){var C=C.replace(/^ +$/gm,''),E,F,G,H,b,I,J,i,l;
+while(C){if(G=this.rules.newline.exec(C)){C=C.substring(G[0].length);if(G[0].length>1){this.tokens.push({type:'space'});}}if(G=this.rules.code.exec(C)){C=C.substring(G[0].length);G=G[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?G.replace(/\n+$/,''):G}
+);continue;}if(G=this.rules.fences.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'code',lang:G[2],text:G[3]||''});continue;}if(G=this.rules.heading.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'heading',depth:G[1].length,text:G[2]}
+);continue;}if(D&&(G=this.rules.nptable.exec(C))){C=C.substring(G[0].length);I={type:'table',header:G[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:G[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:G[3].replace(/\n$/,'').split('\n')};for(i=0;i<I.align.length;
+i++){if(/^ *-+: *$/.test(I.align[i])){I.align[i]='right';}else if(/^ *:-+: *$/.test(I.align[i])){I.align[i]='center';}else if(/^ *:-+ *$/.test(I.align[i])){I.align[i]='left';}else{I.align[i]=null;}}for(i=0;i<I.cells.length;i++){I.cells[i]=I.cells[i].split(/ *\| */);
+}this.tokens.push(I);continue;}if(G=this.rules.lheading.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'heading',depth:G[2]==='='?1:2,text:G[1]});continue;}if(G=this.rules.hr.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'hr'});continue;
+}if(G=this.rules.blockquote.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'blockquote_start'});G=G[0].replace(/^ *> ?/gm,'');this.token(G,D,true);this.tokens.push({type:'blockquote_end'});continue;}if(G=this.rules.list.exec(C)){C=C.substring(G[0].length);
+H=G[2];this.tokens.push({type:'list_start',ordered:H.length>1});G=G[0].match(this.rules.item);E=false;l=G.length;i=0;for(;i<l;i++){I=G[i];J=I.length;I=I.replace(/^ *([*+-]|\d+\.) +/,'');if(~I.indexOf('\n ')){J-=I.length;I=!this.options.pedantic?I.replace(new RegExp('^ {1,'+J+'}','gm'),''):I.replace(/^ {1,4}/gm,'');
+}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(G[i+1])[0];if(H!==b&&!(H.length>1&&b.length>1)){C=G.slice(i+1).join('\n')+C;i=l-1;}}F=E||/\n\n(?!\s*$)/.test(I);if(i!==l-1){E=I.charAt(I.length-1)==='\n';if(!F){F=E;}}this.tokens.push({type:F?'loose_item_start':'list_item_start'}
+);this.token(I,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});continue;}if(G=this.rules.html.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(G[1]==='pre'||G[1]==='script'||G[1]==='style'),text:G[0]}
+);continue;}if((!bq&&D)&&(G=this.rules.def.exec(C))){C=C.substring(G[0].length);this.tokens.links[G[1].toLowerCase()]={href:G[2],title:G[3]};continue;}if(D&&(G=this.rules.table.exec(C))){C=C.substring(G[0].length);I={type:'table',header:G[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:G[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:G[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
+;for(i=0;i<I.align.length;i++){if(/^ *-+: *$/.test(I.align[i])){I.align[i]='right';}else if(/^ *:-+: *$/.test(I.align[i])){I.align[i]='center';}else if(/^ *:-+ *$/.test(I.align[i])){I.align[i]='left';}else{I.align[i]=null;}}for(i=0;i<I.cells.length;i++){I.cells[i]=I.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
+}this.tokens.push(I);continue;}if(D&&(G=this.rules.paragraph.exec(C))){C=C.substring(G[0].length);this.tokens.push({type:'paragraph',text:G[1].charAt(G[1].length-1)==='\n'?G[1].slice(0,-1):G[1]});continue;}if(G=this.rules.text.exec(C)){C=C.substring(G[0].length);
+this.tokens.push({type:'text',text:G[0]});continue;}if(C){throw new Error('Infinite loop on byte: '+C.charCodeAt(0));}}return this.tokens;};var B={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|$)/}
 ;B._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;B._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;B.link=replace(B.link)('inside',B._inside)('href',B._href)();B.reflink=replace(B.reflink)('inside',B._inside)();B.normal=merge({},B);B.pedantic=merge({}
 ,B.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});B.gfm=merge({},B.normal,{escape:replace(B.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(B.text)(']|','~]|')('|','|https?://|')()}
-);B.breaks=merge({},B.gfm,{br:replace(B.br)('{2,}','*')(),text:replace(B.gfm.text)('{2,}','*')()});var C=function(H,I){this.options=I||G.defaults;this.links=H;this.rules=B.normal;this.renderer=this.options.renderer||new D;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=B.breaks;}else{this.rules=B.gfm;}}else if(this.options.pedantic){this.rules=B.pedantic;}};C.rules=B;C.output=function(H,I,J){var K=new C(I,J);
-return K.output(H);};C.prototype.output=function(H){var I='',J,K,L,M;while(H){if(M=this.rules.escape.exec(H)){H=H.substring(M[0].length);I+=M[1];continue;}if(M=this.rules.autolink.exec(H)){H=H.substring(M[0].length);if(M[2]==='@'){K=M[1].charAt(6)===':'?this.mangle(M[1].substring(7)):this.mangle(M[1]);
-L=this.mangle('mailto:')+K;}else{K=F(M[1]);L=K;}I+=this.renderer.link(L,null,K);continue;}if(!this.inLink&&(M=this.rules.url.exec(H))){H=H.substring(M[0].length);K=F(M[1]);L=K;I+=this.renderer.link(L,null,K);continue;}if(M=this.rules.tag.exec(H)){if(!this.inLink&&/^<a /i.test(M[0])){this.inLink=true;
-}else if(this.inLink&&/^<\/a>/i.test(M[0])){this.inLink=false;}H=H.substring(M[0].length);I+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(M[0]):F(M[0]):M[0];continue;}if(M=this.rules.link.exec(H)){H=H.substring(M[0].length);this.inLink=true;
-I+=this.outputLink(M,{href:M[2],title:M[3]});this.inLink=false;continue;}if((M=this.rules.reflink.exec(H))||(M=this.rules.nolink.exec(H))){H=H.substring(M[0].length);J=(M[2]||M[1]).replace(/\s+/g,' ');J=this.links[J.toLowerCase()];if(!J||!J.href){I+=M[0].charAt(0);
-H=M[0].substring(1)+H;continue;}this.inLink=true;I+=this.outputLink(M,J);this.inLink=false;continue;}if(M=this.rules.strong.exec(H)){H=H.substring(M[0].length);I+=this.renderer.strong(this.output(M[2]||M[1]));continue;}if(M=this.rules.em.exec(H)){H=H.substring(M[0].length);
-I+=this.renderer.em(this.output(M[2]||M[1]));continue;}if(M=this.rules.code.exec(H)){H=H.substring(M[0].length);I+=this.renderer.codespan(F(M[2],true));continue;}if(M=this.rules.br.exec(H)){H=H.substring(M[0].length);I+=this.renderer.br();continue;}if(M=this.rules.del.exec(H)){H=H.substring(M[0].length);
-I+=this.renderer.del(this.output(M[1]));continue;}if(M=this.rules.text.exec(H)){H=H.substring(M[0].length);I+=this.renderer.text(F(this.smartypants(M[0])));continue;}if(H){throw new Error('Infinite loop on byte: '+H.charCodeAt(0));}}return I;};C.prototype.outputLink=function(H,I){var J=F(I.href),K=I.title?F(I.title):null;
-return H[0].charAt(0)!=='!'?this.renderer.link(J,K,this.output(H[1])):this.renderer.image(J,K,F(H[1]));};C.prototype.smartypants=function(H){if(!this.options.smartypants){return H;}return H.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');
-};C.prototype.mangle=function(H){if(!this.options.mangle){return H;}var I='',l=H.length,i=0,ch;for(;i<l;i++){ch=H.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}I+='&#'+ch+';';}return I;};var D=function(H){this.options=H||{};};D.prototype.code=function(H,I,J){if(this.options.highlight){var K=this.options.highlight(H,I);
-if(K!=null&&K!==H){J=true;H=K;}}else{J=true;}if(!I){return '<pre><code>'+(J?H:F(H,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+F(I,true)+'">'+(J?H:F(H,true))+'\n</code></pre>\n';};D.prototype.blockquote=function(H){return '<blockquote>\n'+H+'</blockquote>\n';
-};D.prototype.html=function(H){return H;};D.prototype.heading=function(H,I,J){return '<h'+I+' id="'+this.options.headerPrefix+J.toLowerCase().replace(/[^\w]+/g,'-')+'">'+H+'</h'+I+'>\n';};D.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
-};D.prototype.list=function(H,I){var J=I?'ol':'ul';return '<'+J+'>\n'+H+'</'+J+'>\n';};D.prototype.listitem=function(H){return '<li>'+H+'</li>\n';};D.prototype.paragraph=function(H){return '<p>'+H+'</p>\n';};D.prototype.table=function(H,I){return '<table class="table table-striped">\n'+'<thead>\n'+H+'</thead>\n'+'<tbody>\n'+I+'</tbody>\n'+'</table>\n';
-};D.prototype.tablerow=function(H){return '<tr>\n'+H+'</tr>\n';};D.prototype.tablecell=function(H,I){var J=I.header?'th':'td';var K=I.align?'<'+J+' style="text-align:'+I.align+'">':'<'+J+'>';return K+H+'</'+J+'>\n';};D.prototype.strong=function(H){return '<strong>'+H+'</strong>';
-};D.prototype.em=function(H){return '<em>'+H+'</em>';};D.prototype.codespan=function(H){return '<code>'+H+'</code>';};D.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};D.prototype.del=function(H){return '<del>'+H+'</del>';};D.prototype.link=function(H,I,J){if(this.options.sanitize){try{var K=decodeURIComponent(unescape(H)).replace(/[^\w:]/g,'').toLowerCase();
-}catch(e){return '';}if(K.indexOf('javascript:')===0||K.indexOf('vbscript:')===0){return '';}}var L='<a href="'+H+'"';if(I){L+=' title="'+I+'"';}L+='>'+J+'</a>';return L;};D.prototype.image=function(H,I,J){var K='<img src="'+H+'" alt="'+J+'"';if(I){K+=' title="'+I+'"';
-}K+=this.options.xhtml?'/>':'>';return K;};D.prototype.text=function(H){return H;};var E=function(H){this.tokens=[];this.token=null;this.options=H||G.defaults;this.options.renderer=this.options.renderer||new D;this.renderer=this.options.renderer;this.renderer.options=this.options;
-};E.parse=function(H,I,J){var K=new E(I,J);return K.parse(H);};E.prototype.parse=function(H){this.inline=new C(H.links,this.options,this.renderer);this.tokens=H.reverse();var I='';while(this.next()){I+=this.tok();}return I;};E.prototype.next=function(){return this.token=this.tokens.pop();
-};E.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};E.prototype.parseText=function(){var H=this.token.text;while(this.peek().type==='text'){H+='\n'+this.next().text;}return this.inline.output(H);};E.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 H='',I='',i,J,K,L,j;
-K='';for(i=0;i<this.token.header.length;i++){L={header:true,align:this.token.align[i]};K+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]});}H+=this.renderer.tablerow(K);for(i=0;i<this.token.cells.length;
-i++){J=this.token.cells[i];K='';for(j=0;j<J.length;j++){K+=this.renderer.tablecell(this.inline.output(J[j]),{header:false,align:this.token.align[j]});}I+=this.renderer.tablerow(K);}return this.renderer.table(H,I);}case 'blockquote_start':{var I='';while(this.next().type!=='blockquote_end'){I+=this.tok();
-}return this.renderer.blockquote(I);}case 'list_start':{var I='',M=this.token.ordered;while(this.next().type!=='list_end'){I+=this.tok();}return this.renderer.list(I,M);}case 'list_item_start':{var I='';while(this.next().type!=='list_item_end'){I+=this.token.type==='text'?this.parseText():this.tok();
-}return this.renderer.listitem(I);}case 'loose_item_start':{var I='';while(this.next().type!=='list_item_end'){I+=this.tok();}return this.renderer.listitem(I);}case 'html':{var N=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;
-return this.renderer.html(N);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));}case 'text':{return this.renderer.paragraph(this.parseText());}}};var F=function(H,I){return H.replace(!I?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');
-};var unescape=function(H){return H.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 '';});};var replace=function(H,I){H=H.source;I=I||'';return function J(K,L){if(!K){return new RegExp(H,I);}L=L.source||L;L=L.replace(/(^|[^\[])\^/g,'$1');H=H.replace(K,L);return J;};};var noop=function(){};noop.exec=noop;function merge(H){var i=1,I,J;
-for(;i<arguments.length;i++){I=arguments[i];for(J in I){if(Object.prototype.hasOwnProperty.call(I,J)){H[J]=I[J];}}}return H;}var G=function(H,I,J){if(J||typeof I==='function'){if(!J){J=I;I=null;}I=merge({},G.defaults,I||{});var K=I.highlight,L,M,i=0;try{L=Lexer.lex(H,I)}
-catch(e){return J(e);}M=L.length;var N=function(O){if(O){I.highlight=K;return J(O);}var P;try{P=E.parse(L,I);}catch(e){O=e;}I.highlight=K;return O?J(O):J(null,P);};if(!K||K.length<3){return N();}delete I.highlight;if(!M){return N();}for(;i<L.length;i++){(function(O){if(O.type!=='code'){return --M||N();
-}return K(O.text,O.lang,function(P,Q){if(P){return N(P);}if(Q==null||Q===O.text){return --M||N();}O.text=Q;O.escaped=true;--M||N();});})(L[i]);}return;}try{if(I){I=merge({},G.defaults,I);}return E.parse(Lexer.lex(H,I),I);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';
-if((I||G.defaults).silent){return '<p>An error occured:</p><pre>'+F(e.message+'',true)+'</pre>';}throw e;}};G.options=G.setOptions=function(H){merge(G.defaults,H);return G;};G.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 D,xhtml:false}
-;G.Parser=E;G.parser=E.parse;G.Renderer=D;G.Lexer=Lexer;G.lexer=Lexer.lex;G.InlineLexer=C;G.inlineLexer=C.output;G.parse=G;Roo.Markdown.marked=G;})();
+);B.breaks=merge({},B.gfm,{br:replace(B.br)('{2,}','*')(),text:replace(B.gfm.text)('{2,}','*')()});function InlineLexer(C,D){this.options=D||marked.defaults;this.links=C;this.rules=B.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=B.breaks;}else{this.rules=B.gfm;}}else if(this.options.pedantic){this.rules=B.pedantic;}}InlineLexer.rules=B;InlineLexer.output=function(C,D,E){var F=new InlineLexer(D,E);
+return F.output(C);};InlineLexer.prototype.output=function(C){var D='',E,F,G,H;while(C){if(H=this.rules.escape.exec(C)){C=C.substring(H[0].length);D+=H[1];continue;}if(H=this.rules.autolink.exec(C)){C=C.substring(H[0].length);if(H[2]==='@'){F=H[1].charAt(6)===':'?this.mangle(H[1].substring(7)):this.mangle(H[1]);
+G=this.mangle('mailto:')+F;}else{F=escape(H[1]);G=F;}D+=this.renderer.link(G,null,F);continue;}if(!this.inLink&&(H=this.rules.url.exec(C))){C=C.substring(H[0].length);F=escape(H[1]);G=F;D+=this.renderer.link(G,null,F);continue;}if(H=this.rules.tag.exec(C)){if(!this.inLink&&/^<a /i.test(H[0])){this.inLink=true;
+}else if(this.inLink&&/^<\/a>/i.test(H[0])){this.inLink=false;}C=C.substring(H[0].length);D+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(H[0]):escape(H[0]):H[0];continue;}if(H=this.rules.link.exec(C)){C=C.substring(H[0].length);this.inLink=true;
+D+=this.outputLink(H,{href:H[2],title:H[3]});this.inLink=false;continue;}if((H=this.rules.reflink.exec(C))||(H=this.rules.nolink.exec(C))){C=C.substring(H[0].length);E=(H[2]||H[1]).replace(/\s+/g,' ');E=this.links[E.toLowerCase()];if(!E||!E.href){D+=H[0].charAt(0);
+C=H[0].substring(1)+C;continue;}this.inLink=true;D+=this.outputLink(H,E);this.inLink=false;continue;}if(H=this.rules.strong.exec(C)){C=C.substring(H[0].length);D+=this.renderer.strong(this.output(H[2]||H[1]));continue;}if(H=this.rules.em.exec(C)){C=C.substring(H[0].length);
+D+=this.renderer.em(this.output(H[2]||H[1]));continue;}if(H=this.rules.code.exec(C)){C=C.substring(H[0].length);D+=this.renderer.codespan(escape(H[2],true));continue;}if(H=this.rules.br.exec(C)){C=C.substring(H[0].length);D+=this.renderer.br();continue;}if(H=this.rules.del.exec(C)){C=C.substring(H[0].length);
+D+=this.renderer.del(this.output(H[1]));continue;}if(H=this.rules.text.exec(C)){C=C.substring(H[0].length);D+=this.renderer.text(escape(this.smartypants(H[0])));continue;}if(C){throw new Error('Infinite loop on byte: '+C.charCodeAt(0));}}return D;};InlineLexer.prototype.outputLink=function(C,D){var E=escape(D.href),F=D.title?escape(D.title):null;
+return C[0].charAt(0)!=='!'?this.renderer.link(E,F,this.output(C[1])):this.renderer.image(E,F,escape(C[1]));};InlineLexer.prototype.smartypants=function(C){if(!this.options.smartypants){return C;}return C.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(C){if(!this.options.mangle){return C;}var D='',l=C.length,i=0,ch;for(;i<l;i++){ch=C.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}D+='&#'+ch+';';}return D;};function Renderer(C){this.options=C||{};}Renderer.prototype.code=function(C,D,E){if(this.options.highlight){var F=this.options.highlight(C,D);
+if(F!=null&&F!==C){E=true;C=F;}}else{E=true;}if(!D){return '<pre><code>'+(E?C:escape(C,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+escape(D,true)+'">'+(E?C:escape(C,true))+'\n</code></pre>\n';};Renderer.prototype.blockquote=function(C){return '<blockquote>\n'+C+'</blockquote>\n';
+};Renderer.prototype.html=function(C){return C;};Renderer.prototype.heading=function(C,D,E){return '<h'+D+' id="'+this.options.headerPrefix+E.toLowerCase().replace(/[^\w]+/g,'-')+'">'+C+'</h'+D+'>\n';};Renderer.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
+};Renderer.prototype.list=function(C,D){var E=D?'ol':'ul';return '<'+E+'>\n'+C+'</'+E+'>\n';};Renderer.prototype.listitem=function(C){return '<li>'+C+'</li>\n';};Renderer.prototype.paragraph=function(C){return '<p>'+C+'</p>\n';};Renderer.prototype.table=function(C,D){return '<table class="table table-striped">\n'+'<thead>\n'+C+'</thead>\n'+'<tbody>\n'+D+'</tbody>\n'+'</table>\n';
+};Renderer.prototype.tablerow=function(C){return '<tr>\n'+C+'</tr>\n';};Renderer.prototype.tablecell=function(C,D){var E=D.header?'th':'td';var F=D.align?'<'+E+' style="text-align:'+D.align+'">':'<'+E+'>';return F+C+'</'+E+'>\n';};Renderer.prototype.strong=function(C){return '<strong>'+C+'</strong>';
+};Renderer.prototype.em=function(C){return '<em>'+C+'</em>';};Renderer.prototype.codespan=function(C){return '<code>'+C+'</code>';};Renderer.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};Renderer.prototype.del=function(C){return '<del>'+C+'</del>';
+};Renderer.prototype.link=function(C,D,E){if(this.options.sanitize){try{var F=decodeURIComponent(unescape(C)).replace(/[^\w:]/g,'').toLowerCase();}catch(e){return '';}if(F.indexOf('javascript:')===0||F.indexOf('vbscript:')===0){return '';}}var G='<a href="'+C+'"';
+if(D){G+=' title="'+D+'"';}G+='>'+E+'</a>';return G;};Renderer.prototype.image=function(C,D,E){var F='<img src="'+C+'" alt="'+E+'"';if(D){F+=' title="'+D+'"';}F+=this.options.xhtml?'/>':'>';return F;};Renderer.prototype.text=function(C){return C;};function Parser(C){this.tokens=[];
+this.token=null;this.options=C||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options;}Parser.parse=function(C,D,E){var F=new Parser(D,E);return F.parse(C);};Parser.prototype.parse=function(C){this.inline=new InlineLexer(C.links,this.options,this.renderer);
+this.tokens=C.reverse();var D='';while(this.next()){D+=this.tok();}return D;};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 C=this.token.text;
+while(this.peek().type==='text'){C+='\n'+this.next().text;}return this.inline.output(C);};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 C='',D='',i,E,F,G,j;F='';for(i=0;i<this.token.header.length;i++){G={header:true,align:this.token.align[i]};F+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]}
+);}C+=this.renderer.tablerow(F);for(i=0;i<this.token.cells.length;i++){E=this.token.cells[i];F='';for(j=0;j<E.length;j++){F+=this.renderer.tablecell(this.inline.output(E[j]),{header:false,align:this.token.align[j]});}D+=this.renderer.tablerow(F);}return this.renderer.table(C,D);
+}case 'blockquote_start':{var D='';while(this.next().type!=='blockquote_end'){D+=this.tok();}return this.renderer.blockquote(D);}case 'list_start':{var D='',H=this.token.ordered;while(this.next().type!=='list_end'){D+=this.tok();}return this.renderer.list(D,H);
+}case 'list_item_start':{var D='';while(this.next().type!=='list_item_end'){D+=this.token.type==='text'?this.parseText():this.tok();}return this.renderer.listitem(D);}case 'loose_item_start':{var D='';while(this.next().type!=='list_item_end'){D+=this.tok();
+}return this.renderer.listitem(D);}case 'html':{var I=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;return this.renderer.html(I);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));
+}case 'text':{return this.renderer.paragraph(this.parseText());}}};function escape(C,D){return C.replace(!D?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');}function unescape(C){return C.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(C,D){C=C.source;D=D||'';return function E(F,G){if(!F){return new RegExp(C,D);
+}G=G.source||G;G=G.replace(/(^|[^\[])\^/g,'$1');C=C.replace(F,G);return E;};}function noop(){}noop.exec=noop;function merge(C){var i=1,D,E;for(;i<arguments.length;i++){D=arguments[i];for(E in D){if(Object.prototype.hasOwnProperty.call(D,E)){C[E]=D[E];}}}return C;
+}function marked(C,D,E){if(E||typeof D==='function'){if(!E){E=D;D=null;}D=merge({},marked.defaults,D||{});var F=D.highlight,G,H,i=0;try{G=Lexer.lex(C,D)}catch(e){return E(e);}H=G.length;var I=function(J){if(J){D.highlight=F;return E(J);}var K;try{K=Parser.parse(G,D);
+}catch(e){J=e;}D.highlight=F;return J?E(J):E(null,K);};if(!F||F.length<3){return I();}delete D.highlight;if(!H){return I();}for(;i<G.length;i++){(function(J){if(J.type!=='code'){return --H||I();}return F(J.text,J.lang,function(K,L){if(K){return I(K);}if(L==null||L===J.text){return --H||I();
+}J.text=L;J.escaped=true;--H||I();});})(G[i]);}return;}try{if(D){D=merge({},marked.defaults,D);}return Parser.parse(Lexer.lex(C,D),D);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';if((D||marked.defaults).silent){return '<p>An error occured:</p><pre>'+escape(e.message+'',true)+'</pre>';
+}throw e;}}marked.options=marked.setOptions=function(C){merge(marked.defaults,C);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=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.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 8518bdc..1b155c5 100644 (file)
@@ -17311,7 +17311,7 @@ Roo.Markdown.toHtml = function(text) {
      * Inline Lexer & Compiler
      */
     
-    var InlineLexer = function (links, options) {
+    function InlineLexer(links, options) {
       this.options = options || marked.defaults;
       this.links = links;
       this.rules = inline.normal;
@@ -17551,7 +17551,7 @@ Roo.Markdown.toHtml = function(text) {
      * Renderer
      */
     
-    var Renderer = function (options) {
+    function Renderer(options) {
       this.options = options || {};
     }
     
@@ -17701,7 +17701,7 @@ Roo.Markdown.toHtml = function(text) {
      * Parsing & Compiling
      */
     
-    var Parser = function (options) {
+    function Parser(options) {
       this.tokens = [];
       this.token = null;
       this.options = options || marked.defaults;
@@ -17881,7 +17881,7 @@ Roo.Markdown.toHtml = function(text) {
      * Helpers
      */
     
-    var escape = function (html, encode) {
+    function escape(html, encode) {
       return html
         .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&amp;')
         .replace(/</g, '&lt;')
@@ -17890,7 +17890,7 @@ Roo.Markdown.toHtml = function(text) {
         .replace(/'/g, '&#39;');
     }
     
-    var unescape = function (html) {
+    function unescape(html) {
         // explicitly match decimal, hex, and named HTML entities 
       return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function(_, n) {
         n = n.toLowerCase();
@@ -17904,7 +17904,7 @@ Roo.Markdown.toHtml = function(text) {
       });
     }
     
-    var replace = function (regex, opt) {
+    function replace(regex, opt) {
       regex = regex.source;
       opt = opt || '';
       return function self(name, val) {
@@ -17916,7 +17916,7 @@ Roo.Markdown.toHtml = function(text) {
       };
     }
     
-    var noop = function () {}
+    function noop() {}
     noop.exec = noop;
     
     function merge(obj) {
@@ -17941,7 +17941,7 @@ Roo.Markdown.toHtml = function(text) {
      * Marked
      */
     
-    var marked = function (src, opt, callback) {
+    function marked(src, opt, callback) {
       if (callback || typeof opt === 'function') {
         if (!callback) {
           callback = opt;
index ae714ee..0948a1a 100644 (file)
@@ -687,56 +687,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*/}
-);function Lexer(H){this.tokens=[];this.tokens.links={};this.options=H||G.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}}Lexer.rules=A;Lexer.lex=function(H,I){var J=new Lexer(I);return J.lex(H);
-};Lexer.prototype.lex=function(H){H=H.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(H,true);};Lexer.prototype.token=function(H,I,bq){var H=H.replace(/^ +$/gm,''),J,K,L,M,b,N,O,i,l;while(H){if(L=this.rules.newline.exec(H)){H=H.substring(L[0].length);
-if(L[0].length>1){this.tokens.push({type:'space'});}}if(L=this.rules.code.exec(H)){H=H.substring(L[0].length);L=L[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?L.replace(/\n+$/,''):L});continue;}if(L=this.rules.fences.exec(H)){H=H.substring(L[0].length);
-this.tokens.push({type:'code',lang:L[2],text:L[3]||''});continue;}if(L=this.rules.heading.exec(H)){H=H.substring(L[0].length);this.tokens.push({type:'heading',depth:L[1].length,text:L[2]});continue;}if(I&&(L=this.rules.nptable.exec(H))){H=H.substring(L[0].length);
-N={type:'table',header:L[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:L[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:L[3].replace(/\n$/,'').split('\n')};for(i=0;i<N.align.length;i++){if(/^ *-+: *$/.test(N.align[i])){N.align[i]='right';}else if(/^ *:-+: *$/.test(N.align[i])){N.align[i]='center';
-}else if(/^ *:-+ *$/.test(N.align[i])){N.align[i]='left';}else{N.align[i]=null;}}for(i=0;i<N.cells.length;i++){N.cells[i]=N.cells[i].split(/ *\| */);}this.tokens.push(N);continue;}if(L=this.rules.lheading.exec(H)){H=H.substring(L[0].length);this.tokens.push({type:'heading',depth:L[2]==='='?1:2,text:L[1]}
-);continue;}if(L=this.rules.hr.exec(H)){H=H.substring(L[0].length);this.tokens.push({type:'hr'});continue;}if(L=this.rules.blockquote.exec(H)){H=H.substring(L[0].length);this.tokens.push({type:'blockquote_start'});L=L[0].replace(/^ *> ?/gm,'');this.token(L,I,true);
-this.tokens.push({type:'blockquote_end'});continue;}if(L=this.rules.list.exec(H)){H=H.substring(L[0].length);M=L[2];this.tokens.push({type:'list_start',ordered:M.length>1});L=L[0].match(this.rules.item);J=false;l=L.length;i=0;for(;i<l;i++){N=L[i];O=N.length;
-N=N.replace(/^ *([*+-]|\d+\.) +/,'');if(~N.indexOf('\n ')){O-=N.length;N=!this.options.pedantic?N.replace(new RegExp('^ {1,'+O+'}','gm'),''):N.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(L[i+1])[0];if(M!==b&&!(M.length>1&&b.length>1)){H=L.slice(i+1).join('\n')+H;
-i=l-1;}}K=J||/\n\n(?!\s*$)/.test(N);if(i!==l-1){J=N.charAt(N.length-1)==='\n';if(!K){K=J;}}this.tokens.push({type:K?'loose_item_start':'list_item_start'});this.token(N,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
-continue;}if(L=this.rules.html.exec(H)){H=H.substring(L[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(L[1]==='pre'||L[1]==='script'||L[1]==='style'),text:L[0]});continue;}if((!bq&&I)&&(L=this.rules.def.exec(H))){H=H.substring(L[0].length);
-this.tokens.links[L[1].toLowerCase()]={href:L[2],title:L[3]};continue;}if(I&&(L=this.rules.table.exec(H))){H=H.substring(L[0].length);N={type:'table',header:L[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:L[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:L[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
-;for(i=0;i<N.align.length;i++){if(/^ *-+: *$/.test(N.align[i])){N.align[i]='right';}else if(/^ *:-+: *$/.test(N.align[i])){N.align[i]='center';}else if(/^ *:-+ *$/.test(N.align[i])){N.align[i]='left';}else{N.align[i]=null;}}for(i=0;i<N.cells.length;i++){N.cells[i]=N.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
-}this.tokens.push(N);continue;}if(I&&(L=this.rules.paragraph.exec(H))){H=H.substring(L[0].length);this.tokens.push({type:'paragraph',text:L[1].charAt(L[1].length-1)==='\n'?L[1].slice(0,-1):L[1]});continue;}if(L=this.rules.text.exec(H)){H=H.substring(L[0].length);
-this.tokens.push({type:'text',text:L[0]});continue;}if(H){throw new Error('Infinite loop on byte: '+H.charCodeAt(0));}}return this.tokens;};var B={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|$)/}
+);function Lexer(C){this.tokens=[];this.tokens.links={};this.options=C||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}}Lexer.rules=A;Lexer.lex=function(C,D){var E=new Lexer(D);
+return E.lex(C);};Lexer.prototype.lex=function(C){C=C.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(C,true);};Lexer.prototype.token=function(C,D,bq){var C=C.replace(/^ +$/gm,''),E,F,G,H,b,I,J,i,l;
+while(C){if(G=this.rules.newline.exec(C)){C=C.substring(G[0].length);if(G[0].length>1){this.tokens.push({type:'space'});}}if(G=this.rules.code.exec(C)){C=C.substring(G[0].length);G=G[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?G.replace(/\n+$/,''):G}
+);continue;}if(G=this.rules.fences.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'code',lang:G[2],text:G[3]||''});continue;}if(G=this.rules.heading.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'heading',depth:G[1].length,text:G[2]}
+);continue;}if(D&&(G=this.rules.nptable.exec(C))){C=C.substring(G[0].length);I={type:'table',header:G[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:G[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:G[3].replace(/\n$/,'').split('\n')};for(i=0;i<I.align.length;
+i++){if(/^ *-+: *$/.test(I.align[i])){I.align[i]='right';}else if(/^ *:-+: *$/.test(I.align[i])){I.align[i]='center';}else if(/^ *:-+ *$/.test(I.align[i])){I.align[i]='left';}else{I.align[i]=null;}}for(i=0;i<I.cells.length;i++){I.cells[i]=I.cells[i].split(/ *\| */);
+}this.tokens.push(I);continue;}if(G=this.rules.lheading.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'heading',depth:G[2]==='='?1:2,text:G[1]});continue;}if(G=this.rules.hr.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'hr'});continue;
+}if(G=this.rules.blockquote.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'blockquote_start'});G=G[0].replace(/^ *> ?/gm,'');this.token(G,D,true);this.tokens.push({type:'blockquote_end'});continue;}if(G=this.rules.list.exec(C)){C=C.substring(G[0].length);
+H=G[2];this.tokens.push({type:'list_start',ordered:H.length>1});G=G[0].match(this.rules.item);E=false;l=G.length;i=0;for(;i<l;i++){I=G[i];J=I.length;I=I.replace(/^ *([*+-]|\d+\.) +/,'');if(~I.indexOf('\n ')){J-=I.length;I=!this.options.pedantic?I.replace(new RegExp('^ {1,'+J+'}','gm'),''):I.replace(/^ {1,4}/gm,'');
+}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(G[i+1])[0];if(H!==b&&!(H.length>1&&b.length>1)){C=G.slice(i+1).join('\n')+C;i=l-1;}}F=E||/\n\n(?!\s*$)/.test(I);if(i!==l-1){E=I.charAt(I.length-1)==='\n';if(!F){F=E;}}this.tokens.push({type:F?'loose_item_start':'list_item_start'}
+);this.token(I,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});continue;}if(G=this.rules.html.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(G[1]==='pre'||G[1]==='script'||G[1]==='style'),text:G[0]}
+);continue;}if((!bq&&D)&&(G=this.rules.def.exec(C))){C=C.substring(G[0].length);this.tokens.links[G[1].toLowerCase()]={href:G[2],title:G[3]};continue;}if(D&&(G=this.rules.table.exec(C))){C=C.substring(G[0].length);I={type:'table',header:G[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:G[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:G[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
+;for(i=0;i<I.align.length;i++){if(/^ *-+: *$/.test(I.align[i])){I.align[i]='right';}else if(/^ *:-+: *$/.test(I.align[i])){I.align[i]='center';}else if(/^ *:-+ *$/.test(I.align[i])){I.align[i]='left';}else{I.align[i]=null;}}for(i=0;i<I.cells.length;i++){I.cells[i]=I.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
+}this.tokens.push(I);continue;}if(D&&(G=this.rules.paragraph.exec(C))){C=C.substring(G[0].length);this.tokens.push({type:'paragraph',text:G[1].charAt(G[1].length-1)==='\n'?G[1].slice(0,-1):G[1]});continue;}if(G=this.rules.text.exec(C)){C=C.substring(G[0].length);
+this.tokens.push({type:'text',text:G[0]});continue;}if(C){throw new Error('Infinite loop on byte: '+C.charCodeAt(0));}}return this.tokens;};var B={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|$)/}
 ;B._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;B._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;B.link=replace(B.link)('inside',B._inside)('href',B._href)();B.reflink=replace(B.reflink)('inside',B._inside)();B.normal=merge({},B);B.pedantic=merge({}
 ,B.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});B.gfm=merge({},B.normal,{escape:replace(B.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(B.text)(']|','~]|')('|','|https?://|')()}
-);B.breaks=merge({},B.gfm,{br:replace(B.br)('{2,}','*')(),text:replace(B.gfm.text)('{2,}','*')()});var C=function(H,I){this.options=I||G.defaults;this.links=H;this.rules=B.normal;this.renderer=this.options.renderer||new D;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=B.breaks;}else{this.rules=B.gfm;}}else if(this.options.pedantic){this.rules=B.pedantic;}};C.rules=B;C.output=function(H,I,J){var K=new C(I,J);
-return K.output(H);};C.prototype.output=function(H){var I='',J,K,L,M;while(H){if(M=this.rules.escape.exec(H)){H=H.substring(M[0].length);I+=M[1];continue;}if(M=this.rules.autolink.exec(H)){H=H.substring(M[0].length);if(M[2]==='@'){K=M[1].charAt(6)===':'?this.mangle(M[1].substring(7)):this.mangle(M[1]);
-L=this.mangle('mailto:')+K;}else{K=F(M[1]);L=K;}I+=this.renderer.link(L,null,K);continue;}if(!this.inLink&&(M=this.rules.url.exec(H))){H=H.substring(M[0].length);K=F(M[1]);L=K;I+=this.renderer.link(L,null,K);continue;}if(M=this.rules.tag.exec(H)){if(!this.inLink&&/^<a /i.test(M[0])){this.inLink=true;
-}else if(this.inLink&&/^<\/a>/i.test(M[0])){this.inLink=false;}H=H.substring(M[0].length);I+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(M[0]):F(M[0]):M[0];continue;}if(M=this.rules.link.exec(H)){H=H.substring(M[0].length);this.inLink=true;
-I+=this.outputLink(M,{href:M[2],title:M[3]});this.inLink=false;continue;}if((M=this.rules.reflink.exec(H))||(M=this.rules.nolink.exec(H))){H=H.substring(M[0].length);J=(M[2]||M[1]).replace(/\s+/g,' ');J=this.links[J.toLowerCase()];if(!J||!J.href){I+=M[0].charAt(0);
-H=M[0].substring(1)+H;continue;}this.inLink=true;I+=this.outputLink(M,J);this.inLink=false;continue;}if(M=this.rules.strong.exec(H)){H=H.substring(M[0].length);I+=this.renderer.strong(this.output(M[2]||M[1]));continue;}if(M=this.rules.em.exec(H)){H=H.substring(M[0].length);
-I+=this.renderer.em(this.output(M[2]||M[1]));continue;}if(M=this.rules.code.exec(H)){H=H.substring(M[0].length);I+=this.renderer.codespan(F(M[2],true));continue;}if(M=this.rules.br.exec(H)){H=H.substring(M[0].length);I+=this.renderer.br();continue;}if(M=this.rules.del.exec(H)){H=H.substring(M[0].length);
-I+=this.renderer.del(this.output(M[1]));continue;}if(M=this.rules.text.exec(H)){H=H.substring(M[0].length);I+=this.renderer.text(F(this.smartypants(M[0])));continue;}if(H){throw new Error('Infinite loop on byte: '+H.charCodeAt(0));}}return I;};C.prototype.outputLink=function(H,I){var J=F(I.href),K=I.title?F(I.title):null;
-return H[0].charAt(0)!=='!'?this.renderer.link(J,K,this.output(H[1])):this.renderer.image(J,K,F(H[1]));};C.prototype.smartypants=function(H){if(!this.options.smartypants){return H;}return H.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');
-};C.prototype.mangle=function(H){if(!this.options.mangle){return H;}var I='',l=H.length,i=0,ch;for(;i<l;i++){ch=H.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}I+='&#'+ch+';';}return I;};var D=function(H){this.options=H||{};};D.prototype.code=function(H,I,J){if(this.options.highlight){var K=this.options.highlight(H,I);
-if(K!=null&&K!==H){J=true;H=K;}}else{J=true;}if(!I){return '<pre><code>'+(J?H:F(H,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+F(I,true)+'">'+(J?H:F(H,true))+'\n</code></pre>\n';};D.prototype.blockquote=function(H){return '<blockquote>\n'+H+'</blockquote>\n';
-};D.prototype.html=function(H){return H;};D.prototype.heading=function(H,I,J){return '<h'+I+' id="'+this.options.headerPrefix+J.toLowerCase().replace(/[^\w]+/g,'-')+'">'+H+'</h'+I+'>\n';};D.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
-};D.prototype.list=function(H,I){var J=I?'ol':'ul';return '<'+J+'>\n'+H+'</'+J+'>\n';};D.prototype.listitem=function(H){return '<li>'+H+'</li>\n';};D.prototype.paragraph=function(H){return '<p>'+H+'</p>\n';};D.prototype.table=function(H,I){return '<table class="table table-striped">\n'+'<thead>\n'+H+'</thead>\n'+'<tbody>\n'+I+'</tbody>\n'+'</table>\n';
-};D.prototype.tablerow=function(H){return '<tr>\n'+H+'</tr>\n';};D.prototype.tablecell=function(H,I){var J=I.header?'th':'td';var K=I.align?'<'+J+' style="text-align:'+I.align+'">':'<'+J+'>';return K+H+'</'+J+'>\n';};D.prototype.strong=function(H){return '<strong>'+H+'</strong>';
-};D.prototype.em=function(H){return '<em>'+H+'</em>';};D.prototype.codespan=function(H){return '<code>'+H+'</code>';};D.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};D.prototype.del=function(H){return '<del>'+H+'</del>';};D.prototype.link=function(H,I,J){if(this.options.sanitize){try{var K=decodeURIComponent(unescape(H)).replace(/[^\w:]/g,'').toLowerCase();
-}catch(e){return '';}if(K.indexOf('javascript:')===0||K.indexOf('vbscript:')===0){return '';}}var L='<a href="'+H+'"';if(I){L+=' title="'+I+'"';}L+='>'+J+'</a>';return L;};D.prototype.image=function(H,I,J){var K='<img src="'+H+'" alt="'+J+'"';if(I){K+=' title="'+I+'"';
-}K+=this.options.xhtml?'/>':'>';return K;};D.prototype.text=function(H){return H;};var E=function(H){this.tokens=[];this.token=null;this.options=H||G.defaults;this.options.renderer=this.options.renderer||new D;this.renderer=this.options.renderer;this.renderer.options=this.options;
-};E.parse=function(H,I,J){var K=new E(I,J);return K.parse(H);};E.prototype.parse=function(H){this.inline=new C(H.links,this.options,this.renderer);this.tokens=H.reverse();var I='';while(this.next()){I+=this.tok();}return I;};E.prototype.next=function(){return this.token=this.tokens.pop();
-};E.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};E.prototype.parseText=function(){var H=this.token.text;while(this.peek().type==='text'){H+='\n'+this.next().text;}return this.inline.output(H);};E.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 H='',I='',i,J,K,L,j;
-K='';for(i=0;i<this.token.header.length;i++){L={header:true,align:this.token.align[i]};K+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]});}H+=this.renderer.tablerow(K);for(i=0;i<this.token.cells.length;
-i++){J=this.token.cells[i];K='';for(j=0;j<J.length;j++){K+=this.renderer.tablecell(this.inline.output(J[j]),{header:false,align:this.token.align[j]});}I+=this.renderer.tablerow(K);}return this.renderer.table(H,I);}case 'blockquote_start':{var I='';while(this.next().type!=='blockquote_end'){I+=this.tok();
-}return this.renderer.blockquote(I);}case 'list_start':{var I='',M=this.token.ordered;while(this.next().type!=='list_end'){I+=this.tok();}return this.renderer.list(I,M);}case 'list_item_start':{var I='';while(this.next().type!=='list_item_end'){I+=this.token.type==='text'?this.parseText():this.tok();
-}return this.renderer.listitem(I);}case 'loose_item_start':{var I='';while(this.next().type!=='list_item_end'){I+=this.tok();}return this.renderer.listitem(I);}case 'html':{var N=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;
-return this.renderer.html(N);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));}case 'text':{return this.renderer.paragraph(this.parseText());}}};var F=function(H,I){return H.replace(!I?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');
-};var unescape=function(H){return H.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 '';});};var replace=function(H,I){H=H.source;I=I||'';return function J(K,L){if(!K){return new RegExp(H,I);}L=L.source||L;L=L.replace(/(^|[^\[])\^/g,'$1');H=H.replace(K,L);return J;};};var noop=function(){};noop.exec=noop;function merge(H){var i=1,I,J;
-for(;i<arguments.length;i++){I=arguments[i];for(J in I){if(Object.prototype.hasOwnProperty.call(I,J)){H[J]=I[J];}}}return H;}var G=function(H,I,J){if(J||typeof I==='function'){if(!J){J=I;I=null;}I=merge({},G.defaults,I||{});var K=I.highlight,L,M,i=0;try{L=Lexer.lex(H,I)}
-catch(e){return J(e);}M=L.length;var N=function(O){if(O){I.highlight=K;return J(O);}var P;try{P=E.parse(L,I);}catch(e){O=e;}I.highlight=K;return O?J(O):J(null,P);};if(!K||K.length<3){return N();}delete I.highlight;if(!M){return N();}for(;i<L.length;i++){(function(O){if(O.type!=='code'){return --M||N();
-}return K(O.text,O.lang,function(P,Q){if(P){return N(P);}if(Q==null||Q===O.text){return --M||N();}O.text=Q;O.escaped=true;--M||N();});})(L[i]);}return;}try{if(I){I=merge({},G.defaults,I);}return E.parse(Lexer.lex(H,I),I);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';
-if((I||G.defaults).silent){return '<p>An error occured:</p><pre>'+F(e.message+'',true)+'</pre>';}throw e;}};G.options=G.setOptions=function(H){merge(G.defaults,H);return G;};G.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 D,xhtml:false}
-;G.Parser=E;G.parser=E.parse;G.Renderer=D;G.Lexer=Lexer;G.lexer=Lexer.lex;G.InlineLexer=C;G.inlineLexer=C.output;G.parse=G;Roo.Markdown.marked=G;})();
+);B.breaks=merge({},B.gfm,{br:replace(B.br)('{2,}','*')(),text:replace(B.gfm.text)('{2,}','*')()});function InlineLexer(C,D){this.options=D||marked.defaults;this.links=C;this.rules=B.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=B.breaks;}else{this.rules=B.gfm;}}else if(this.options.pedantic){this.rules=B.pedantic;}}InlineLexer.rules=B;InlineLexer.output=function(C,D,E){var F=new InlineLexer(D,E);
+return F.output(C);};InlineLexer.prototype.output=function(C){var D='',E,F,G,H;while(C){if(H=this.rules.escape.exec(C)){C=C.substring(H[0].length);D+=H[1];continue;}if(H=this.rules.autolink.exec(C)){C=C.substring(H[0].length);if(H[2]==='@'){F=H[1].charAt(6)===':'?this.mangle(H[1].substring(7)):this.mangle(H[1]);
+G=this.mangle('mailto:')+F;}else{F=escape(H[1]);G=F;}D+=this.renderer.link(G,null,F);continue;}if(!this.inLink&&(H=this.rules.url.exec(C))){C=C.substring(H[0].length);F=escape(H[1]);G=F;D+=this.renderer.link(G,null,F);continue;}if(H=this.rules.tag.exec(C)){if(!this.inLink&&/^<a /i.test(H[0])){this.inLink=true;
+}else if(this.inLink&&/^<\/a>/i.test(H[0])){this.inLink=false;}C=C.substring(H[0].length);D+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(H[0]):escape(H[0]):H[0];continue;}if(H=this.rules.link.exec(C)){C=C.substring(H[0].length);this.inLink=true;
+D+=this.outputLink(H,{href:H[2],title:H[3]});this.inLink=false;continue;}if((H=this.rules.reflink.exec(C))||(H=this.rules.nolink.exec(C))){C=C.substring(H[0].length);E=(H[2]||H[1]).replace(/\s+/g,' ');E=this.links[E.toLowerCase()];if(!E||!E.href){D+=H[0].charAt(0);
+C=H[0].substring(1)+C;continue;}this.inLink=true;D+=this.outputLink(H,E);this.inLink=false;continue;}if(H=this.rules.strong.exec(C)){C=C.substring(H[0].length);D+=this.renderer.strong(this.output(H[2]||H[1]));continue;}if(H=this.rules.em.exec(C)){C=C.substring(H[0].length);
+D+=this.renderer.em(this.output(H[2]||H[1]));continue;}if(H=this.rules.code.exec(C)){C=C.substring(H[0].length);D+=this.renderer.codespan(escape(H[2],true));continue;}if(H=this.rules.br.exec(C)){C=C.substring(H[0].length);D+=this.renderer.br();continue;}if(H=this.rules.del.exec(C)){C=C.substring(H[0].length);
+D+=this.renderer.del(this.output(H[1]));continue;}if(H=this.rules.text.exec(C)){C=C.substring(H[0].length);D+=this.renderer.text(escape(this.smartypants(H[0])));continue;}if(C){throw new Error('Infinite loop on byte: '+C.charCodeAt(0));}}return D;};InlineLexer.prototype.outputLink=function(C,D){var E=escape(D.href),F=D.title?escape(D.title):null;
+return C[0].charAt(0)!=='!'?this.renderer.link(E,F,this.output(C[1])):this.renderer.image(E,F,escape(C[1]));};InlineLexer.prototype.smartypants=function(C){if(!this.options.smartypants){return C;}return C.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(C){if(!this.options.mangle){return C;}var D='',l=C.length,i=0,ch;for(;i<l;i++){ch=C.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}D+='&#'+ch+';';}return D;};function Renderer(C){this.options=C||{};}Renderer.prototype.code=function(C,D,E){if(this.options.highlight){var F=this.options.highlight(C,D);
+if(F!=null&&F!==C){E=true;C=F;}}else{E=true;}if(!D){return '<pre><code>'+(E?C:escape(C,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+escape(D,true)+'">'+(E?C:escape(C,true))+'\n</code></pre>\n';};Renderer.prototype.blockquote=function(C){return '<blockquote>\n'+C+'</blockquote>\n';
+};Renderer.prototype.html=function(C){return C;};Renderer.prototype.heading=function(C,D,E){return '<h'+D+' id="'+this.options.headerPrefix+E.toLowerCase().replace(/[^\w]+/g,'-')+'">'+C+'</h'+D+'>\n';};Renderer.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
+};Renderer.prototype.list=function(C,D){var E=D?'ol':'ul';return '<'+E+'>\n'+C+'</'+E+'>\n';};Renderer.prototype.listitem=function(C){return '<li>'+C+'</li>\n';};Renderer.prototype.paragraph=function(C){return '<p>'+C+'</p>\n';};Renderer.prototype.table=function(C,D){return '<table class="table table-striped">\n'+'<thead>\n'+C+'</thead>\n'+'<tbody>\n'+D+'</tbody>\n'+'</table>\n';
+};Renderer.prototype.tablerow=function(C){return '<tr>\n'+C+'</tr>\n';};Renderer.prototype.tablecell=function(C,D){var E=D.header?'th':'td';var F=D.align?'<'+E+' style="text-align:'+D.align+'">':'<'+E+'>';return F+C+'</'+E+'>\n';};Renderer.prototype.strong=function(C){return '<strong>'+C+'</strong>';
+};Renderer.prototype.em=function(C){return '<em>'+C+'</em>';};Renderer.prototype.codespan=function(C){return '<code>'+C+'</code>';};Renderer.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};Renderer.prototype.del=function(C){return '<del>'+C+'</del>';
+};Renderer.prototype.link=function(C,D,E){if(this.options.sanitize){try{var F=decodeURIComponent(unescape(C)).replace(/[^\w:]/g,'').toLowerCase();}catch(e){return '';}if(F.indexOf('javascript:')===0||F.indexOf('vbscript:')===0){return '';}}var G='<a href="'+C+'"';
+if(D){G+=' title="'+D+'"';}G+='>'+E+'</a>';return G;};Renderer.prototype.image=function(C,D,E){var F='<img src="'+C+'" alt="'+E+'"';if(D){F+=' title="'+D+'"';}F+=this.options.xhtml?'/>':'>';return F;};Renderer.prototype.text=function(C){return C;};function Parser(C){this.tokens=[];
+this.token=null;this.options=C||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options;}Parser.parse=function(C,D,E){var F=new Parser(D,E);return F.parse(C);};Parser.prototype.parse=function(C){this.inline=new InlineLexer(C.links,this.options,this.renderer);
+this.tokens=C.reverse();var D='';while(this.next()){D+=this.tok();}return D;};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 C=this.token.text;
+while(this.peek().type==='text'){C+='\n'+this.next().text;}return this.inline.output(C);};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 C='',D='',i,E,F,G,j;F='';for(i=0;i<this.token.header.length;i++){G={header:true,align:this.token.align[i]};F+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]}
+);}C+=this.renderer.tablerow(F);for(i=0;i<this.token.cells.length;i++){E=this.token.cells[i];F='';for(j=0;j<E.length;j++){F+=this.renderer.tablecell(this.inline.output(E[j]),{header:false,align:this.token.align[j]});}D+=this.renderer.tablerow(F);}return this.renderer.table(C,D);
+}case 'blockquote_start':{var D='';while(this.next().type!=='blockquote_end'){D+=this.tok();}return this.renderer.blockquote(D);}case 'list_start':{var D='',H=this.token.ordered;while(this.next().type!=='list_end'){D+=this.tok();}return this.renderer.list(D,H);
+}case 'list_item_start':{var D='';while(this.next().type!=='list_item_end'){D+=this.token.type==='text'?this.parseText():this.tok();}return this.renderer.listitem(D);}case 'loose_item_start':{var D='';while(this.next().type!=='list_item_end'){D+=this.tok();
+}return this.renderer.listitem(D);}case 'html':{var I=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;return this.renderer.html(I);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));
+}case 'text':{return this.renderer.paragraph(this.parseText());}}};function escape(C,D){return C.replace(!D?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');}function unescape(C){return C.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(C,D){C=C.source;D=D||'';return function E(F,G){if(!F){return new RegExp(C,D);
+}G=G.source||G;G=G.replace(/(^|[^\[])\^/g,'$1');C=C.replace(F,G);return E;};}function noop(){}noop.exec=noop;function merge(C){var i=1,D,E;for(;i<arguments.length;i++){D=arguments[i];for(E in D){if(Object.prototype.hasOwnProperty.call(D,E)){C[E]=D[E];}}}return C;
+}function marked(C,D,E){if(E||typeof D==='function'){if(!E){E=D;D=null;}D=merge({},marked.defaults,D||{});var F=D.highlight,G,H,i=0;try{G=Lexer.lex(C,D)}catch(e){return E(e);}H=G.length;var I=function(J){if(J){D.highlight=F;return E(J);}var K;try{K=Parser.parse(G,D);
+}catch(e){J=e;}D.highlight=F;return J?E(J):E(null,K);};if(!F||F.length<3){return I();}delete D.highlight;if(!H){return I();}for(;i<G.length;i++){(function(J){if(J.type!=='code'){return --H||I();}return F(J.text,J.lang,function(K,L){if(K){return I(K);}if(L==null||L===J.text){return --H||I();
+}J.text=L;J.escaped=true;--H||I();});})(G[i]);}return;}try{if(D){D=merge({},marked.defaults,D);}return Parser.parse(Lexer.lex(C,D),D);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';if((D||marked.defaults).silent){return '<p>An error occured:</p><pre>'+escape(e.message+'',true)+'</pre>';
+}throw e;}}marked.options=marked.setOptions=function(C){merge(marked.defaults,C);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=Lexer;marked.lexer=Lexer.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.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 2df8ecd..b9281b1 100644 (file)
@@ -17311,7 +17311,7 @@ Roo.Markdown.toHtml = function(text) {
      * Inline Lexer & Compiler
      */
     
-    var InlineLexer = function (links, options) {
+    function InlineLexer(links, options) {
       this.options = options || marked.defaults;
       this.links = links;
       this.rules = inline.normal;
@@ -17551,7 +17551,7 @@ Roo.Markdown.toHtml = function(text) {
      * Renderer
      */
     
-    var Renderer = function (options) {
+    function Renderer(options) {
       this.options = options || {};
     }
     
@@ -17701,7 +17701,7 @@ Roo.Markdown.toHtml = function(text) {
      * Parsing & Compiling
      */
     
-    var Parser = function (options) {
+    function Parser(options) {
       this.tokens = [];
       this.token = null;
       this.options = options || marked.defaults;
@@ -17881,7 +17881,7 @@ Roo.Markdown.toHtml = function(text) {
      * Helpers
      */
     
-    var escape = function (html, encode) {
+    function escape(html, encode) {
       return html
         .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&amp;')
         .replace(/</g, '&lt;')
@@ -17890,7 +17890,7 @@ Roo.Markdown.toHtml = function(text) {
         .replace(/'/g, '&#39;');
     }
     
-    var unescape = function (html) {
+    function unescape(html) {
         // explicitly match decimal, hex, and named HTML entities 
       return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function(_, n) {
         n = n.toLowerCase();
@@ -17904,7 +17904,7 @@ Roo.Markdown.toHtml = function(text) {
       });
     }
     
-    var replace = function (regex, opt) {
+    function replace(regex, opt) {
       regex = regex.source;
       opt = opt || '';
       return function self(name, val) {
@@ -17916,7 +17916,7 @@ Roo.Markdown.toHtml = function(text) {
       };
     }
     
-    var noop = function () {}
+    function noop() {}
     noop.exec = noop;
     
     function merge(obj) {
@@ -17941,7 +17941,7 @@ Roo.Markdown.toHtml = function(text) {
      * Marked
      */
     
-    var marked = function (src, opt, callback) {
+    function marked(src, opt, callback) {
       if (callback || typeof opt === 'function') {
         if (!callback) {
           callback = opt;