roojs-core.js
authorEdward <edward@roojs.com>
Thu, 7 Mar 2019 03:29:29 +0000 (11:29 +0800)
committerEdward <edward@roojs.com>
Thu, 7 Mar 2019 03:29:29 +0000 (11:29 +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 637c692..ddea60d 100644 (file)
@@ -687,56 +687,56 @@ 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(I){this.tokens=[];this.tokens.links={};this.options=I||H.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(I,J){var K=new B(J);return K.lex(I);
-};B.prototype.lex=function(I){I=I.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(I,true);};B.prototype.token=function(I,J,bq){var I=I.replace(/^ +$/gm,''),K,L,M,N,b,O,P,i,l;while(I){if(M=this.rules.newline.exec(I)){I=I.substring(M[0].length);
-if(M[0].length>1){this.tokens.push({type:'space'});}}if(M=this.rules.code.exec(I)){I=I.substring(M[0].length);M=M[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?M.replace(/\n+$/,''):M});continue;}if(M=this.rules.fences.exec(I)){I=I.substring(M[0].length);
-this.tokens.push({type:'code',lang:M[2],text:M[3]||''});continue;}if(M=this.rules.heading.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'heading',depth:M[1].length,text:M[2]});continue;}if(J&&(M=this.rules.nptable.exec(I))){I=I.substring(M[0].length);
-O={type:'table',header:M[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:M[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:M[3].replace(/\n$/,'').split('\n')};for(i=0;i<O.align.length;i++){if(/^ *-+: *$/.test(O.align[i])){O.align[i]='right';}else if(/^ *:-+: *$/.test(O.align[i])){O.align[i]='center';
-}else if(/^ *:-+ *$/.test(O.align[i])){O.align[i]='left';}else{O.align[i]=null;}}for(i=0;i<O.cells.length;i++){O.cells[i]=O.cells[i].split(/ *\| */);}this.tokens.push(O);continue;}if(M=this.rules.lheading.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'heading',depth:M[2]==='='?1:2,text:M[1]}
-);continue;}if(M=this.rules.hr.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'hr'});continue;}if(M=this.rules.blockquote.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'blockquote_start'});M=M[0].replace(/^ *> ?/gm,'');this.token(M,J,true);
-this.tokens.push({type:'blockquote_end'});continue;}if(M=this.rules.list.exec(I)){I=I.substring(M[0].length);N=M[2];this.tokens.push({type:'list_start',ordered:N.length>1});M=M[0].match(this.rules.item);K=false;l=M.length;i=0;for(;i<l;i++){O=M[i];P=O.length;
-O=O.replace(/^ *([*+-]|\d+\.) +/,'');if(~O.indexOf('\n ')){P-=O.length;O=!this.options.pedantic?O.replace(new RegExp('^ {1,'+P+'}','gm'),''):O.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(M[i+1])[0];if(N!==b&&!(N.length>1&&b.length>1)){I=M.slice(i+1).join('\n')+I;
-i=l-1;}}L=K||/\n\n(?!\s*$)/.test(O);if(i!==l-1){K=O.charAt(O.length-1)==='\n';if(!L){L=K;}}this.tokens.push({type:L?'loose_item_start':'list_item_start'});this.token(O,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
-continue;}if(M=this.rules.html.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(M[1]==='pre'||M[1]==='script'||M[1]==='style'),text:M[0]});continue;}if((!bq&&J)&&(M=this.rules.def.exec(I))){I=I.substring(M[0].length);
-this.tokens.links[M[1].toLowerCase()]={href:M[2],title:M[3]};continue;}if(J&&(M=this.rules.table.exec(I))){I=I.substring(M[0].length);O={type:'table',header:M[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:M[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:M[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
-;for(i=0;i<O.align.length;i++){if(/^ *-+: *$/.test(O.align[i])){O.align[i]='right';}else if(/^ *:-+: *$/.test(O.align[i])){O.align[i]='center';}else if(/^ *:-+ *$/.test(O.align[i])){O.align[i]='left';}else{O.align[i]=null;}}for(i=0;i<O.cells.length;i++){O.cells[i]=O.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
-}this.tokens.push(O);continue;}if(J&&(M=this.rules.paragraph.exec(I))){I=I.substring(M[0].length);this.tokens.push({type:'paragraph',text:M[1].charAt(M[1].length-1)==='\n'?M[1].slice(0,-1):M[1]});continue;}if(M=this.rules.text.exec(I)){I=I.substring(M[0].length);
-this.tokens.push({type:'text',text:M[0]});continue;}if(I){throw new Error('Infinite loop on byte: '+I.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,}','*')()});var D=function(I,J){this.options=J||H.defaults;this.links=I;this.rules=C.normal;this.renderer=this.options.renderer||new E;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(I,J,K){var L=new D(J,K);
-return L.output(I);};D.prototype.output=function(I){var J='',K,L,M,N;while(I){if(N=this.rules.escape.exec(I)){I=I.substring(N[0].length);J+=N[1];continue;}if(N=this.rules.autolink.exec(I)){I=I.substring(N[0].length);if(N[2]==='@'){L=N[1].charAt(6)===':'?this.mangle(N[1].substring(7)):this.mangle(N[1]);
-M=this.mangle('mailto:')+L;}else{L=G(N[1]);M=L;}J+=this.renderer.link(M,null,L);continue;}if(!this.inLink&&(N=this.rules.url.exec(I))){I=I.substring(N[0].length);L=G(N[1]);M=L;J+=this.renderer.link(M,null,L);continue;}if(N=this.rules.tag.exec(I)){if(!this.inLink&&/^<a /i.test(N[0])){this.inLink=true;
-}else if(this.inLink&&/^<\/a>/i.test(N[0])){this.inLink=false;}I=I.substring(N[0].length);J+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(N[0]):G(N[0]):N[0];continue;}if(N=this.rules.link.exec(I)){I=I.substring(N[0].length);this.inLink=true;
-J+=this.outputLink(N,{href:N[2],title:N[3]});this.inLink=false;continue;}if((N=this.rules.reflink.exec(I))||(N=this.rules.nolink.exec(I))){I=I.substring(N[0].length);K=(N[2]||N[1]).replace(/\s+/g,' ');K=this.links[K.toLowerCase()];if(!K||!K.href){J+=N[0].charAt(0);
-I=N[0].substring(1)+I;continue;}this.inLink=true;J+=this.outputLink(N,K);this.inLink=false;continue;}if(N=this.rules.strong.exec(I)){I=I.substring(N[0].length);J+=this.renderer.strong(this.output(N[2]||N[1]));continue;}if(N=this.rules.em.exec(I)){I=I.substring(N[0].length);
-J+=this.renderer.em(this.output(N[2]||N[1]));continue;}if(N=this.rules.code.exec(I)){I=I.substring(N[0].length);J+=this.renderer.codespan(G(N[2],true));continue;}if(N=this.rules.br.exec(I)){I=I.substring(N[0].length);J+=this.renderer.br();continue;}if(N=this.rules.del.exec(I)){I=I.substring(N[0].length);
-J+=this.renderer.del(this.output(N[1]));continue;}if(N=this.rules.text.exec(I)){I=I.substring(N[0].length);J+=this.renderer.text(G(this.smartypants(N[0])));continue;}if(I){throw new Error('Infinite loop on byte: '+I.charCodeAt(0));}}return J;};D.prototype.outputLink=function(I,J){var K=G(J.href),L=J.title?G(J.title):null;
-return I[0].charAt(0)!=='!'?this.renderer.link(K,L,this.output(I[1])):this.renderer.image(K,L,G(I[1]));};D.prototype.smartypants=function(I){if(!this.options.smartypants){return I;}return I.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(I){if(!this.options.mangle){return I;}var J='',l=I.length,i=0,ch;for(;i<l;i++){ch=I.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}J+='&#'+ch+';';}return J;};var E=function(I){this.options=I||{};};E.prototype.code=function(I,J,K){if(this.options.highlight){var L=this.options.highlight(I,J);
-if(L!=null&&L!==I){K=true;I=L;}}else{K=true;}if(!J){return '<pre><code>'+(K?I:G(I,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+G(J,true)+'">'+(K?I:G(I,true))+'\n</code></pre>\n';};E.prototype.blockquote=function(I){return '<blockquote>\n'+I+'</blockquote>\n';
-};E.prototype.html=function(I){return I;};E.prototype.heading=function(I,J,K){return '<h'+J+' id="'+this.options.headerPrefix+K.toLowerCase().replace(/[^\w]+/g,'-')+'">'+I+'</h'+J+'>\n';};E.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
-};E.prototype.list=function(I,J){var K=J?'ol':'ul';return '<'+K+'>\n'+I+'</'+K+'>\n';};E.prototype.listitem=function(I){return '<li>'+I+'</li>\n';};E.prototype.paragraph=function(I){return '<p>'+I+'</p>\n';};E.prototype.table=function(I,J){return '<table class="table table-striped">\n'+'<thead>\n'+I+'</thead>\n'+'<tbody>\n'+J+'</tbody>\n'+'</table>\n';
-};E.prototype.tablerow=function(I){return '<tr>\n'+I+'</tr>\n';};E.prototype.tablecell=function(I,J){var K=J.header?'th':'td';var L=J.align?'<'+K+' style="text-align:'+J.align+'">':'<'+K+'>';return L+I+'</'+K+'>\n';};E.prototype.strong=function(I){return '<strong>'+I+'</strong>';
-};E.prototype.em=function(I){return '<em>'+I+'</em>';};E.prototype.codespan=function(I){return '<code>'+I+'</code>';};E.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};E.prototype.del=function(I){return '<del>'+I+'</del>';};E.prototype.link=function(I,J,K){if(this.options.sanitize){try{var L=decodeURIComponent(unescape(I)).replace(/[^\w:]/g,'').toLowerCase();
-}catch(e){return '';}if(L.indexOf('javascript:')===0||L.indexOf('vbscript:')===0){return '';}}var M='<a href="'+I+'"';if(J){M+=' title="'+J+'"';}M+='>'+K+'</a>';return M;};E.prototype.image=function(I,J,K){var L='<img src="'+I+'" alt="'+K+'"';if(J){L+=' title="'+J+'"';
-}L+=this.options.xhtml?'/>':'>';return L;};E.prototype.text=function(I){return I;};var F=function(I){this.tokens=[];this.token=null;this.options=I||H.defaults;this.options.renderer=this.options.renderer||new E;this.renderer=this.options.renderer;this.renderer.options=this.options;
-};F.parse=function(I,J,K){var L=new F(J,K);return L.parse(I);};F.prototype.parse=function(I){this.inline=new D(I.links,this.options,this.renderer);this.tokens=I.reverse();var J='';while(this.next()){J+=this.tok();}return J;};F.prototype.next=function(){return this.token=this.tokens.pop();
-};F.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};F.prototype.parseText=function(){var I=this.token.text;while(this.peek().type==='text'){I+='\n'+this.next().text;}return this.inline.output(I);};F.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 I='',J='',i,K,L,M,j;
-L='';for(i=0;i<this.token.header.length;i++){M={header:true,align:this.token.align[i]};L+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]});}I+=this.renderer.tablerow(L);for(i=0;i<this.token.cells.length;
-i++){K=this.token.cells[i];L='';for(j=0;j<K.length;j++){L+=this.renderer.tablecell(this.inline.output(K[j]),{header:false,align:this.token.align[j]});}J+=this.renderer.tablerow(L);}return this.renderer.table(I,J);}case 'blockquote_start':{var J='';while(this.next().type!=='blockquote_end'){J+=this.tok();
-}return this.renderer.blockquote(J);}case 'list_start':{var J='',N=this.token.ordered;while(this.next().type!=='list_end'){J+=this.tok();}return this.renderer.list(J,N);}case 'list_item_start':{var J='';while(this.next().type!=='list_item_end'){J+=this.token.type==='text'?this.parseText():this.tok();
-}return this.renderer.listitem(J);}case 'loose_item_start':{var J='';while(this.next().type!=='list_item_end'){J+=this.tok();}return this.renderer.listitem(J);}case 'html':{var O=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;
-return this.renderer.html(O);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));}case 'text':{return this.renderer.paragraph(this.parseText());}}};var G=function(I,J){return I.replace(!J?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');
-};var unescape=function(I){return I.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(I,J){I=I.source;J=J||'';return function K(L,M){if(!L){return new RegExp(I,J);}M=M.source||M;M=M.replace(/(^|[^\[])\^/g,'$1');I=I.replace(L,M);return K;};};var noop=function(){};noop.exec=noop;function merge(I){var i=1,J,K;
-for(;i<arguments.length;i++){J=arguments[i];for(K in J){if(Object.prototype.hasOwnProperty.call(J,K)){I[K]=J[K];}}}return I;}var H=function(I,J,K){if(K||typeof J==='function'){if(!K){K=J;J=null;}J=merge({},H.defaults,J||{});var L=J.highlight,M,N,i=0;try{M=B.lex(I,J)}
-catch(e){return K(e);}N=M.length;var O=function(P){if(P){J.highlight=L;return K(P);}var Q;try{Q=F.parse(M,J);}catch(e){P=e;}J.highlight=L;return P?K(P):K(null,Q);};if(!L||L.length<3){return O();}delete J.highlight;if(!N){return O();}for(;i<M.length;i++){(function(P){if(P.type!=='code'){return --N||O();
-}return L(P.text,P.lang,function(Q,R){if(Q){return O(Q);}if(R==null||R===P.text){return --N||O();}P.text=R;P.escaped=true;--N||O();});})(M[i]);}return;}try{if(J){J=merge({},H.defaults,J);}return F.parse(B.lex(I,J),J);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';
-if((J||H.defaults).silent){return '<p>An error occured:</p><pre>'+G(e.message+'',true)+'</pre>';}throw e;}};H.options=H.setOptions=function(I){merge(H.defaults,I);return H;};H.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 E,xhtml:false}
-;H.Parser=F;H.parser=F.parse;H.Renderer=E;H.Lexer=B;H.lexer=B.lex;H.InlineLexer=D;H.inlineLexer=D.output;H.parse=H;Roo.Markdown.marked=H;})();
+);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|$)/}
+;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;})();
 // 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 344f272..8518bdc 100644 (file)
