From b8564cc1726448a73bf1eaa0b0c9a9bd862df96b Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 7 Feb 2020 15:01:22 +0800 Subject: [PATCH] roojs-core.js roojs-core-debug.js roojs-all.js roojs-debug.js Roo/Markdown.js --- Roo/Markdown.js | 2 +- roojs-all.js | 97 ++++++++++++++++++++++----------------------- roojs-core-debug.js | 2 +- roojs-core.js | 97 ++++++++++++++++++++++----------------------- roojs-debug.js | 2 +- 5 files changed, 99 insertions(+), 101 deletions(-) diff --git a/Roo/Markdown.js b/Roo/Markdown.js index 71e4c47424..49910e810d 100644 --- a/Roo/Markdown.js +++ b/Roo/Markdown.js @@ -946,7 +946,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; diff --git a/roojs-all.js b/roojs-all.js index f774cab2f8..f4e277bba5 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -688,57 +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',//)('closed',/<(tag)[\s\S]+?<\/\1>/)('closing',/])*?>/)(/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(E){this.tokens=[];this.tokens.links={};this.options=E||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}};B.rules=A;B.lex=function(E,F){var G=new B(F);return G.lex(E); -};B.prototype.lex=function(E){E=E.replace(/\r\n|\r/g,'\n').replace(/\t/g,' ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(E,true);};B.prototype.token=function(E,F,bq){var E=E.replace(/^ +$/gm,''),G,H,I,J,b,K,L,i,l;while(E){if(I=this.rules.newline.exec(E)){E=E.substring(I[0].length); -if(I[0].length>1){this.tokens.push({type:'space'});}}if(I=this.rules.code.exec(E)){E=E.substring(I[0].length);I=I[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?I.replace(/\n+$/,''):I});continue;}if(I=this.rules.fences.exec(E)){E=E.substring(I[0].length); -this.tokens.push({type:'code',lang:I[2],text:I[3]||''});continue;}if(I=this.rules.heading.exec(E)){E=E.substring(I[0].length);this.tokens.push({type:'heading',depth:I[1].length,text:I[2]});continue;}if(F&&(I=this.rules.nptable.exec(E))){E=E.substring(I[0].length); -K={type:'table',header:I[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:I[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:I[3].replace(/\n$/,'').split('\n')};for(i=0;i ?/gm,'');this.token(I,F,true); -this.tokens.push({type:'blockquote_end'});continue;}if(I=this.rules.list.exec(E)){E=E.substring(I[0].length);J=I[2];this.tokens.push({type:'list_start',ordered:J.length>1});I=I[0].match(this.rules.item);G=false;l=I.length;i=0;for(;i1&&b.length>1)){E=I.slice(i+1).join('\n')+E; -i=l-1;}}H=G||/\n\n(?!\s*$)/.test(K);if(i!==l-1){G=K.charAt(K.length-1)==='\n';if(!H){H=G;}}this.tokens.push({type:H?'loose_item_start':'list_item_start'});this.token(K,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'}); -continue;}if(I=this.rules.html.exec(E)){E=E.substring(I[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(I[1]==='pre'||I[1]==='script'||I[1]==='style'),text:I[0]});continue;}if((!bq&&F)&&(I=this.rules.def.exec(E))){E=E.substring(I[0].length); -this.tokens.links[I[1].toLowerCase()]={href:I[2],title:I[3]};continue;}if(F&&(I=this.rules.table.exec(E))){E=E.substring(I[0].length);K={type:'table',header:I[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:I[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:I[3].replace(/(?: *\| *)?\n$/,'').split('\n')} -;for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\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]+?(?=[\\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 ?/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(;i1&&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])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\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]+?(?=[\\?(?:\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(E,F){this.options=F||marked.defaults;this.links=E;this.rules=C.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options; -if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=C.breaks;}else{this.rules=C.gfm;}}else if(this.options.pedantic){this.rules=C.pedantic;}};D.rules=C;D.output=function(E,F,G){var H=new D(F,G); -return H.output(E);};D.prototype.output=function(E){var F='',G,H,I,J;while(E){if(J=this.rules.escape.exec(E)){E=E.substring(J[0].length);F+=J[1];continue;}if(J=this.rules.autolink.exec(E)){E=E.substring(J[0].length);if(J[2]==='@'){H=J[1].charAt(6)===':'?this.mangle(J[1].substring(7)):this.mangle(J[1]); -I=this.mangle('mailto:')+H;}else{H=escape(J[1]);I=H;}F+=this.renderer.link(I,null,H);continue;}if(!this.inLink&&(J=this.rules.url.exec(E))){E=E.substring(J[0].length);H=escape(J[1]);I=H;F+=this.renderer.link(I,null,H);continue;}if(J=this.rules.tag.exec(E)){if(!this.inLink&&/^/i.test(J[0])){this.inLink=false;}E=E.substring(J[0].length);F+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(J[0]):escape(J[0]):J[0];continue;}if(J=this.rules.link.exec(E)){E=E.substring(J[0].length);this.inLink=true; -F+=this.outputLink(J,{href:J[2],title:J[3]});this.inLink=false;continue;}if((J=this.rules.reflink.exec(E))||(J=this.rules.nolink.exec(E))){E=E.substring(J[0].length);G=(J[2]||J[1]).replace(/\s+/g,' ');G=this.links[G.toLowerCase()];if(!G||!G.href){F+=J[0].charAt(0); -E=J[0].substring(1)+E;continue;}this.inLink=true;F+=this.outputLink(J,G);this.inLink=false;continue;}if(J=this.rules.strong.exec(E)){E=E.substring(J[0].length);F+=this.renderer.strong(this.output(J[2]||J[1]));continue;}if(J=this.rules.em.exec(E)){E=E.substring(J[0].length); -F+=this.renderer.em(this.output(J[2]||J[1]));continue;}if(J=this.rules.code.exec(E)){E=E.substring(J[0].length);F+=this.renderer.codespan(escape(J[2],true));continue;}if(J=this.rules.br.exec(E)){E=E.substring(J[0].length);F+=this.renderer.br();continue;}if(J=this.rules.del.exec(E)){E=E.substring(J[0].length); -F+=this.renderer.del(this.output(J[1]));continue;}if(J=this.rules.text.exec(E)){E=E.substring(J[0].length);F+=this.renderer.text(escape(this.smartypants(J[0])));continue;}if(E){throw new Error('Infinite loop on byte: '+E.charCodeAt(0));}}return F;};D.prototype.outputLink=function(E,F){var G=escape(F.href),H=F.title?escape(F.title):null; -return E[0].charAt(0)!=='!'?this.renderer.link(G,H,this.output(E[1])):this.renderer.image(G,H,escape(E[1]));};D.prototype.smartypants=function(E){if(!this.options.smartypants){return E;}return E.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201c').replace(/"/g,'\u201d').replace(/\.{3}/g,'\u2026'); -};D.prototype.mangle=function(E){if(!this.options.mangle){return E;}var F='',l=E.length,i=0,ch;for(;i0.5){ch='x'+ch.toString(16);}F+='&#'+ch+';';}return F;};function Renderer(E){this.options=E||{};}Renderer.prototype.code=function(E,F,G){if(this.options.highlight){var H=this.options.highlight(E,F); -if(H!=null&&H!==E){G=true;E=H;}}else{G=true;}if(!F){return '
'+(G?E:escape(E,true))+'\n
';}return '
'+(G?E:escape(E,true))+'\n
\n';};Renderer.prototype.blockquote=function(E){return '
\n'+E+'
\n'; -};Renderer.prototype.html=function(E){return E;};Renderer.prototype.heading=function(E,F,G){return ''+E+'\n';};Renderer.prototype.hr=function(){return this.options.xhtml?'
\n':'
\n'; -};Renderer.prototype.list=function(E,F){var G=F?'ol':'ul';return '<'+G+'>\n'+E+'\n';};Renderer.prototype.listitem=function(E){return '
  • '+E+'
  • \n';};Renderer.prototype.paragraph=function(E){return '

    '+E+'

    \n';};Renderer.prototype.table=function(E,F){return '\n'+'\n'+E+'\n'+'\n'+F+'\n'+'
    \n'; -};Renderer.prototype.tablerow=function(E){return '\n'+E+'\n';};Renderer.prototype.tablecell=function(E,F){var G=F.header?'th':'td';var H=F.align?'<'+G+' style="text-align:'+F.align+'">':'<'+G+'>';return H+E+'\n';};Renderer.prototype.strong=function(E){return ''+E+''; -};Renderer.prototype.em=function(E){return ''+E+'';};Renderer.prototype.codespan=function(E){return ''+E+'';};Renderer.prototype.br=function(){return this.options.xhtml?'
    ':'
    ';};Renderer.prototype.del=function(E){return ''+E+''; -};Renderer.prototype.link=function(E,F,G){if(this.options.sanitize){try{var H=decodeURIComponent(unescape(E)).replace(/[^\w:]/g,'').toLowerCase();}catch(e){return '';}if(H.indexOf('javascript:')===0||H.indexOf('vbscript:')===0){return '';}}var I='
    ';return I;};Renderer.prototype.image=function(E,F,G){var H=''+G+'':'>';return H;};Renderer.prototype.text=function(E){return E;};function Parser(E){this.tokens=[]; -this.token=null;this.options=E||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options;}Parser.parse=function(E,F,G){var H=new Parser(F,G);return H.parse(E);};Parser.prototype.parse=function(E){this.inline=new D(E.links,this.options,this.renderer); -this.tokens=E.reverse();var F='';while(this.next()){F+=this.tok();}return F;};Parser.prototype.next=function(){return this.token=this.tokens.pop();};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};Parser.prototype.parseText=function(){var E=this.token.text; -while(this.peek().type==='text'){E+='\n'+this.next().text;}return this.inline.output(E);};Parser.prototype.tok=function(){switch(this.token.type){case 'space':{return '';}case 'hr':{return this.renderer.hr();}case 'heading':{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text); -}case 'code':{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);}case 'table':{var E='',F='',i,G,H,I,j;H='';for(i=0;i/g,'>').replace(/"/g,'"').replace(/'/g,''');}function unescape(E){return E.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(_,n){n=n.toLowerCase(); -if(n==='colon'){return ':';}if(n.charAt(0)==='#'){return n.charAt(1)==='x'?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1));}return '';});}function replace(E,F){E=E.source;F=F||'';return function G(H,I){if(!H){return new RegExp(E,F); -}I=I.source||I;I=I.replace(/(^|[^\[])\^/g,'$1');E=E.replace(H,I);return G;};}function noop(){}noop.exec=noop;function merge(E){var i=1,F,G;for(;iAn error occured:

    '+escape(e.message+'',true)+'
    '; -}throw e;}}marked.options=marked.setOptions=function(E){merge(marked.defaults,E);return marked;};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new Renderer,xhtml:false} -;marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=B;marked.lexer=B.lex;marked.InlineLexer=D;marked.inlineLexer=D.output;marked.parse=marked;Roo.Markdown.marked=marked;})(); +);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&&/^
    /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(;i0.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 '
    '+(H?F:escape(F,true))+'\n
    ';}return '
    '+(H?F:escape(F,true))+'\n
    \n';};E.prototype.blockquote=function(F){return '
    \n'+F+'
    \n'; +};E.prototype.html=function(F){return F;};E.prototype.heading=function(F,G,H){return ''+F+'\n';};E.prototype.hr=function(){return this.options.xhtml?'
    \n':'
    \n'; +};E.prototype.list=function(F,G){var H=G?'ol':'ul';return '<'+H+'>\n'+F+'\n';};E.prototype.listitem=function(F){return '
  • '+F+'
  • \n';};E.prototype.paragraph=function(F){return '

    '+F+'

    \n';};E.prototype.table=function(F,G){return '\n'+'\n'+F+'\n'+'\n'+G+'\n'+'
    \n'; +};E.prototype.tablerow=function(F){return '\n'+F+'\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+'\n';};E.prototype.strong=function(F){return ''+F+''; +};E.prototype.em=function(F){return ''+F+'';};E.prototype.codespan=function(F){return ''+F+'';};E.prototype.br=function(){return this.options.xhtml?'
    ':'
    ';};E.prototype.del=function(F){return ''+F+'';};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='
    ';return J;};E.prototype.image=function(F,G,H){var I=''+H+'':'>';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/g,'>').replace(/"/g,'"').replace(/'/g,'''); +}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(;iAn error occured:

    '+escape(e.message+'',true)+'
    ';}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;})(); // 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){} diff --git a/roojs-core-debug.js b/roojs-core-debug.js index aecbedb276..30edece245 100644 --- a/roojs-core-debug.js +++ b/roojs-core-debug.js @@ -17556,7 +17556,7 @@ Roo.Markdown.toHtml = function(text) { * Renderer */ - function Renderer(options) { + var Renderer = function (options) { this.options = options || {}; } diff --git a/roojs-core.js b/roojs-core.js index 4300a794d5..a71159b302 100644 --- a/roojs-core.js +++ b/roojs-core.js @@ -688,57 +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',//)('closed',/<(tag)[\s\S]+?<\/\1>/)('closing',/])*?>/)(/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(E){this.tokens=[];this.tokens.links={};this.options=E||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}};B.rules=A;B.lex=function(E,F){var G=new B(F);return G.lex(E); -};B.prototype.lex=function(E){E=E.replace(/\r\n|\r/g,'\n').replace(/\t/g,' ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(E,true);};B.prototype.token=function(E,F,bq){var E=E.replace(/^ +$/gm,''),G,H,I,J,b,K,L,i,l;while(E){if(I=this.rules.newline.exec(E)){E=E.substring(I[0].length); -if(I[0].length>1){this.tokens.push({type:'space'});}}if(I=this.rules.code.exec(E)){E=E.substring(I[0].length);I=I[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?I.replace(/\n+$/,''):I});continue;}if(I=this.rules.fences.exec(E)){E=E.substring(I[0].length); -this.tokens.push({type:'code',lang:I[2],text:I[3]||''});continue;}if(I=this.rules.heading.exec(E)){E=E.substring(I[0].length);this.tokens.push({type:'heading',depth:I[1].length,text:I[2]});continue;}if(F&&(I=this.rules.nptable.exec(E))){E=E.substring(I[0].length); -K={type:'table',header:I[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:I[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:I[3].replace(/\n$/,'').split('\n')};for(i=0;i ?/gm,'');this.token(I,F,true); -this.tokens.push({type:'blockquote_end'});continue;}if(I=this.rules.list.exec(E)){E=E.substring(I[0].length);J=I[2];this.tokens.push({type:'list_start',ordered:J.length>1});I=I[0].match(this.rules.item);G=false;l=I.length;i=0;for(;i1&&b.length>1)){E=I.slice(i+1).join('\n')+E; -i=l-1;}}H=G||/\n\n(?!\s*$)/.test(K);if(i!==l-1){G=K.charAt(K.length-1)==='\n';if(!H){H=G;}}this.tokens.push({type:H?'loose_item_start':'list_item_start'});this.token(K,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'}); -continue;}if(I=this.rules.html.exec(E)){E=E.substring(I[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(I[1]==='pre'||I[1]==='script'||I[1]==='style'),text:I[0]});continue;}if((!bq&&F)&&(I=this.rules.def.exec(E))){E=E.substring(I[0].length); -this.tokens.links[I[1].toLowerCase()]={href:I[2],title:I[3]};continue;}if(F&&(I=this.rules.table.exec(E))){E=E.substring(I[0].length);K={type:'table',header:I[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:I[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:I[3].replace(/(?: *\| *)?\n$/,'').split('\n')} -;for(i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\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]+?(?=[\\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 ?/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(;i1&&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])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\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]+?(?=[\\?(?:\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(E,F){this.options=F||marked.defaults;this.links=E;this.rules=C.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options; -if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=C.breaks;}else{this.rules=C.gfm;}}else if(this.options.pedantic){this.rules=C.pedantic;}};D.rules=C;D.output=function(E,F,G){var H=new D(F,G); -return H.output(E);};D.prototype.output=function(E){var F='',G,H,I,J;while(E){if(J=this.rules.escape.exec(E)){E=E.substring(J[0].length);F+=J[1];continue;}if(J=this.rules.autolink.exec(E)){E=E.substring(J[0].length);if(J[2]==='@'){H=J[1].charAt(6)===':'?this.mangle(J[1].substring(7)):this.mangle(J[1]); -I=this.mangle('mailto:')+H;}else{H=escape(J[1]);I=H;}F+=this.renderer.link(I,null,H);continue;}if(!this.inLink&&(J=this.rules.url.exec(E))){E=E.substring(J[0].length);H=escape(J[1]);I=H;F+=this.renderer.link(I,null,H);continue;}if(J=this.rules.tag.exec(E)){if(!this.inLink&&/^
    /i.test(J[0])){this.inLink=false;}E=E.substring(J[0].length);F+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(J[0]):escape(J[0]):J[0];continue;}if(J=this.rules.link.exec(E)){E=E.substring(J[0].length);this.inLink=true; -F+=this.outputLink(J,{href:J[2],title:J[3]});this.inLink=false;continue;}if((J=this.rules.reflink.exec(E))||(J=this.rules.nolink.exec(E))){E=E.substring(J[0].length);G=(J[2]||J[1]).replace(/\s+/g,' ');G=this.links[G.toLowerCase()];if(!G||!G.href){F+=J[0].charAt(0); -E=J[0].substring(1)+E;continue;}this.inLink=true;F+=this.outputLink(J,G);this.inLink=false;continue;}if(J=this.rules.strong.exec(E)){E=E.substring(J[0].length);F+=this.renderer.strong(this.output(J[2]||J[1]));continue;}if(J=this.rules.em.exec(E)){E=E.substring(J[0].length); -F+=this.renderer.em(this.output(J[2]||J[1]));continue;}if(J=this.rules.code.exec(E)){E=E.substring(J[0].length);F+=this.renderer.codespan(escape(J[2],true));continue;}if(J=this.rules.br.exec(E)){E=E.substring(J[0].length);F+=this.renderer.br();continue;}if(J=this.rules.del.exec(E)){E=E.substring(J[0].length); -F+=this.renderer.del(this.output(J[1]));continue;}if(J=this.rules.text.exec(E)){E=E.substring(J[0].length);F+=this.renderer.text(escape(this.smartypants(J[0])));continue;}if(E){throw new Error('Infinite loop on byte: '+E.charCodeAt(0));}}return F;};D.prototype.outputLink=function(E,F){var G=escape(F.href),H=F.title?escape(F.title):null; -return E[0].charAt(0)!=='!'?this.renderer.link(G,H,this.output(E[1])):this.renderer.image(G,H,escape(E[1]));};D.prototype.smartypants=function(E){if(!this.options.smartypants){return E;}return E.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201c').replace(/"/g,'\u201d').replace(/\.{3}/g,'\u2026'); -};D.prototype.mangle=function(E){if(!this.options.mangle){return E;}var F='',l=E.length,i=0,ch;for(;i0.5){ch='x'+ch.toString(16);}F+='&#'+ch+';';}return F;};function Renderer(E){this.options=E||{};}Renderer.prototype.code=function(E,F,G){if(this.options.highlight){var H=this.options.highlight(E,F); -if(H!=null&&H!==E){G=true;E=H;}}else{G=true;}if(!F){return '
    '+(G?E:escape(E,true))+'\n
    ';}return '
    '+(G?E:escape(E,true))+'\n
    \n';};Renderer.prototype.blockquote=function(E){return '
    \n'+E+'
    \n'; -};Renderer.prototype.html=function(E){return E;};Renderer.prototype.heading=function(E,F,G){return ''+E+'\n';};Renderer.prototype.hr=function(){return this.options.xhtml?'
    \n':'
    \n'; -};Renderer.prototype.list=function(E,F){var G=F?'ol':'ul';return '<'+G+'>\n'+E+'\n';};Renderer.prototype.listitem=function(E){return '
  • '+E+'
  • \n';};Renderer.prototype.paragraph=function(E){return '

    '+E+'

    \n';};Renderer.prototype.table=function(E,F){return '\n'+'\n'+E+'\n'+'\n'+F+'\n'+'
    \n'; -};Renderer.prototype.tablerow=function(E){return '\n'+E+'\n';};Renderer.prototype.tablecell=function(E,F){var G=F.header?'th':'td';var H=F.align?'<'+G+' style="text-align:'+F.align+'">':'<'+G+'>';return H+E+'\n';};Renderer.prototype.strong=function(E){return ''+E+''; -};Renderer.prototype.em=function(E){return ''+E+'';};Renderer.prototype.codespan=function(E){return ''+E+'';};Renderer.prototype.br=function(){return this.options.xhtml?'
    ':'
    ';};Renderer.prototype.del=function(E){return ''+E+''; -};Renderer.prototype.link=function(E,F,G){if(this.options.sanitize){try{var H=decodeURIComponent(unescape(E)).replace(/[^\w:]/g,'').toLowerCase();}catch(e){return '';}if(H.indexOf('javascript:')===0||H.indexOf('vbscript:')===0){return '';}}var I='
    ';return I;};Renderer.prototype.image=function(E,F,G){var H=''+G+'':'>';return H;};Renderer.prototype.text=function(E){return E;};function Parser(E){this.tokens=[]; -this.token=null;this.options=E||marked.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options;}Parser.parse=function(E,F,G){var H=new Parser(F,G);return H.parse(E);};Parser.prototype.parse=function(E){this.inline=new D(E.links,this.options,this.renderer); -this.tokens=E.reverse();var F='';while(this.next()){F+=this.tok();}return F;};Parser.prototype.next=function(){return this.token=this.tokens.pop();};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0;};Parser.prototype.parseText=function(){var E=this.token.text; -while(this.peek().type==='text'){E+='\n'+this.next().text;}return this.inline.output(E);};Parser.prototype.tok=function(){switch(this.token.type){case 'space':{return '';}case 'hr':{return this.renderer.hr();}case 'heading':{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text); -}case 'code':{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);}case 'table':{var E='',F='',i,G,H,I,j;H='';for(i=0;i/g,'>').replace(/"/g,'"').replace(/'/g,''');}function unescape(E){return E.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g,function(_,n){n=n.toLowerCase(); -if(n==='colon'){return ':';}if(n.charAt(0)==='#'){return n.charAt(1)==='x'?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1));}return '';});}function replace(E,F){E=E.source;F=F||'';return function G(H,I){if(!H){return new RegExp(E,F); -}I=I.source||I;I=I.replace(/(^|[^\[])\^/g,'$1');E=E.replace(H,I);return G;};}function noop(){}noop.exec=noop;function merge(E){var i=1,F,G;for(;iAn error occured:

    '+escape(e.message+'',true)+'
    '; -}throw e;}}marked.options=marked.setOptions=function(E){merge(marked.defaults,E);return marked;};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new Renderer,xhtml:false} -;marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=B;marked.lexer=B.lex;marked.InlineLexer=D;marked.inlineLexer=D.output;marked.parse=marked;Roo.Markdown.marked=marked;})(); +);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&&/^
    /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(;i0.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 '
    '+(H?F:escape(F,true))+'\n
    ';}return '
    '+(H?F:escape(F,true))+'\n
    \n';};E.prototype.blockquote=function(F){return '
    \n'+F+'
    \n'; +};E.prototype.html=function(F){return F;};E.prototype.heading=function(F,G,H){return ''+F+'\n';};E.prototype.hr=function(){return this.options.xhtml?'
    \n':'
    \n'; +};E.prototype.list=function(F,G){var H=G?'ol':'ul';return '<'+H+'>\n'+F+'\n';};E.prototype.listitem=function(F){return '
  • '+F+'
  • \n';};E.prototype.paragraph=function(F){return '

    '+F+'

    \n';};E.prototype.table=function(F,G){return '\n'+'\n'+F+'\n'+'\n'+G+'\n'+'
    \n'; +};E.prototype.tablerow=function(F){return '\n'+F+'\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+'\n';};E.prototype.strong=function(F){return ''+F+''; +};E.prototype.em=function(F){return ''+F+'';};E.prototype.codespan=function(F){return ''+F+'';};E.prototype.br=function(){return this.options.xhtml?'
    ':'
    ';};E.prototype.del=function(F){return ''+F+'';};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='
    ';return J;};E.prototype.image=function(F,G,H){var I=''+H+'':'>';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/g,'>').replace(/"/g,'"').replace(/'/g,'''); +}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(;iAn error occured:

    '+escape(e.message+'',true)+'
    ';}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;})(); // 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){} diff --git a/roojs-debug.js b/roojs-debug.js index a6b7c027db..c686fb71ed 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -17556,7 +17556,7 @@ Roo.Markdown.toHtml = function(text) { * Renderer */ - function Renderer(options) { + var Renderer = function (options) { this.options = options || {}; } -- 2.39.2