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

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

index 49910e8..7b76b4c 100644 (file)
@@ -1126,7 +1126,7 @@ Roo.Markdown.toHtml = function(text) {
      * Helpers
      */
     
-    function escape(html, encode) {
+    var escape = function (html, encode) {
       return html
         .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&amp;')
         .replace(/</g, '&lt;')
index f4e277b..5daa162 100644 (file)
@@ -688,56 +688,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(F){this.tokens=[];this.tokens.links={};this.options=F||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}};B.rules=A;B.lex=function(F,G){var H=new B(G);return H.lex(F);
-};B.prototype.lex=function(F){F=F.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(F,true);};B.prototype.token=function(F,G,bq){var F=F.replace(/^ +$/gm,''),H,I,J,K,b,L,M,i,l;while(F){if(J=this.rules.newline.exec(F)){F=F.substring(J[0].length);
-if(J[0].length>1){this.tokens.push({type:'space'});}}if(J=this.rules.code.exec(F)){F=F.substring(J[0].length);J=J[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?J.replace(/\n+$/,''):J});continue;}if(J=this.rules.fences.exec(F)){F=F.substring(J[0].length);
-this.tokens.push({type:'code',lang:J[2],text:J[3]||''});continue;}if(J=this.rules.heading.exec(F)){F=F.substring(J[0].length);this.tokens.push({type:'heading',depth:J[1].length,text:J[2]});continue;}if(G&&(J=this.rules.nptable.exec(F))){F=F.substring(J[0].length);
-L={type:'table',header:J[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:J[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:J[3].replace(/\n$/,'').split('\n')};for(i=0;i<L.align.length;i++){if(/^ *-+: *$/.test(L.align[i])){L.align[i]='right';}else if(/^ *:-+: *$/.test(L.align[i])){L.align[i]='center';
-}else if(/^ *:-+ *$/.test(L.align[i])){L.align[i]='left';}else{L.align[i]=null;}}for(i=0;i<L.cells.length;i++){L.cells[i]=L.cells[i].split(/ *\| */);}this.tokens.push(L);continue;}if(J=this.rules.lheading.exec(F)){F=F.substring(J[0].length);this.tokens.push({type:'heading',depth:J[2]==='='?1:2,text:J[1]}
-);continue;}if(J=this.rules.hr.exec(F)){F=F.substring(J[0].length);this.tokens.push({type:'hr'});continue;}if(J=this.rules.blockquote.exec(F)){F=F.substring(J[0].length);this.tokens.push({type:'blockquote_start'});J=J[0].replace(/^ *> ?/gm,'');this.token(J,G,true);
-this.tokens.push({type:'blockquote_end'});continue;}if(J=this.rules.list.exec(F)){F=F.substring(J[0].length);K=J[2];this.tokens.push({type:'list_start',ordered:K.length>1});J=J[0].match(this.rules.item);H=false;l=J.length;i=0;for(;i<l;i++){L=J[i];M=L.length;
-L=L.replace(/^ *([*+-]|\d+\.) +/,'');if(~L.indexOf('\n ')){M-=L.length;L=!this.options.pedantic?L.replace(new RegExp('^ {1,'+M+'}','gm'),''):L.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(J[i+1])[0];if(K!==b&&!(K.length>1&&b.length>1)){F=J.slice(i+1).join('\n')+F;
-i=l-1;}}I=H||/\n\n(?!\s*$)/.test(L);if(i!==l-1){H=L.charAt(L.length-1)==='\n';if(!I){I=H;}}this.tokens.push({type:I?'loose_item_start':'list_item_start'});this.token(L,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
-continue;}if(J=this.rules.html.exec(F)){F=F.substring(J[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(J[1]==='pre'||J[1]==='script'||J[1]==='style'),text:J[0]});continue;}if((!bq&&G)&&(J=this.rules.def.exec(F))){F=F.substring(J[0].length);
-this.tokens.links[J[1].toLowerCase()]={href:J[2],title:J[3]};continue;}if(G&&(J=this.rules.table.exec(F))){F=F.substring(J[0].length);L={type:'table',header:J[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:J[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:J[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
-;for(i=0;i<L.align.length;i++){if(/^ *-+: *$/.test(L.align[i])){L.align[i]='right';}else if(/^ *:-+: *$/.test(L.align[i])){L.align[i]='center';}else if(/^ *:-+ *$/.test(L.align[i])){L.align[i]='left';}else{L.align[i]=null;}}for(i=0;i<L.cells.length;i++){L.cells[i]=L.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
-}this.tokens.push(L);continue;}if(G&&(J=this.rules.paragraph.exec(F))){F=F.substring(J[0].length);this.tokens.push({type:'paragraph',text:J[1].charAt(J[1].length-1)==='\n'?J[1].slice(0,-1):J[1]});continue;}if(J=this.rules.text.exec(F)){F=F.substring(J[0].length);
-this.tokens.push({type:'text',text:J[0]});continue;}if(F){throw new Error('Infinite loop on byte: '+F.charCodeAt(0));}}return this.tokens;};var C={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/}
+);var B=function(G){this.tokens=[];this.tokens.links={};this.options=G||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}};B.rules=A;B.lex=function(G,H){var I=new B(H);return I.lex(G);
+};B.prototype.lex=function(G){G=G.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(G,true);};B.prototype.token=function(G,H,bq){var G=G.replace(/^ +$/gm,''),I,J,K,L,b,M,N,i,l;while(G){if(K=this.rules.newline.exec(G)){G=G.substring(K[0].length);
+if(K[0].length>1){this.tokens.push({type:'space'});}}if(K=this.rules.code.exec(G)){G=G.substring(K[0].length);K=K[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?K.replace(/\n+$/,''):K});continue;}if(K=this.rules.fences.exec(G)){G=G.substring(K[0].length);
+this.tokens.push({type:'code',lang:K[2],text:K[3]||''});continue;}if(K=this.rules.heading.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:'heading',depth:K[1].length,text:K[2]});continue;}if(H&&(K=this.rules.nptable.exec(G))){G=G.substring(K[0].length);
+M={type:'table',header:K[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:K[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:K[3].replace(/\n$/,'').split('\n')};for(i=0;i<M.align.length;i++){if(/^ *-+: *$/.test(M.align[i])){M.align[i]='right';}else if(/^ *:-+: *$/.test(M.align[i])){M.align[i]='center';
+}else if(/^ *:-+ *$/.test(M.align[i])){M.align[i]='left';}else{M.align[i]=null;}}for(i=0;i<M.cells.length;i++){M.cells[i]=M.cells[i].split(/ *\| */);}this.tokens.push(M);continue;}if(K=this.rules.lheading.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:'heading',depth:K[2]==='='?1:2,text:K[1]}
+);continue;}if(K=this.rules.hr.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:'hr'});continue;}if(K=this.rules.blockquote.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:'blockquote_start'});K=K[0].replace(/^ *> ?/gm,'');this.token(K,H,true);
+this.tokens.push({type:'blockquote_end'});continue;}if(K=this.rules.list.exec(G)){G=G.substring(K[0].length);L=K[2];this.tokens.push({type:'list_start',ordered:L.length>1});K=K[0].match(this.rules.item);I=false;l=K.length;i=0;for(;i<l;i++){M=K[i];N=M.length;
+M=M.replace(/^ *([*+-]|\d+\.) +/,'');if(~M.indexOf('\n ')){N-=M.length;M=!this.options.pedantic?M.replace(new RegExp('^ {1,'+N+'}','gm'),''):M.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(K[i+1])[0];if(L!==b&&!(L.length>1&&b.length>1)){G=K.slice(i+1).join('\n')+G;
+i=l-1;}}J=I||/\n\n(?!\s*$)/.test(M);if(i!==l-1){I=M.charAt(M.length-1)==='\n';if(!J){J=I;}}this.tokens.push({type:J?'loose_item_start':'list_item_start'});this.token(M,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
+continue;}if(K=this.rules.html.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(K[1]==='pre'||K[1]==='script'||K[1]==='style'),text:K[0]});continue;}if((!bq&&H)&&(K=this.rules.def.exec(G))){G=G.substring(K[0].length);
+this.tokens.links[K[1].toLowerCase()]={href:K[2],title:K[3]};continue;}if(H&&(K=this.rules.table.exec(G))){G=G.substring(K[0].length);M={type:'table',header:K[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:K[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:K[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
+;for(i=0;i<M.align.length;i++){if(/^ *-+: *$/.test(M.align[i])){M.align[i]='right';}else if(/^ *:-+: *$/.test(M.align[i])){M.align[i]='center';}else if(/^ *:-+ *$/.test(M.align[i])){M.align[i]='left';}else{M.align[i]=null;}}for(i=0;i<M.cells.length;i++){M.cells[i]=M.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
+}this.tokens.push(M);continue;}if(H&&(K=this.rules.paragraph.exec(G))){G=G.substring(K[0].length);this.tokens.push({type:'paragraph',text:K[1].charAt(K[1].length-1)==='\n'?K[1].slice(0,-1):K[1]});continue;}if(K=this.rules.text.exec(G)){G=G.substring(K[0].length);
+this.tokens.push({type:'text',text:K[0]});continue;}if(G){throw new Error('Infinite loop on byte: '+G.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(F,G){this.options=G||marked.defaults;this.links=F;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(F,G,H){var I=new D(G,H);
-return I.output(F);};D.prototype.output=function(F){var G='',H,I,J,K;while(F){if(K=this.rules.escape.exec(F)){F=F.substring(K[0].length);G+=K[1];continue;}if(K=this.rules.autolink.exec(F)){F=F.substring(K[0].length);if(K[2]==='@'){I=K[1].charAt(6)===':'?this.mangle(K[1].substring(7)):this.mangle(K[1]);
-J=this.mangle('mailto:')+I;}else{I=escape(K[1]);J=I;}G+=this.renderer.link(J,null,I);continue;}if(!this.inLink&&(K=this.rules.url.exec(F))){F=F.substring(K[0].length);I=escape(K[1]);J=I;G+=this.renderer.link(J,null,I);continue;}if(K=this.rules.tag.exec(F)){if(!this.inLink&&/^<a /i.test(K[0])){this.inLink=true;
-}else if(this.inLink&&/^<\/a>/i.test(K[0])){this.inLink=false;}F=F.substring(K[0].length);G+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(K[0]):escape(K[0]):K[0];continue;}if(K=this.rules.link.exec(F)){F=F.substring(K[0].length);this.inLink=true;
-G+=this.outputLink(K,{href:K[2],title:K[3]});this.inLink=false;continue;}if((K=this.rules.reflink.exec(F))||(K=this.rules.nolink.exec(F))){F=F.substring(K[0].length);H=(K[2]||K[1]).replace(/\s+/g,' ');H=this.links[H.toLowerCase()];if(!H||!H.href){G+=K[0].charAt(0);
-F=K[0].substring(1)+F;continue;}this.inLink=true;G+=this.outputLink(K,H);this.inLink=false;continue;}if(K=this.rules.strong.exec(F)){F=F.substring(K[0].length);G+=this.renderer.strong(this.output(K[2]||K[1]));continue;}if(K=this.rules.em.exec(F)){F=F.substring(K[0].length);
-G+=this.renderer.em(this.output(K[2]||K[1]));continue;}if(K=this.rules.code.exec(F)){F=F.substring(K[0].length);G+=this.renderer.codespan(escape(K[2],true));continue;}if(K=this.rules.br.exec(F)){F=F.substring(K[0].length);G+=this.renderer.br();continue;}if(K=this.rules.del.exec(F)){F=F.substring(K[0].length);
-G+=this.renderer.del(this.output(K[1]));continue;}if(K=this.rules.text.exec(F)){F=F.substring(K[0].length);G+=this.renderer.text(escape(this.smartypants(K[0])));continue;}if(F){throw new Error('Infinite loop on byte: '+F.charCodeAt(0));}}return G;};D.prototype.outputLink=function(F,G){var H=escape(G.href),I=G.title?escape(G.title):null;
-return F[0].charAt(0)!=='!'?this.renderer.link(H,I,this.output(F[1])):this.renderer.image(H,I,escape(F[1]));};D.prototype.smartypants=function(F){if(!this.options.smartypants){return F;}return F.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(F){if(!this.options.mangle){return F;}var G='',l=F.length,i=0,ch;for(;i<l;i++){ch=F.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}G+='&#'+ch+';';}return G;};var E=function(F){this.options=F||{};};E.prototype.code=function(F,G,H){if(this.options.highlight){var I=this.options.highlight(F,G);
-if(I!=null&&I!==F){H=true;F=I;}}else{H=true;}if(!G){return '<pre><code>'+(H?F:escape(F,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+escape(G,true)+'">'+(H?F:escape(F,true))+'\n</code></pre>\n';};E.prototype.blockquote=function(F){return '<blockquote>\n'+F+'</blockquote>\n';
-};E.prototype.html=function(F){return F;};E.prototype.heading=function(F,G,H){return '<h'+G+' id="'+this.options.headerPrefix+H.toLowerCase().replace(/[^\w]+/g,'-')+'">'+F+'</h'+G+'>\n';};E.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
-};E.prototype.list=function(F,G){var H=G?'ol':'ul';return '<'+H+'>\n'+F+'</'+H+'>\n';};E.prototype.listitem=function(F){return '<li>'+F+'</li>\n';};E.prototype.paragraph=function(F){return '<p>'+F+'</p>\n';};E.prototype.table=function(F,G){return '<table class="table table-striped">\n'+'<thead>\n'+F+'</thead>\n'+'<tbody>\n'+G+'</tbody>\n'+'</table>\n';
-};E.prototype.tablerow=function(F){return '<tr>\n'+F+'</tr>\n';};E.prototype.tablecell=function(F,G){var H=G.header?'th':'td';var I=G.align?'<'+H+' style="text-align:'+G.align+'">':'<'+H+'>';return I+F+'</'+H+'>\n';};E.prototype.strong=function(F){return '<strong>'+F+'</strong>';
-};E.prototype.em=function(F){return '<em>'+F+'</em>';};E.prototype.codespan=function(F){return '<code>'+F+'</code>';};E.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};E.prototype.del=function(F){return '<del>'+F+'</del>';};E.prototype.link=function(F,G,H){if(this.options.sanitize){try{var I=decodeURIComponent(unescape(F)).replace(/[^\w:]/g,'').toLowerCase();
-}catch(e){return '';}if(I.indexOf('javascript:')===0||I.indexOf('vbscript:')===0){return '';}}var J='<a href="'+F+'"';if(G){J+=' title="'+G+'"';}J+='>'+H+'</a>';return J;};E.prototype.image=function(F,G,H){var I='<img src="'+F+'" alt="'+H+'"';if(G){I+=' title="'+G+'"';
-}I+=this.options.xhtml?'/>':'>';return I;};E.prototype.text=function(F){return F;};function Parser(F){this.tokens=[];this.token=null;this.options=F||marked.defaults;this.options.renderer=this.options.renderer||new E;this.renderer=this.options.renderer;this.renderer.options=this.options;
-}Parser.parse=function(F,G,H){var I=new Parser(G,H);return I.parse(F);};Parser.prototype.parse=function(F){this.inline=new D(F.links,this.options,this.renderer);this.tokens=F.reverse();var G='';while(this.next()){G+=this.tok();}return G;};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 F=this.token.text;while(this.peek().type==='text'){F+='\n'+this.next().text;}return this.inline.output(F);};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 F='',G='',i,H,I,J,j;
-I='';for(i=0;i<this.token.header.length;i++){J={header:true,align:this.token.align[i]};I+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]});}F+=this.renderer.tablerow(I);for(i=0;i<this.token.cells.length;
-i++){H=this.token.cells[i];I='';for(j=0;j<H.length;j++){I+=this.renderer.tablecell(this.inline.output(H[j]),{header:false,align:this.token.align[j]});}G+=this.renderer.tablerow(I);}return this.renderer.table(F,G);}case 'blockquote_start':{var G='';while(this.next().type!=='blockquote_end'){G+=this.tok();
-}return this.renderer.blockquote(G);}case 'list_start':{var G='',K=this.token.ordered;while(this.next().type!=='list_end'){G+=this.tok();}return this.renderer.list(G,K);}case 'list_item_start':{var G='';while(this.next().type!=='list_item_end'){G+=this.token.type==='text'?this.parseText():this.tok();
-}return this.renderer.listitem(G);}case 'loose_item_start':{var G='';while(this.next().type!=='list_item_end'){G+=this.tok();}return this.renderer.listitem(G);}case 'html':{var L=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;
-return this.renderer.html(L);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));}case 'text':{return this.renderer.paragraph(this.parseText());}}};function escape(F,G){return F.replace(!G?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');
-}function unescape(F){return F.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(F,G){F=F.source;G=G||'';return function H(I,J){if(!I){return new RegExp(F,G);}J=J.source||J;J=J.replace(/(^|[^\[])\^/g,'$1');F=F.replace(I,J);return H;};}function noop(){}noop.exec=noop;function merge(F){var i=1,G,H;for(;i<arguments.length;
-i++){G=arguments[i];for(H in G){if(Object.prototype.hasOwnProperty.call(G,H)){F[H]=G[H];}}}return F;}function marked(F,G,H){if(H||typeof G==='function'){if(!H){H=G;G=null;}G=merge({},marked.defaults,G||{});var I=G.highlight,J,K,i=0;try{J=B.lex(F,G)}catch(e){return H(e);
-}K=J.length;var L=function(M){if(M){G.highlight=I;return H(M);}var N;try{N=Parser.parse(J,G);}catch(e){M=e;}G.highlight=I;return M?H(M):H(null,N);};if(!I||I.length<3){return L();}delete G.highlight;if(!K){return L();}for(;i<J.length;i++){(function(M){if(M.type!=='code'){return --K||L();
-}return I(M.text,M.lang,function(N,O){if(N){return L(N);}if(O==null||O===M.text){return --K||L();}M.text=O;M.escaped=true;--K||L();});})(J[i]);}return;}try{if(G){G=merge({},marked.defaults,G);}return Parser.parse(B.lex(F,G),G);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';
-if((G||marked.defaults).silent){return '<p>An error occured:</p><pre>'+escape(e.message+'',true)+'</pre>';}throw e;}}marked.options=marked.setOptions=function(F){merge(marked.defaults,F);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 E,xhtml:false}
-;marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=E;marked.Lexer=B;marked.lexer=B.lex;marked.InlineLexer=D;marked.inlineLexer=D.output;marked.parse=marked;Roo.Markdown.marked=marked;})();
+);C.breaks=merge({},C.gfm,{br:replace(C.br)('{2,}','*')(),text:replace(C.gfm.text)('{2,}','*')()});var D=function(G,H){this.options=H||marked.defaults;this.links=G;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(G,H,I){var J=new D(H,I);
+return J.output(G);};D.prototype.output=function(G){var H='',I,J,K,L;while(G){if(L=this.rules.escape.exec(G)){G=G.substring(L[0].length);H+=L[1];continue;}if(L=this.rules.autolink.exec(G)){G=G.substring(L[0].length);if(L[2]==='@'){J=L[1].charAt(6)===':'?this.mangle(L[1].substring(7)):this.mangle(L[1]);
+K=this.mangle('mailto:')+J;}else{J=escape(L[1]);K=J;}H+=this.renderer.link(K,null,J);continue;}if(!this.inLink&&(L=this.rules.url.exec(G))){G=G.substring(L[0].length);J=escape(L[1]);K=J;H+=this.renderer.link(K,null,J);continue;}if(L=this.rules.tag.exec(G)){if(!this.inLink&&/^<a /i.test(L[0])){this.inLink=true;
+}else if(this.inLink&&/^<\/a>/i.test(L[0])){this.inLink=false;}G=G.substring(L[0].length);H+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(L[0]):escape(L[0]):L[0];continue;}if(L=this.rules.link.exec(G)){G=G.substring(L[0].length);this.inLink=true;
+H+=this.outputLink(L,{href:L[2],title:L[3]});this.inLink=false;continue;}if((L=this.rules.reflink.exec(G))||(L=this.rules.nolink.exec(G))){G=G.substring(L[0].length);I=(L[2]||L[1]).replace(/\s+/g,' ');I=this.links[I.toLowerCase()];if(!I||!I.href){H+=L[0].charAt(0);
+G=L[0].substring(1)+G;continue;}this.inLink=true;H+=this.outputLink(L,I);this.inLink=false;continue;}if(L=this.rules.strong.exec(G)){G=G.substring(L[0].length);H+=this.renderer.strong(this.output(L[2]||L[1]));continue;}if(L=this.rules.em.exec(G)){G=G.substring(L[0].length);
+H+=this.renderer.em(this.output(L[2]||L[1]));continue;}if(L=this.rules.code.exec(G)){G=G.substring(L[0].length);H+=this.renderer.codespan(escape(L[2],true));continue;}if(L=this.rules.br.exec(G)){G=G.substring(L[0].length);H+=this.renderer.br();continue;}if(L=this.rules.del.exec(G)){G=G.substring(L[0].length);
+H+=this.renderer.del(this.output(L[1]));continue;}if(L=this.rules.text.exec(G)){G=G.substring(L[0].length);H+=this.renderer.text(escape(this.smartypants(L[0])));continue;}if(G){throw new Error('Infinite loop on byte: '+G.charCodeAt(0));}}return H;};D.prototype.outputLink=function(G,H){var I=escape(H.href),J=H.title?escape(H.title):null;
+return G[0].charAt(0)!=='!'?this.renderer.link(I,J,this.output(G[1])):this.renderer.image(I,J,escape(G[1]));};D.prototype.smartypants=function(G){if(!this.options.smartypants){return G;}return G.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(G){if(!this.options.mangle){return G;}var H='',l=G.length,i=0,ch;for(;i<l;i++){ch=G.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}H+='&#'+ch+';';}return H;};var E=function(G){this.options=G||{};};E.prototype.code=function(G,H,I){if(this.options.highlight){var J=this.options.highlight(G,H);
+if(J!=null&&J!==G){I=true;G=J;}}else{I=true;}if(!H){return '<pre><code>'+(I?G:escape(G,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+escape(H,true)+'">'+(I?G:escape(G,true))+'\n</code></pre>\n';};E.prototype.blockquote=function(G){return '<blockquote>\n'+G+'</blockquote>\n';
+};E.prototype.html=function(G){return G;};E.prototype.heading=function(G,H,I){return '<h'+H+' id="'+this.options.headerPrefix+I.toLowerCase().replace(/[^\w]+/g,'-')+'">'+G+'</h'+H+'>\n';};E.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
+};E.prototype.list=function(G,H){var I=H?'ol':'ul';return '<'+I+'>\n'+G+'</'+I+'>\n';};E.prototype.listitem=function(G){return '<li>'+G+'</li>\n';};E.prototype.paragraph=function(G){return '<p>'+G+'</p>\n';};E.prototype.table=function(G,H){return '<table class="table table-striped">\n'+'<thead>\n'+G+'</thead>\n'+'<tbody>\n'+H+'</tbody>\n'+'</table>\n';
+};E.prototype.tablerow=function(G){return '<tr>\n'+G+'</tr>\n';};E.prototype.tablecell=function(G,H){var I=H.header?'th':'td';var J=H.align?'<'+I+' style="text-align:'+H.align+'">':'<'+I+'>';return J+G+'</'+I+'>\n';};E.prototype.strong=function(G){return '<strong>'+G+'</strong>';
+};E.prototype.em=function(G){return '<em>'+G+'</em>';};E.prototype.codespan=function(G){return '<code>'+G+'</code>';};E.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};E.prototype.del=function(G){return '<del>'+G+'</del>';};E.prototype.link=function(G,H,I){if(this.options.sanitize){try{var J=decodeURIComponent(unescape(G)).replace(/[^\w:]/g,'').toLowerCase();
+}catch(e){return '';}if(J.indexOf('javascript:')===0||J.indexOf('vbscript:')===0){return '';}}var K='<a href="'+G+'"';if(H){K+=' title="'+H+'"';}K+='>'+I+'</a>';return K;};E.prototype.image=function(G,H,I){var J='<img src="'+G+'" alt="'+I+'"';if(H){J+=' title="'+H+'"';
+}J+=this.options.xhtml?'/>':'>';return J;};E.prototype.text=function(G){return G;};var F=function(G){this.tokens=[];this.token=null;this.options=G||marked.defaults;this.options.renderer=this.options.renderer||new E;this.renderer=this.options.renderer;this.renderer.options=this.options;
+};F.parse=function(G,H,I){var J=new F(H,I);return J.parse(G);};F.prototype.parse=function(G){this.inline=new D(G.links,this.options,this.renderer);this.tokens=G.reverse();var H='';while(this.next()){H+=this.tok();}return H;};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 G=this.token.text;while(this.peek().type==='text'){G+='\n'+this.next().text;}return this.inline.output(G);};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 G='',H='',i,I,J,K,j;
+J='';for(i=0;i<this.token.header.length;i++){K={header:true,align:this.token.align[i]};J+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]});}G+=this.renderer.tablerow(J);for(i=0;i<this.token.cells.length;
+i++){I=this.token.cells[i];J='';for(j=0;j<I.length;j++){J+=this.renderer.tablecell(this.inline.output(I[j]),{header:false,align:this.token.align[j]});}H+=this.renderer.tablerow(J);}return this.renderer.table(G,H);}case 'blockquote_start':{var H='';while(this.next().type!=='blockquote_end'){H+=this.tok();
+}return this.renderer.blockquote(H);}case 'list_start':{var H='',L=this.token.ordered;while(this.next().type!=='list_end'){H+=this.tok();}return this.renderer.list(H,L);}case 'list_item_start':{var H='';while(this.next().type!=='list_item_end'){H+=this.token.type==='text'?this.parseText():this.tok();
+}return this.renderer.listitem(H);}case 'loose_item_start':{var H='';while(this.next().type!=='list_item_end'){H+=this.tok();}return this.renderer.listitem(H);}case 'html':{var M=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;
+return this.renderer.html(M);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));}case 'text':{return this.renderer.paragraph(this.parseText());}}};function escape(G,H){return G.replace(!H?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');
+}function unescape(G){return G.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(G,H){G=G.source;H=H||'';return function I(J,K){if(!J){return new RegExp(G,H);}K=K.source||K;K=K.replace(/(^|[^\[])\^/g,'$1');G=G.replace(J,K);return I;};}function noop(){}noop.exec=noop;function merge(G){var i=1,H,I;for(;i<arguments.length;
+i++){H=arguments[i];for(I in H){if(Object.prototype.hasOwnProperty.call(H,I)){G[I]=H[I];}}}return G;}function marked(G,H,I){if(I||typeof H==='function'){if(!I){I=H;H=null;}H=merge({},marked.defaults,H||{});var J=H.highlight,K,L,i=0;try{K=B.lex(G,H)}catch(e){return I(e);
+}L=K.length;var M=function(N){if(N){H.highlight=J;return I(N);}var O;try{O=F.parse(K,H);}catch(e){N=e;}H.highlight=J;return N?I(N):I(null,O);};if(!J||J.length<3){return M();}delete H.highlight;if(!L){return M();}for(;i<K.length;i++){(function(N){if(N.type!=='code'){return --L||M();
+}return J(N.text,N.lang,function(O,P){if(O){return M(O);}if(P==null||P===N.text){return --L||M();}N.text=P;N.escaped=true;--L||M();});})(K[i]);}return;}try{if(H){H=merge({},marked.defaults,H);}return F.parse(B.lex(G,H),H);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';
+if((H||marked.defaults).silent){return '<p>An error occured:</p><pre>'+escape(e.message+'',true)+'</pre>';}throw e;}}marked.options=marked.setOptions=function(G){merge(marked.defaults,G);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 E,xhtml:false}
+;marked.Parser=F;marked.parser=F.parse;marked.Renderer=E;marked.Lexer=B;marked.lexer=B.lex;marked.InlineLexer=D;marked.inlineLexer=D.output;marked.parse=marked;Roo.Markdown.marked=marked;})();
 // Roo/dd/DragDrop.js
 (function(){var A=Roo.EventManager;var B=Roo.lib.Dom;Roo.dd.DragDrop=function(id,C,D){if(id){this.init(id,C,D);}};Roo.extend(Roo.dd.DragDrop,Roo.util.Observable,{id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;
 },unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){}
index 30edece..5fe012b 100644 (file)
@@ -17706,7 +17706,7 @@ Roo.Markdown.toHtml = function(text) {
      * Parsing & Compiling
      */
     
-    function Parser(options) {
+    var Parser= function (options) {
       this.tokens = [];
       this.token = null;
       this.options = options || marked.defaults;
index a71159b..5ccb0cb 100644 (file)
@@ -688,56 +688,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(F){this.tokens=[];this.tokens.links={};this.options=F||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}};B.rules=A;B.lex=function(F,G){var H=new B(G);return H.lex(F);
-};B.prototype.lex=function(F){F=F.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(F,true);};B.prototype.token=function(F,G,bq){var F=F.replace(/^ +$/gm,''),H,I,J,K,b,L,M,i,l;while(F){if(J=this.rules.newline.exec(F)){F=F.substring(J[0].length);
-if(J[0].length>1){this.tokens.push({type:'space'});}}if(J=this.rules.code.exec(F)){F=F.substring(J[0].length);J=J[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?J.replace(/\n+$/,''):J});continue;}if(J=this.rules.fences.exec(F)){F=F.substring(J[0].length);
-this.tokens.push({type:'code',lang:J[2],text:J[3]||''});continue;}if(J=this.rules.heading.exec(F)){F=F.substring(J[0].length);this.tokens.push({type:'heading',depth:J[1].length,text:J[2]});continue;}if(G&&(J=this.rules.nptable.exec(F))){F=F.substring(J[0].length);
-L={type:'table',header:J[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:J[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:J[3].replace(/\n$/,'').split('\n')};for(i=0;i<L.align.length;i++){if(/^ *-+: *$/.test(L.align[i])){L.align[i]='right';}else if(/^ *:-+: *$/.test(L.align[i])){L.align[i]='center';
-}else if(/^ *:-+ *$/.test(L.align[i])){L.align[i]='left';}else{L.align[i]=null;}}for(i=0;i<L.cells.length;i++){L.cells[i]=L.cells[i].split(/ *\| */);}this.tokens.push(L);continue;}if(J=this.rules.lheading.exec(F)){F=F.substring(J[0].length);this.tokens.push({type:'heading',depth:J[2]==='='?1:2,text:J[1]}
-);continue;}if(J=this.rules.hr.exec(F)){F=F.substring(J[0].length);this.tokens.push({type:'hr'});continue;}if(J=this.rules.blockquote.exec(F)){F=F.substring(J[0].length);this.tokens.push({type:'blockquote_start'});J=J[0].replace(/^ *> ?/gm,'');this.token(J,G,true);
-this.tokens.push({type:'blockquote_end'});continue;}if(J=this.rules.list.exec(F)){F=F.substring(J[0].length);K=J[2];this.tokens.push({type:'list_start',ordered:K.length>1});J=J[0].match(this.rules.item);H=false;l=J.length;i=0;for(;i<l;i++){L=J[i];M=L.length;
-L=L.replace(/^ *([*+-]|\d+\.) +/,'');if(~L.indexOf('\n ')){M-=L.length;L=!this.options.pedantic?L.replace(new RegExp('^ {1,'+M+'}','gm'),''):L.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(J[i+1])[0];if(K!==b&&!(K.length>1&&b.length>1)){F=J.slice(i+1).join('\n')+F;
-i=l-1;}}I=H||/\n\n(?!\s*$)/.test(L);if(i!==l-1){H=L.charAt(L.length-1)==='\n';if(!I){I=H;}}this.tokens.push({type:I?'loose_item_start':'list_item_start'});this.token(L,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
-continue;}if(J=this.rules.html.exec(F)){F=F.substring(J[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(J[1]==='pre'||J[1]==='script'||J[1]==='style'),text:J[0]});continue;}if((!bq&&G)&&(J=this.rules.def.exec(F))){F=F.substring(J[0].length);
-this.tokens.links[J[1].toLowerCase()]={href:J[2],title:J[3]};continue;}if(G&&(J=this.rules.table.exec(F))){F=F.substring(J[0].length);L={type:'table',header:J[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:J[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:J[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
-;for(i=0;i<L.align.length;i++){if(/^ *-+: *$/.test(L.align[i])){L.align[i]='right';}else if(/^ *:-+: *$/.test(L.align[i])){L.align[i]='center';}else if(/^ *:-+ *$/.test(L.align[i])){L.align[i]='left';}else{L.align[i]=null;}}for(i=0;i<L.cells.length;i++){L.cells[i]=L.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
-}this.tokens.push(L);continue;}if(G&&(J=this.rules.paragraph.exec(F))){F=F.substring(J[0].length);this.tokens.push({type:'paragraph',text:J[1].charAt(J[1].length-1)==='\n'?J[1].slice(0,-1):J[1]});continue;}if(J=this.rules.text.exec(F)){F=F.substring(J[0].length);
-this.tokens.push({type:'text',text:J[0]});continue;}if(F){throw new Error('Infinite loop on byte: '+F.charCodeAt(0));}}return this.tokens;};var C={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/}
+);var B=function(G){this.tokens=[];this.tokens.links={};this.options=G||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}};B.rules=A;B.lex=function(G,H){var I=new B(H);return I.lex(G);
+};B.prototype.lex=function(G){G=G.replace(/\r\n|\r/g,'\n').replace(/\t/g,'    ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(G,true);};B.prototype.token=function(G,H,bq){var G=G.replace(/^ +$/gm,''),I,J,K,L,b,M,N,i,l;while(G){if(K=this.rules.newline.exec(G)){G=G.substring(K[0].length);
+if(K[0].length>1){this.tokens.push({type:'space'});}}if(K=this.rules.code.exec(G)){G=G.substring(K[0].length);K=K[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?K.replace(/\n+$/,''):K});continue;}if(K=this.rules.fences.exec(G)){G=G.substring(K[0].length);
+this.tokens.push({type:'code',lang:K[2],text:K[3]||''});continue;}if(K=this.rules.heading.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:'heading',depth:K[1].length,text:K[2]});continue;}if(H&&(K=this.rules.nptable.exec(G))){G=G.substring(K[0].length);
+M={type:'table',header:K[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:K[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:K[3].replace(/\n$/,'').split('\n')};for(i=0;i<M.align.length;i++){if(/^ *-+: *$/.test(M.align[i])){M.align[i]='right';}else if(/^ *:-+: *$/.test(M.align[i])){M.align[i]='center';
+}else if(/^ *:-+ *$/.test(M.align[i])){M.align[i]='left';}else{M.align[i]=null;}}for(i=0;i<M.cells.length;i++){M.cells[i]=M.cells[i].split(/ *\| */);}this.tokens.push(M);continue;}if(K=this.rules.lheading.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:'heading',depth:K[2]==='='?1:2,text:K[1]}
+);continue;}if(K=this.rules.hr.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:'hr'});continue;}if(K=this.rules.blockquote.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:'blockquote_start'});K=K[0].replace(/^ *> ?/gm,'');this.token(K,H,true);
+this.tokens.push({type:'blockquote_end'});continue;}if(K=this.rules.list.exec(G)){G=G.substring(K[0].length);L=K[2];this.tokens.push({type:'list_start',ordered:L.length>1});K=K[0].match(this.rules.item);I=false;l=K.length;i=0;for(;i<l;i++){M=K[i];N=M.length;
+M=M.replace(/^ *([*+-]|\d+\.) +/,'');if(~M.indexOf('\n ')){N-=M.length;M=!this.options.pedantic?M.replace(new RegExp('^ {1,'+N+'}','gm'),''):M.replace(/^ {1,4}/gm,'');}if(this.options.smartLists&&i!==l-1){b=A.bullet.exec(K[i+1])[0];if(L!==b&&!(L.length>1&&b.length>1)){G=K.slice(i+1).join('\n')+G;
+i=l-1;}}J=I||/\n\n(?!\s*$)/.test(M);if(i!==l-1){I=M.charAt(M.length-1)==='\n';if(!J){J=I;}}this.tokens.push({type:J?'loose_item_start':'list_item_start'});this.token(M,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});
+continue;}if(K=this.rules.html.exec(G)){G=G.substring(K[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(K[1]==='pre'||K[1]==='script'||K[1]==='style'),text:K[0]});continue;}if((!bq&&H)&&(K=this.rules.def.exec(G))){G=G.substring(K[0].length);
+this.tokens.links[K[1].toLowerCase()]={href:K[2],title:K[3]};continue;}if(H&&(K=this.rules.table.exec(G))){G=G.substring(K[0].length);M={type:'table',header:K[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:K[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:K[3].replace(/(?: *\| *)?\n$/,'').split('\n')}
+;for(i=0;i<M.align.length;i++){if(/^ *-+: *$/.test(M.align[i])){M.align[i]='right';}else if(/^ *:-+: *$/.test(M.align[i])){M.align[i]='center';}else if(/^ *:-+ *$/.test(M.align[i])){M.align[i]='left';}else{M.align[i]=null;}}for(i=0;i<M.cells.length;i++){M.cells[i]=M.cells[i].replace(/^ *\| *| *\| *$/g,'').split(/ *\| */);
+}this.tokens.push(M);continue;}if(H&&(K=this.rules.paragraph.exec(G))){G=G.substring(K[0].length);this.tokens.push({type:'paragraph',text:K[1].charAt(K[1].length-1)==='\n'?K[1].slice(0,-1):K[1]});continue;}if(K=this.rules.text.exec(G)){G=G.substring(K[0].length);
+this.tokens.push({type:'text',text:K[0]});continue;}if(G){throw new Error('Infinite loop on byte: '+G.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(F,G){this.options=G||marked.defaults;this.links=F;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(F,G,H){var I=new D(G,H);
-return I.output(F);};D.prototype.output=function(F){var G='',H,I,J,K;while(F){if(K=this.rules.escape.exec(F)){F=F.substring(K[0].length);G+=K[1];continue;}if(K=this.rules.autolink.exec(F)){F=F.substring(K[0].length);if(K[2]==='@'){I=K[1].charAt(6)===':'?this.mangle(K[1].substring(7)):this.mangle(K[1]);
-J=this.mangle('mailto:')+I;}else{I=escape(K[1]);J=I;}G+=this.renderer.link(J,null,I);continue;}if(!this.inLink&&(K=this.rules.url.exec(F))){F=F.substring(K[0].length);I=escape(K[1]);J=I;G+=this.renderer.link(J,null,I);continue;}if(K=this.rules.tag.exec(F)){if(!this.inLink&&/^<a /i.test(K[0])){this.inLink=true;
-}else if(this.inLink&&/^<\/a>/i.test(K[0])){this.inLink=false;}F=F.substring(K[0].length);G+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(K[0]):escape(K[0]):K[0];continue;}if(K=this.rules.link.exec(F)){F=F.substring(K[0].length);this.inLink=true;
-G+=this.outputLink(K,{href:K[2],title:K[3]});this.inLink=false;continue;}if((K=this.rules.reflink.exec(F))||(K=this.rules.nolink.exec(F))){F=F.substring(K[0].length);H=(K[2]||K[1]).replace(/\s+/g,' ');H=this.links[H.toLowerCase()];if(!H||!H.href){G+=K[0].charAt(0);
-F=K[0].substring(1)+F;continue;}this.inLink=true;G+=this.outputLink(K,H);this.inLink=false;continue;}if(K=this.rules.strong.exec(F)){F=F.substring(K[0].length);G+=this.renderer.strong(this.output(K[2]||K[1]));continue;}if(K=this.rules.em.exec(F)){F=F.substring(K[0].length);
-G+=this.renderer.em(this.output(K[2]||K[1]));continue;}if(K=this.rules.code.exec(F)){F=F.substring(K[0].length);G+=this.renderer.codespan(escape(K[2],true));continue;}if(K=this.rules.br.exec(F)){F=F.substring(K[0].length);G+=this.renderer.br();continue;}if(K=this.rules.del.exec(F)){F=F.substring(K[0].length);
-G+=this.renderer.del(this.output(K[1]));continue;}if(K=this.rules.text.exec(F)){F=F.substring(K[0].length);G+=this.renderer.text(escape(this.smartypants(K[0])));continue;}if(F){throw new Error('Infinite loop on byte: '+F.charCodeAt(0));}}return G;};D.prototype.outputLink=function(F,G){var H=escape(G.href),I=G.title?escape(G.title):null;
-return F[0].charAt(0)!=='!'?this.renderer.link(H,I,this.output(F[1])):this.renderer.image(H,I,escape(F[1]));};D.prototype.smartypants=function(F){if(!this.options.smartypants){return F;}return F.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(F){if(!this.options.mangle){return F;}var G='',l=F.length,i=0,ch;for(;i<l;i++){ch=F.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}G+='&#'+ch+';';}return G;};var E=function(F){this.options=F||{};};E.prototype.code=function(F,G,H){if(this.options.highlight){var I=this.options.highlight(F,G);
-if(I!=null&&I!==F){H=true;F=I;}}else{H=true;}if(!G){return '<pre><code>'+(H?F:escape(F,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+escape(G,true)+'">'+(H?F:escape(F,true))+'\n</code></pre>\n';};E.prototype.blockquote=function(F){return '<blockquote>\n'+F+'</blockquote>\n';
-};E.prototype.html=function(F){return F;};E.prototype.heading=function(F,G,H){return '<h'+G+' id="'+this.options.headerPrefix+H.toLowerCase().replace(/[^\w]+/g,'-')+'">'+F+'</h'+G+'>\n';};E.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
-};E.prototype.list=function(F,G){var H=G?'ol':'ul';return '<'+H+'>\n'+F+'</'+H+'>\n';};E.prototype.listitem=function(F){return '<li>'+F+'</li>\n';};E.prototype.paragraph=function(F){return '<p>'+F+'</p>\n';};E.prototype.table=function(F,G){return '<table class="table table-striped">\n'+'<thead>\n'+F+'</thead>\n'+'<tbody>\n'+G+'</tbody>\n'+'</table>\n';
-};E.prototype.tablerow=function(F){return '<tr>\n'+F+'</tr>\n';};E.prototype.tablecell=function(F,G){var H=G.header?'th':'td';var I=G.align?'<'+H+' style="text-align:'+G.align+'">':'<'+H+'>';return I+F+'</'+H+'>\n';};E.prototype.strong=function(F){return '<strong>'+F+'</strong>';
-};E.prototype.em=function(F){return '<em>'+F+'</em>';};E.prototype.codespan=function(F){return '<code>'+F+'</code>';};E.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};E.prototype.del=function(F){return '<del>'+F+'</del>';};E.prototype.link=function(F,G,H){if(this.options.sanitize){try{var I=decodeURIComponent(unescape(F)).replace(/[^\w:]/g,'').toLowerCase();
-}catch(e){return '';}if(I.indexOf('javascript:')===0||I.indexOf('vbscript:')===0){return '';}}var J='<a href="'+F+'"';if(G){J+=' title="'+G+'"';}J+='>'+H+'</a>';return J;};E.prototype.image=function(F,G,H){var I='<img src="'+F+'" alt="'+H+'"';if(G){I+=' title="'+G+'"';
-}I+=this.options.xhtml?'/>':'>';return I;};E.prototype.text=function(F){return F;};function Parser(F){this.tokens=[];this.token=null;this.options=F||marked.defaults;this.options.renderer=this.options.renderer||new E;this.renderer=this.options.renderer;this.renderer.options=this.options;
-}Parser.parse=function(F,G,H){var I=new Parser(G,H);return I.parse(F);};Parser.prototype.parse=function(F){this.inline=new D(F.links,this.options,this.renderer);this.tokens=F.reverse();var G='';while(this.next()){G+=this.tok();}return G;};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 F=this.token.text;while(this.peek().type==='text'){F+='\n'+this.next().text;}return this.inline.output(F);};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 F='',G='',i,H,I,J,j;
-I='';for(i=0;i<this.token.header.length;i++){J={header:true,align:this.token.align[i]};I+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]});}F+=this.renderer.tablerow(I);for(i=0;i<this.token.cells.length;
-i++){H=this.token.cells[i];I='';for(j=0;j<H.length;j++){I+=this.renderer.tablecell(this.inline.output(H[j]),{header:false,align:this.token.align[j]});}G+=this.renderer.tablerow(I);}return this.renderer.table(F,G);}case 'blockquote_start':{var G='';while(this.next().type!=='blockquote_end'){G+=this.tok();
-}return this.renderer.blockquote(G);}case 'list_start':{var G='',K=this.token.ordered;while(this.next().type!=='list_end'){G+=this.tok();}return this.renderer.list(G,K);}case 'list_item_start':{var G='';while(this.next().type!=='list_item_end'){G+=this.token.type==='text'?this.parseText():this.tok();
-}return this.renderer.listitem(G);}case 'loose_item_start':{var G='';while(this.next().type!=='list_item_end'){G+=this.tok();}return this.renderer.listitem(G);}case 'html':{var L=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;
-return this.renderer.html(L);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));}case 'text':{return this.renderer.paragraph(this.parseText());}}};function escape(F,G){return F.replace(!G?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');
-}function unescape(F){return F.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(F,G){F=F.source;G=G||'';return function H(I,J){if(!I){return new RegExp(F,G);}J=J.source||J;J=J.replace(/(^|[^\[])\^/g,'$1');F=F.replace(I,J);return H;};}function noop(){}noop.exec=noop;function merge(F){var i=1,G,H;for(;i<arguments.length;
-i++){G=arguments[i];for(H in G){if(Object.prototype.hasOwnProperty.call(G,H)){F[H]=G[H];}}}return F;}function marked(F,G,H){if(H||typeof G==='function'){if(!H){H=G;G=null;}G=merge({},marked.defaults,G||{});var I=G.highlight,J,K,i=0;try{J=B.lex(F,G)}catch(e){return H(e);
-}K=J.length;var L=function(M){if(M){G.highlight=I;return H(M);}var N;try{N=Parser.parse(J,G);}catch(e){M=e;}G.highlight=I;return M?H(M):H(null,N);};if(!I||I.length<3){return L();}delete G.highlight;if(!K){return L();}for(;i<J.length;i++){(function(M){if(M.type!=='code'){return --K||L();
-}return I(M.text,M.lang,function(N,O){if(N){return L(N);}if(O==null||O===M.text){return --K||L();}M.text=O;M.escaped=true;--K||L();});})(J[i]);}return;}try{if(G){G=merge({},marked.defaults,G);}return Parser.parse(B.lex(F,G),G);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';
-if((G||marked.defaults).silent){return '<p>An error occured:</p><pre>'+escape(e.message+'',true)+'</pre>';}throw e;}}marked.options=marked.setOptions=function(F){merge(marked.defaults,F);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 E,xhtml:false}
-;marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=E;marked.Lexer=B;marked.lexer=B.lex;marked.InlineLexer=D;marked.inlineLexer=D.output;marked.parse=marked;Roo.Markdown.marked=marked;})();
+);C.breaks=merge({},C.gfm,{br:replace(C.br)('{2,}','*')(),text:replace(C.gfm.text)('{2,}','*')()});var D=function(G,H){this.options=H||marked.defaults;this.links=G;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(G,H,I){var J=new D(H,I);
+return J.output(G);};D.prototype.output=function(G){var H='',I,J,K,L;while(G){if(L=this.rules.escape.exec(G)){G=G.substring(L[0].length);H+=L[1];continue;}if(L=this.rules.autolink.exec(G)){G=G.substring(L[0].length);if(L[2]==='@'){J=L[1].charAt(6)===':'?this.mangle(L[1].substring(7)):this.mangle(L[1]);
+K=this.mangle('mailto:')+J;}else{J=escape(L[1]);K=J;}H+=this.renderer.link(K,null,J);continue;}if(!this.inLink&&(L=this.rules.url.exec(G))){G=G.substring(L[0].length);J=escape(L[1]);K=J;H+=this.renderer.link(K,null,J);continue;}if(L=this.rules.tag.exec(G)){if(!this.inLink&&/^<a /i.test(L[0])){this.inLink=true;
+}else if(this.inLink&&/^<\/a>/i.test(L[0])){this.inLink=false;}G=G.substring(L[0].length);H+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(L[0]):escape(L[0]):L[0];continue;}if(L=this.rules.link.exec(G)){G=G.substring(L[0].length);this.inLink=true;
+H+=this.outputLink(L,{href:L[2],title:L[3]});this.inLink=false;continue;}if((L=this.rules.reflink.exec(G))||(L=this.rules.nolink.exec(G))){G=G.substring(L[0].length);I=(L[2]||L[1]).replace(/\s+/g,' ');I=this.links[I.toLowerCase()];if(!I||!I.href){H+=L[0].charAt(0);
+G=L[0].substring(1)+G;continue;}this.inLink=true;H+=this.outputLink(L,I);this.inLink=false;continue;}if(L=this.rules.strong.exec(G)){G=G.substring(L[0].length);H+=this.renderer.strong(this.output(L[2]||L[1]));continue;}if(L=this.rules.em.exec(G)){G=G.substring(L[0].length);
+H+=this.renderer.em(this.output(L[2]||L[1]));continue;}if(L=this.rules.code.exec(G)){G=G.substring(L[0].length);H+=this.renderer.codespan(escape(L[2],true));continue;}if(L=this.rules.br.exec(G)){G=G.substring(L[0].length);H+=this.renderer.br();continue;}if(L=this.rules.del.exec(G)){G=G.substring(L[0].length);
+H+=this.renderer.del(this.output(L[1]));continue;}if(L=this.rules.text.exec(G)){G=G.substring(L[0].length);H+=this.renderer.text(escape(this.smartypants(L[0])));continue;}if(G){throw new Error('Infinite loop on byte: '+G.charCodeAt(0));}}return H;};D.prototype.outputLink=function(G,H){var I=escape(H.href),J=H.title?escape(H.title):null;
+return G[0].charAt(0)!=='!'?this.renderer.link(I,J,this.output(G[1])):this.renderer.image(I,J,escape(G[1]));};D.prototype.smartypants=function(G){if(!this.options.smartypants){return G;}return G.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(G){if(!this.options.mangle){return G;}var H='',l=G.length,i=0,ch;for(;i<l;i++){ch=G.charCodeAt(i);if(Math.random()>0.5){ch='x'+ch.toString(16);}H+='&#'+ch+';';}return H;};var E=function(G){this.options=G||{};};E.prototype.code=function(G,H,I){if(this.options.highlight){var J=this.options.highlight(G,H);
+if(J!=null&&J!==G){I=true;G=J;}}else{I=true;}if(!H){return '<pre><code>'+(I?G:escape(G,true))+'\n</code></pre>';}return '<pre><code class="'+this.options.langPrefix+escape(H,true)+'">'+(I?G:escape(G,true))+'\n</code></pre>\n';};E.prototype.blockquote=function(G){return '<blockquote>\n'+G+'</blockquote>\n';
+};E.prototype.html=function(G){return G;};E.prototype.heading=function(G,H,I){return '<h'+H+' id="'+this.options.headerPrefix+I.toLowerCase().replace(/[^\w]+/g,'-')+'">'+G+'</h'+H+'>\n';};E.prototype.hr=function(){return this.options.xhtml?'<hr/>\n':'<hr>\n';
+};E.prototype.list=function(G,H){var I=H?'ol':'ul';return '<'+I+'>\n'+G+'</'+I+'>\n';};E.prototype.listitem=function(G){return '<li>'+G+'</li>\n';};E.prototype.paragraph=function(G){return '<p>'+G+'</p>\n';};E.prototype.table=function(G,H){return '<table class="table table-striped">\n'+'<thead>\n'+G+'</thead>\n'+'<tbody>\n'+H+'</tbody>\n'+'</table>\n';
+};E.prototype.tablerow=function(G){return '<tr>\n'+G+'</tr>\n';};E.prototype.tablecell=function(G,H){var I=H.header?'th':'td';var J=H.align?'<'+I+' style="text-align:'+H.align+'">':'<'+I+'>';return J+G+'</'+I+'>\n';};E.prototype.strong=function(G){return '<strong>'+G+'</strong>';
+};E.prototype.em=function(G){return '<em>'+G+'</em>';};E.prototype.codespan=function(G){return '<code>'+G+'</code>';};E.prototype.br=function(){return this.options.xhtml?'<br/>':'<br>';};E.prototype.del=function(G){return '<del>'+G+'</del>';};E.prototype.link=function(G,H,I){if(this.options.sanitize){try{var J=decodeURIComponent(unescape(G)).replace(/[^\w:]/g,'').toLowerCase();
+}catch(e){return '';}if(J.indexOf('javascript:')===0||J.indexOf('vbscript:')===0){return '';}}var K='<a href="'+G+'"';if(H){K+=' title="'+H+'"';}K+='>'+I+'</a>';return K;};E.prototype.image=function(G,H,I){var J='<img src="'+G+'" alt="'+I+'"';if(H){J+=' title="'+H+'"';
+}J+=this.options.xhtml?'/>':'>';return J;};E.prototype.text=function(G){return G;};var F=function(G){this.tokens=[];this.token=null;this.options=G||marked.defaults;this.options.renderer=this.options.renderer||new E;this.renderer=this.options.renderer;this.renderer.options=this.options;
+};F.parse=function(G,H,I){var J=new F(H,I);return J.parse(G);};F.prototype.parse=function(G){this.inline=new D(G.links,this.options,this.renderer);this.tokens=G.reverse();var H='';while(this.next()){H+=this.tok();}return H;};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 G=this.token.text;while(this.peek().type==='text'){G+='\n'+this.next().text;}return this.inline.output(G);};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 G='',H='',i,I,J,K,j;
+J='';for(i=0;i<this.token.header.length;i++){K={header:true,align:this.token.align[i]};J+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]});}G+=this.renderer.tablerow(J);for(i=0;i<this.token.cells.length;
+i++){I=this.token.cells[i];J='';for(j=0;j<I.length;j++){J+=this.renderer.tablecell(this.inline.output(I[j]),{header:false,align:this.token.align[j]});}H+=this.renderer.tablerow(J);}return this.renderer.table(G,H);}case 'blockquote_start':{var H='';while(this.next().type!=='blockquote_end'){H+=this.tok();
+}return this.renderer.blockquote(H);}case 'list_start':{var H='',L=this.token.ordered;while(this.next().type!=='list_end'){H+=this.tok();}return this.renderer.list(H,L);}case 'list_item_start':{var H='';while(this.next().type!=='list_item_end'){H+=this.token.type==='text'?this.parseText():this.tok();
+}return this.renderer.listitem(H);}case 'loose_item_start':{var H='';while(this.next().type!=='list_item_end'){H+=this.tok();}return this.renderer.listitem(H);}case 'html':{var M=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;
+return this.renderer.html(M);}case 'paragraph':{return this.renderer.paragraph(this.inline.output(this.token.text));}case 'text':{return this.renderer.paragraph(this.parseText());}}};function escape(G,H){return G.replace(!H?/&(?!#?\w+;)/g:/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;').replace(/'/g,'&#39;');
+}function unescape(G){return G.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(G,H){G=G.source;H=H||'';return function I(J,K){if(!J){return new RegExp(G,H);}K=K.source||K;K=K.replace(/(^|[^\[])\^/g,'$1');G=G.replace(J,K);return I;};}function noop(){}noop.exec=noop;function merge(G){var i=1,H,I;for(;i<arguments.length;
+i++){H=arguments[i];for(I in H){if(Object.prototype.hasOwnProperty.call(H,I)){G[I]=H[I];}}}return G;}function marked(G,H,I){if(I||typeof H==='function'){if(!I){I=H;H=null;}H=merge({},marked.defaults,H||{});var J=H.highlight,K,L,i=0;try{K=B.lex(G,H)}catch(e){return I(e);
+}L=K.length;var M=function(N){if(N){H.highlight=J;return I(N);}var O;try{O=F.parse(K,H);}catch(e){N=e;}H.highlight=J;return N?I(N):I(null,O);};if(!J||J.length<3){return M();}delete H.highlight;if(!L){return M();}for(;i<K.length;i++){(function(N){if(N.type!=='code'){return --L||M();
+}return J(N.text,N.lang,function(O,P){if(O){return M(O);}if(P==null||P===N.text){return --L||M();}N.text=P;N.escaped=true;--L||M();});})(K[i]);}return;}try{if(H){H=merge({},marked.defaults,H);}return F.parse(B.lex(G,H),H);}catch(e){e.message+='\nPlease report this to https://github.com/chjj/marked.';
+if((H||marked.defaults).silent){return '<p>An error occured:</p><pre>'+escape(e.message+'',true)+'</pre>';}throw e;}}marked.options=marked.setOptions=function(G){merge(marked.defaults,G);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 E,xhtml:false}
+;marked.Parser=F;marked.parser=F.parse;marked.Renderer=E;marked.Lexer=B;marked.lexer=B.lex;marked.InlineLexer=D;marked.inlineLexer=D.output;marked.parse=marked;Roo.Markdown.marked=marked;})();
 // Roo/dd/DragDrop.js
 (function(){var A=Roo.EventManager;var B=Roo.lib.Dom;Roo.dd.DragDrop=function(id,C,D){if(id){this.init(id,C,D);}};Roo.extend(Roo.dd.DragDrop,Roo.util.Observable,{id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;
 },unlock:function(){this.locked=false;},isTarget:true,padding:null,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,b4StartDrag:function(x,y){}
index c686fb7..4bd6823 100644 (file)
@@ -17706,7 +17706,7 @@ Roo.Markdown.toHtml = function(text) {
      * Parsing & Compiling
      */
     
-    function Parser(options) {
+    var Parser= function (options) {
       this.tokens = [];
       this.token = null;
       this.options = options || marked.defaults;