@@ -16893,7 +16893,7 @@ Roo.Markdown.toHtml = function(text) {
      * Block Lexer
      */
     
-    var Lexer = function (options) {
+    function Lexer(options) {
       this.tokens = [];
       this.tokens.links = {};
       this.options = options || marked.defaults;
index 741b60c..ae714ee 100644 (file)
@@ -687,56 +687,56 @@ 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(I){this.tokens=[];this.tokens.links={};this.options=I||H.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(I,J){var K=new B(J);return K.lex(I);
-};B.prototype.lex=function(I){I=I.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(I,true);};B.prototype.token=function(I,J,bq){var I=I.replace(/^ +$/gm,''),K,L,M,N,b,O,P,i,l;while(I){if(M=this.rules.newline.exec(I)){I=I.substring(M[0].length);
-if(M[0].length>1){this.tokens.push({type:'space'});}}if(M=this.rules.code.exec(I)){I=I.substring(M[0].length);M=M[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?M.replace(/\n+$/,''):M});continue;}if(M=this.rules.fences.exec(I)){I=I.substring(M[0].length);
-this.tokens.push({type:'code',lang:M[2],text:M[3]||''});continue;}if(M=this.rules.heading.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'heading',depth:M[1].length,text:M[2]});continue;}if(J&&(M=this.rules.nptable.exec(I))){I=I.substring(M[0].length);
-O={type:'table',header:M[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:M[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:M[3].replace(/\n$/,'').split('\n')};for(i=0;i<O.align.length;i++){if(/^ *-+: *$/.test(O.align[i])){O.align[i]='right';}else if(/^ *:-+: *$/.test(O.align[i])){O.align[i]='center';
-}else if(/^ *:-+ *$/.test(O.align[i])){O.align[i]='left';}else{O.align[i]=null;}}for(i=0;i<O.cells.length;i++){O.cells[i]=O.cells[i].split(/ *\| */);}this.tokens.push(O);continue;}if(M=this.rules.lheading.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'heading',depth:M[2]==='='?1:2,text:M[1]}
-);continue;}if(M=this.rules.hr.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'hr'});continue;}if(M=this.rules.blockquote.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:'blockquote_start'});M=M[0].replace(/^ *> ?/gm,'');this.token(M,J,true);
-this.tokens.push({type:'blockquote_end'});continue;}if(M=this.rules.list.exec(I)){I=I.substring(M[0].length);N=M[2];this.tokens.push({type:'list_start',ordered:N.length>1});M=M[0].match(this.rules.item);K=false;l=M.length;i=0;for(;i<l;i++){O=M[i];P=O.length;
-O=O.replace(/^ *([*+-]|\d+\.) +/,'');if(~O.indexOf('\n ')){P-=O.length;O=!this.options.pedantic?O.replace(new RegExp('^ {1,'+P+'}','gm'),''):O.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(M[i+1])[0];if(N!==b&&!(N.length>1&&b.length>1)){I=M.slice(i+1).join('\n')+I;
-i=l-1;}}L=K||/\n\n(?!\s*$)/.test(O);if(i!==l-1){K=O.charAt(O.length-1)==='\n';if(!L){L=K;}}this.tokens.push({type:L?'loose_item_start':'list_item_start'});this.token(O,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
-continue;}if(M=this.rules.html.exec(I)){I=I.substring(M[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(M[1]==='pre'||M[1]==='script'||M[1]==='style'),text:M[0]});continue;}if((!bq&&J)&&(M=this.rules.def.exec(I))){I=I.substring(M[0].length);
-this.tokens.links[M[1].toLowerCase()]={href:M[2],title:M[3]};continue;}if(J&&(M=this.rules.table.exec(I))){I=I.substring(M[0].length);O={type:'table',header:M[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:M[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:M[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
-;for(i=0;i<O.align.length;i++){if(/^ *-+: *$/.test(O.align[i])){O.align[i]='right';}else if(/^ *:-+: *$/.test(O.align[i])){O.align[i]='center';}else if(/^ *:-+ *$/.test(O.align[i])){O.align[i]='left';}else{O.align[i]=null;}}for(i=0;i<O.cells.length;i++){O.cells[i]=O.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
-}this.tokens.push(O);continue;}if(J&&(M=this.rules.paragraph.exec(I))){I=I.substring(M[0].length);this.tokens.push({type:'paragraph',text:M[1].charAt(M[1].length-1)==='\n'?M[1].slice(0,-1):M[1]});continue;}if(M=this.rules.text.exec(I)){I=I.substring(M[0].length);
-this.tokens.push({type:'text',text:M[0]});continue;}if(I){throw new Error('Infinite loop on byte: '+I.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,}','*')()});var D=function(I,J){this.options=J||H.defaults;this.links=I;this.rules=C.normal;this.renderer=this.options.renderer||new E;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(I,J,K){var L=new D(J,K);
-return L.output(I);};D.prototype.output=function(I){var J='',K,L,M,N;while(I){if(N=this.rules.escape.exec(I)){I=I.substring(N[0].length);J+=N[1];continue;}if(N=this.rules.autolink.exec(I)){I=I.substring(N[0].length);if(N[2]==='@'){L=N[1].charAt(6)===':'?this.mangle(N[1].substring(7)):this.mangle(N[1]);
-M=this.mangle('mailto:')+L;}else{L=G(N[1]);M=L;}J+=this.renderer.link(M,null,L);continue;}if(!this.inLink&&(N=this.rules.url.exec(I))){I=I.substring(N[0].length);L=G(N[1]);M=L;J+=this.renderer.link(M,null,L);continue;}if(N=this.rules.tag.exec(I)){if(!this.inLink&&/^<a /i.test(N[0])){this.inLink=true;
-}else if(this.inLink&&/^<\/a>/i.test(N[0])){this.inLink=false;}I=I.substring(N[0].length);J+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(N[0]):G(N[0]):N[0];continue;}if(N=this.rules.link.exec(I)){I=I.substring(N[0].length);this.inLink=true;
-J+=this.outputLink(N,{href:N[2],title:N[3]});this.inLink=false;continue;}if((N=this.rules.reflink.exec(I))||(N=this.rules.nolink.exec(I))){I=I.substring(N[0].length);K=(N[2]||N[1]).replace(/\s+/g,' ');K=this.links[K.toLowerCase()];if(!K||!K.href){J+=N[0].charAt(0);
-I=N[0].substring(1)+I;continue;}this.inLink=true;J+=this.outputLink(N,K);this.inLink=false;continue;}if(N=this.rules.strong.exec(I)){I=I.substring(N[0].length);J+=this.renderer.strong(this.output(N[2]||N[1]));continue;}if(N=this.rules.em.exec(I)){I=I.substring(N[0].length);
-J+=this.renderer.em(this.output(N[2]||N[1]));continue;}if(N=this.rules.code.exec(I)){I=I.substring(N[0].length);J+=this.renderer.codespan(G(N[2],true));continue;}if(N=this.rules.br.exec(I)){I=I.substring(N[0].length);J+=this.renderer.br();continue;}if(N=this.rules.del.exec(I)){I=I.substring(N[0].length);
-J+=this.renderer.del(this.output(N[1]));continue;}if(N=this.rules.text.exec(I)){I=I.substring(N[0].length);J+=this.renderer.text(G(this.smartypants(N[0])));continue;}if(I){throw new Error('Infinite loop on byte: '+I.charCodeAt(0));}}return J;};D.prototype.outputLink=function(I,J){var K=G(J.href),L=J.title?G(J.title):null;
-return I[0].charAt(0)!=='!'?this.renderer.link(K,L,this.output(I[1])):this.renderer.image(K,L,G(I[1]));};D.prototype.smartypants=function(I){if(!this.options.smartypants){return I;}return I.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(I){if(!this.options.mangle){return I;}var J='',l=I.length,i=0,ch;for(;i<l;i++){ch=I.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}J+='&#'+ch+';';}return J;};var E=function(I){this.options=I||{};};E.prototype.code=function(I,J,K){if(this.options.highlight){var L=this.options.highlight(I,J);
-if(L!=null&&L!==I){K=true;I=L;}}else{K=true;}if(!J){return '<pre><code>'+(K?I:G(I,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+G(J,true)+'">'+(K?I:G(I,true))+'\n</code></pre>\n';};E.prototype.blockquote=function(I){return '<blockquote>\n'+I+'</blockquote>\n';
-};E.prototype.html=function(I){return I;};E.prototype.heading=function(I,J,K){return '<h'+J+' id="'+this.options.headerPrefix+K.toLowerCase().replace(/[^\w]+/g,'-')+'">'+I+'</h'+J+'>\n';};E.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
-};E.prototype.list=function(I,J){var K=J?'ol':'ul';return '<'+K+'>\n'+I+'</'+K+'>\n';};E.prototype.listitem=function(I){return '<li>'+I+'</li>\n';};E.prototype.paragraph=function(I){return '<p>'+I+'</p>\n';};E.prototype.table=function(I,J){return '<table class="table table-striped">\n'+'<thead>\n'+I+'</thead>\n'+'<tbody>\n'+J+'</tbody>\n'+'</table>\n';
-};E.prototype.tablerow=function(I){return '<tr>\n'+I+'</tr>\n';};E.prototype.tablecell=function(I,J){var K=J.header?'th':'td';var L=J.align?'<'+K+' style="text-align:'+J.align+'">':'<'+K+'>';return L+I+'</'+K+'>\n';};E.prototype.strong=function(I){return '<strong>'+I+'</strong>';
-};E.prototype.em=function(I){return '<em>'+I+'</em>';};E.prototype.codespan=function(I){return '<code>'+I+'</code>';};E.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};E.prototype.del=function(I){return '<del>'+I+'</del>';};E.prototype.link=function(I,J,K){if(this.options.sanitize){try{var L=decodeURIComponent(unescape(I)).replace(/[^\w:]/g,'').toLowerCase();
-}catch(e){return '';}if(L.indexOf('javascript:')===0||L.indexOf('vbscript:')===0){return '';}}var M='<a href="'+I+'"';if(J){M+=' title="'+J+'"';}M+='>'+K+'</a>';return M;};E.prototype.image=function(I,J,K){var L='<img src="'+I+'" alt="'+K+'"';if(J){L+=' title="'+J+'"';
-}L+=this.options.xhtml?'/>':'>';return L;};E.prototype.text=function(I){return I;};var F=function(I){this.tokens=[];this.token=null;this.options=I||H.defaults;this.options.renderer=this.options.renderer||new E;this.renderer=this.options.renderer;this.renderer.options=this.options;
-};F.parse=function(I,J,K){var L=new F(J,K);return L.parse(I);};F.prototype.parse=function(I){this.inline=new D(I.links,this.options,this.renderer);this.tokens=I.reverse();var J='';while(this.next()){J+=this.tok();}return J;};F.prototype.next=function(){return this.token=this.tokens.pop();
-};F.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};F.prototype.parseText=function(){var I=this.token.text;while(this.peek().type==='text'){I+='\n'+this.next().text;}return this.inline.output(I);};F.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 I='',J='',i,K,L,M,j;
-L='';for(i=0;i<this.token.header.length;i++){M={header:true,align:this.token.align[i]};L+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]});}I+=this.renderer.tablerow(L);for(i=0;i<this.token.cells.length;
-i++){K=this.token.cells[i];L='';for(j=0;j<K.length;j++){L+=this.renderer.tablecell(this.inline.output(K[j]),{header:false,align:this.token.align[j]});}J+=this.renderer.tablerow(L);}return this.renderer.table(I,J);}case 'blockquote_start':{var J='';while(this.next().type!=='blockquote_end'){J+=this.tok();
-}return this.renderer.blockquote(J);}case 'list_start':{var J='',N=this.token.ordered;while(this.next().type!=='list_end'){J+=this.tok();}return this.renderer.list(J,N);}case 'list_item_start':{var J='';while(this.next().type!=='list_item_end'){J+=this.token.type==='text'?this.parseText():this.tok();
-}return this.renderer.listitem(J);}case 'loose_item_start':{var J='';while(this.next().type!=='list_item_end'){J+=this.tok();}return this.renderer.listitem(J);}case 'html':{var O=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;
-return this.renderer.html(O);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));}case 'text':{return this.renderer.paragraph(this.parseText());}}};var G=function(I,J){return I.replace(!J?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');
-};var unescape=function(I){return I.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(I,J){I=I.source;J=J||'';return function K(L,M){if(!L){return new RegExp(I,J);}M=M.source||M;M=M.replace(/(^|[^\[])\^/g,'$1');I=I.replace(L,M);return K;};};var noop=function(){};noop.exec=noop;function merge(I){var i=1,J,K;
-for(;i<arguments.length;i++){J=arguments[i];for(K in J){if(Object.prototype.hasOwnProperty.call(J,K)){I[K]=J[K];}}}return I;}var H=function(I,J,K){if(K||typeof J==='function'){if(!K){K=J;J=null;}J=merge({},H.defaults,J||{});var L=J.highlight,M,N,i=0;try{M=B.lex(I,J)}
-catch(e){return K(e);}N=M.length;var O=function(P){if(P){J.highlight=L;return K(P);}var Q;try{Q=F.parse(M,J);}catch(e){P=e;}J.highlight=L;return P?K(P):K(null,Q);};if(!L||L.length<3){return O();}delete J.highlight;if(!N){return O();}for(;i<M.length;i++){(function(P){if(P.type!=='code'){return --N||O();
-}return L(P.text,P.lang,function(Q,R){if(Q){return O(Q);}if(R==null||R===P.text){return --N||O();}P.text=R;P.escaped=true;--N||O();});})(M[i]);}return;}try{if(J){J=merge({},H.defaults,J);}return F.parse(B.lex(I,J),J);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';
-if((J||H.defaults).silent){return '<p>An error occured:</p><pre>'+G(e.message+'',true)+'</pre>';}throw e;}};H.options=H.setOptions=function(I){merge(H.defaults,I);return H;};H.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 E,xhtml:false}
-;H.Parser=F;H.parser=F.parse;H.Renderer=E;H.Lexer=B;H.lexer=B.lex;H.InlineLexer=D;H.inlineLexer=D.output;H.parse=H;Roo.Markdown.marked=H;})();
+);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|$)/}
+;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;})();
 // 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 3431746..2df8ecd 100644 (file)
@@ -16893,7 +16893,7 @@ Roo.Markdown.toHtml = function(text) {
      * Block Lexer
      */
     
-    var Lexer = function (options) {
+    function Lexer(options) {
       this.tokens = [];
       this.tokens.links = {};
       this.options = options || marked.defaults;