From 24b789645eba916dd44f5f3cde0caa82bd237020 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 7 Feb 2020 15:00:53 +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 | 102 ++++++++++++++++++++++---------------------- roojs-core-debug.js | 2 +- roojs-core.js | 102 ++++++++++++++++++++++---------------------- roojs-debug.js | 2 +- 5 files changed, 105 insertions(+), 105 deletions(-) diff --git a/Roo/Markdown.js b/Roo/Markdown.js index 1c550f3d7d..1982c7a816 100644 --- a/Roo/Markdown.js +++ b/Roo/Markdown.js @@ -556,7 +556,7 @@ Roo.Markdown.toHtml = function(text) { * Inline Lexer & Compiler */ - function InlineLexer(links, options) { + var InlineLexer = function (links, options) { this.options = options || marked.defaults; this.links = links; this.rules = inline.normal; diff --git a/roojs-all.js b/roojs-all.js index 424cbdadee..b4c5ecfcc6 100644 --- a/roojs-all.js +++ b/roojs-all.js @@ -688,57 +688,57 @@ return Roo.Markdown.marked(A);};(function(){var A={newline:/^\n+/,code:/^( {4}[^ A._tag='(?!(?:'+'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'+'|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'+'|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';A.html=replace(A.html)('comment',//)('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*/} -);function Lexer(C){this.tokens=[];this.tokens.links={};this.options=C||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}}Lexer.rules=A;Lexer.lex=function(C,D){var E=new Lexer(D); -return E.lex(C);};Lexer.prototype.lex=function(C){C=C.replace(/\r\n|\r/g,'\n').replace(/\t/g,' ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(C,true);};Lexer.prototype.token=function(C,D,bq){var C=C.replace(/^ +$/gm,''),E,F,G,H,b,I,J,i,l; -while(C){if(G=this.rules.newline.exec(C)){C=C.substring(G[0].length);if(G[0].length>1){this.tokens.push({type:'space'});}}if(G=this.rules.code.exec(C)){C=C.substring(G[0].length);G=G[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?G.replace(/\n+$/,''):G} -);continue;}if(G=this.rules.fences.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'code',lang:G[2],text:G[3]||''});continue;}if(G=this.rules.heading.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'heading',depth:G[1].length,text:G[2]} -);continue;}if(D&&(G=this.rules.nptable.exec(C))){C=C.substring(G[0].length);I={type:'table',header:G[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:G[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:G[3].replace(/\n$/,'').split('\n')};for(i=0;i ?/gm,'');this.token(G,D,true);this.tokens.push({type:'blockquote_end'});continue;}if(G=this.rules.list.exec(C)){C=C.substring(G[0].length); -H=G[2];this.tokens.push({type:'list_start',ordered:H.length>1});G=G[0].match(this.rules.item);E=false;l=G.length;i=0;for(;i1&&b.length>1)){C=G.slice(i+1).join('\n')+C;i=l-1;}}F=E||/\n\n(?!\s*$)/.test(I);if(i!==l-1){E=I.charAt(I.length-1)==='\n';if(!F){F=E;}}this.tokens.push({type:F?'loose_item_start':'list_item_start'} -);this.token(I,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});continue;}if(G=this.rules.html.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(G[1]==='pre'||G[1]==='script'||G[1]==='style'),text:G[0]} -);continue;}if((!bq&&D)&&(G=this.rules.def.exec(C))){C=C.substring(G[0].length);this.tokens.links[G[1].toLowerCase()]={href:G[2],title:G[3]};continue;}if(D&&(G=this.rules.table.exec(C))){C=C.substring(G[0].length);I={type:'table',header:G[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:G[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:G[3].replace(/(?: *\| *)?\n$/,'').split('\n')} -;for(i=0;i])/,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*/;B.link=replace(B.link)('inside',B._inside)('href',B._href)();B.reflink=replace(B.reflink)('inside',B._inside)();B.normal=merge({},B);B.pedantic=merge({} -,B.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});B.gfm=merge({},B.normal,{escape:replace(B.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(B.text)(']|','~]|')('|','|https?://|')()} -);B.breaks=merge({},B.gfm,{br:replace(B.br)('{2,}','*')(),text:replace(B.gfm.text)('{2,}','*')()});function InlineLexer(C,D){this.options=D||marked.defaults;this.links=C;this.rules=B.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options; -if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=B.breaks;}else{this.rules=B.gfm;}}else if(this.options.pedantic){this.rules=B.pedantic;}}InlineLexer.rules=B;InlineLexer.output=function(C,D,E){var F=new InlineLexer(D,E); -return F.output(C);};InlineLexer.prototype.output=function(C){var D='',E,F,G,H;while(C){if(H=this.rules.escape.exec(C)){C=C.substring(H[0].length);D+=H[1];continue;}if(H=this.rules.autolink.exec(C)){C=C.substring(H[0].length);if(H[2]==='@'){F=H[1].charAt(6)===':'?this.mangle(H[1].substring(7)):this.mangle(H[1]); -G=this.mangle('mailto:')+F;}else{F=escape(H[1]);G=F;}D+=this.renderer.link(G,null,F);continue;}if(!this.inLink&&(H=this.rules.url.exec(C))){C=C.substring(H[0].length);F=escape(H[1]);G=F;D+=this.renderer.link(G,null,F);continue;}if(H=this.rules.tag.exec(C)){if(!this.inLink&&/^/i.test(H[0])){this.inLink=false;}C=C.substring(H[0].length);D+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(H[0]):escape(H[0]):H[0];continue;}if(H=this.rules.link.exec(C)){C=C.substring(H[0].length);this.inLink=true; -D+=this.outputLink(H,{href:H[2],title:H[3]});this.inLink=false;continue;}if((H=this.rules.reflink.exec(C))||(H=this.rules.nolink.exec(C))){C=C.substring(H[0].length);E=(H[2]||H[1]).replace(/\s+/g,' ');E=this.links[E.toLowerCase()];if(!E||!E.href){D+=H[0].charAt(0); -C=H[0].substring(1)+C;continue;}this.inLink=true;D+=this.outputLink(H,E);this.inLink=false;continue;}if(H=this.rules.strong.exec(C)){C=C.substring(H[0].length);D+=this.renderer.strong(this.output(H[2]||H[1]));continue;}if(H=this.rules.em.exec(C)){C=C.substring(H[0].length); -D+=this.renderer.em(this.output(H[2]||H[1]));continue;}if(H=this.rules.code.exec(C)){C=C.substring(H[0].length);D+=this.renderer.codespan(escape(H[2],true));continue;}if(H=this.rules.br.exec(C)){C=C.substring(H[0].length);D+=this.renderer.br();continue;}if(H=this.rules.del.exec(C)){C=C.substring(H[0].length); -D+=this.renderer.del(this.output(H[1]));continue;}if(H=this.rules.text.exec(C)){C=C.substring(H[0].length);D+=this.renderer.text(escape(this.smartypants(H[0])));continue;}if(C){throw new Error('Infinite loop on byte: '+C.charCodeAt(0));}}return D;};InlineLexer.prototype.outputLink=function(C,D){var E=escape(D.href),F=D.title?escape(D.title):null; -return C[0].charAt(0)!=='!'?this.renderer.link(E,F,this.output(C[1])):this.renderer.image(E,F,escape(C[1]));};InlineLexer.prototype.smartypants=function(C){if(!this.options.smartypants){return C;}return C.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201c').replace(/"/g,'\u201d').replace(/\.{3}/g,'\u2026'); -};InlineLexer.prototype.mangle=function(C){if(!this.options.mangle){return C;}var D='',l=C.length,i=0,ch;for(;i0.5){ch='x'+ch.toString(16);}D+='&#'+ch+';';}return D;};function Renderer(C){this.options=C||{};}Renderer.prototype.code=function(C,D,E){if(this.options.highlight){var F=this.options.highlight(C,D); -if(F!=null&&F!==C){E=true;C=F;}}else{E=true;}if(!D){return '
'+(E?C:escape(C,true))+'\n
';}return '
'+(E?C:escape(C,true))+'\n
\n';};Renderer.prototype.blockquote=function(C){return '
\n'+C+'
\n'; -};Renderer.prototype.html=function(C){return C;};Renderer.prototype.heading=function(C,D,E){return ''+C+'\n';};Renderer.prototype.hr=function(){return this.options.xhtml?'
\n':'
\n'; -};Renderer.prototype.list=function(C,D){var E=D?'ol':'ul';return '<'+E+'>\n'+C+'\n';};Renderer.prototype.listitem=function(C){return '
  • '+C+'
  • \n';};Renderer.prototype.paragraph=function(C){return '

    '+C+'

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

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

    '+D+'

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

    '+escape(e.message+'',true)+'
    '; +}throw e;}}marked.options=marked.setOptions=function(D){merge(marked.defaults,D);return marked;};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new Renderer,xhtml:false} +;marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=B;marked.lexer=B.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;Roo.Markdown.marked=marked;})(); // 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 334ca3f678..4a7002ae77 100644 --- a/roojs-core-debug.js +++ b/roojs-core-debug.js @@ -16898,7 +16898,7 @@ Roo.Markdown.toHtml = function(text) { * Block Lexer */ - function Lexer(options) { + var Lexer = function (options) { this.tokens = []; this.tokens.links = {}; this.options = options || marked.defaults; diff --git a/roojs-core.js b/roojs-core.js index 9eed568b55..ced05995d5 100644 --- a/roojs-core.js +++ b/roojs-core.js @@ -688,57 +688,57 @@ return Roo.Markdown.marked(A);};(function(){var A={newline:/^\n+/,code:/^( {4}[^ A._tag='(?!(?:'+'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'+'|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'+'|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';A.html=replace(A.html)('comment',//)('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*/} -);function Lexer(C){this.tokens=[];this.tokens.links={};this.options=C||marked.defaults;this.rules=A.normal;if(this.options.gfm){if(this.options.tables){this.rules=A.tables;}else{this.rules=A.gfm;}}}Lexer.rules=A;Lexer.lex=function(C,D){var E=new Lexer(D); -return E.lex(C);};Lexer.prototype.lex=function(C){C=C.replace(/\r\n|\r/g,'\n').replace(/\t/g,' ').replace(/\u00a0/g,' ').replace(/\u2424/g,'\n');return this.token(C,true);};Lexer.prototype.token=function(C,D,bq){var C=C.replace(/^ +$/gm,''),E,F,G,H,b,I,J,i,l; -while(C){if(G=this.rules.newline.exec(C)){C=C.substring(G[0].length);if(G[0].length>1){this.tokens.push({type:'space'});}}if(G=this.rules.code.exec(C)){C=C.substring(G[0].length);G=G[0].replace(/^ {4}/gm,'');this.tokens.push({type:'code',text:!this.options.pedantic?G.replace(/\n+$/,''):G} -);continue;}if(G=this.rules.fences.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'code',lang:G[2],text:G[3]||''});continue;}if(G=this.rules.heading.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:'heading',depth:G[1].length,text:G[2]} -);continue;}if(D&&(G=this.rules.nptable.exec(C))){C=C.substring(G[0].length);I={type:'table',header:G[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:G[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:G[3].replace(/\n$/,'').split('\n')};for(i=0;i ?/gm,'');this.token(G,D,true);this.tokens.push({type:'blockquote_end'});continue;}if(G=this.rules.list.exec(C)){C=C.substring(G[0].length); -H=G[2];this.tokens.push({type:'list_start',ordered:H.length>1});G=G[0].match(this.rules.item);E=false;l=G.length;i=0;for(;i1&&b.length>1)){C=G.slice(i+1).join('\n')+C;i=l-1;}}F=E||/\n\n(?!\s*$)/.test(I);if(i!==l-1){E=I.charAt(I.length-1)==='\n';if(!F){F=E;}}this.tokens.push({type:F?'loose_item_start':'list_item_start'} -);this.token(I,false,bq);this.tokens.push({type:'list_item_end'});}this.tokens.push({type:'list_end'});continue;}if(G=this.rules.html.exec(C)){C=C.substring(G[0].length);this.tokens.push({type:this.options.sanitize?'paragraph':'html',pre:!this.options.sanitizer&&(G[1]==='pre'||G[1]==='script'||G[1]==='style'),text:G[0]} -);continue;}if((!bq&&D)&&(G=this.rules.def.exec(C))){C=C.substring(G[0].length);this.tokens.links[G[1].toLowerCase()]={href:G[2],title:G[3]};continue;}if(D&&(G=this.rules.table.exec(C))){C=C.substring(G[0].length);I={type:'table',header:G[1].replace(/^ *| *\| *$/g,'').split(/ *\| */),align:G[2].replace(/^ *|\| *$/g,'').split(/ *\| */),cells:G[3].replace(/(?: *\| *)?\n$/,'').split('\n')} -;for(i=0;i])/,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*/;B.link=replace(B.link)('inside',B._inside)('href',B._href)();B.reflink=replace(B.reflink)('inside',B._inside)();B.normal=merge({},B);B.pedantic=merge({} -,B.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});B.gfm=merge({},B.normal,{escape:replace(B.escape)('])','~|])')(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(B.text)(']|','~]|')('|','|https?://|')()} -);B.breaks=merge({},B.gfm,{br:replace(B.br)('{2,}','*')(),text:replace(B.gfm.text)('{2,}','*')()});function InlineLexer(C,D){this.options=D||marked.defaults;this.links=C;this.rules=B.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options; -if(!this.links){throw new Error('Tokens array requires a `links` property.');}if(this.options.gfm){if(this.options.breaks){this.rules=B.breaks;}else{this.rules=B.gfm;}}else if(this.options.pedantic){this.rules=B.pedantic;}}InlineLexer.rules=B;InlineLexer.output=function(C,D,E){var F=new InlineLexer(D,E); -return F.output(C);};InlineLexer.prototype.output=function(C){var D='',E,F,G,H;while(C){if(H=this.rules.escape.exec(C)){C=C.substring(H[0].length);D+=H[1];continue;}if(H=this.rules.autolink.exec(C)){C=C.substring(H[0].length);if(H[2]==='@'){F=H[1].charAt(6)===':'?this.mangle(H[1].substring(7)):this.mangle(H[1]); -G=this.mangle('mailto:')+F;}else{F=escape(H[1]);G=F;}D+=this.renderer.link(G,null,F);continue;}if(!this.inLink&&(H=this.rules.url.exec(C))){C=C.substring(H[0].length);F=escape(H[1]);G=F;D+=this.renderer.link(G,null,F);continue;}if(H=this.rules.tag.exec(C)){if(!this.inLink&&/^
    /i.test(H[0])){this.inLink=false;}C=C.substring(H[0].length);D+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(H[0]):escape(H[0]):H[0];continue;}if(H=this.rules.link.exec(C)){C=C.substring(H[0].length);this.inLink=true; -D+=this.outputLink(H,{href:H[2],title:H[3]});this.inLink=false;continue;}if((H=this.rules.reflink.exec(C))||(H=this.rules.nolink.exec(C))){C=C.substring(H[0].length);E=(H[2]||H[1]).replace(/\s+/g,' ');E=this.links[E.toLowerCase()];if(!E||!E.href){D+=H[0].charAt(0); -C=H[0].substring(1)+C;continue;}this.inLink=true;D+=this.outputLink(H,E);this.inLink=false;continue;}if(H=this.rules.strong.exec(C)){C=C.substring(H[0].length);D+=this.renderer.strong(this.output(H[2]||H[1]));continue;}if(H=this.rules.em.exec(C)){C=C.substring(H[0].length); -D+=this.renderer.em(this.output(H[2]||H[1]));continue;}if(H=this.rules.code.exec(C)){C=C.substring(H[0].length);D+=this.renderer.codespan(escape(H[2],true));continue;}if(H=this.rules.br.exec(C)){C=C.substring(H[0].length);D+=this.renderer.br();continue;}if(H=this.rules.del.exec(C)){C=C.substring(H[0].length); -D+=this.renderer.del(this.output(H[1]));continue;}if(H=this.rules.text.exec(C)){C=C.substring(H[0].length);D+=this.renderer.text(escape(this.smartypants(H[0])));continue;}if(C){throw new Error('Infinite loop on byte: '+C.charCodeAt(0));}}return D;};InlineLexer.prototype.outputLink=function(C,D){var E=escape(D.href),F=D.title?escape(D.title):null; -return C[0].charAt(0)!=='!'?this.renderer.link(E,F,this.output(C[1])):this.renderer.image(E,F,escape(C[1]));};InlineLexer.prototype.smartypants=function(C){if(!this.options.smartypants){return C;}return C.replace(/---/g,'\u2014').replace(/--/g,'\u2013').replace(/(^|[-\u2014/(\[{"\s])'/g,'$1\u2018').replace(/'/g,'\u2019').replace(/(^|[-\u2014/(\[{\u2018\s])"/g,'$1\u201c').replace(/"/g,'\u201d').replace(/\.{3}/g,'\u2026'); -};InlineLexer.prototype.mangle=function(C){if(!this.options.mangle){return C;}var D='',l=C.length,i=0,ch;for(;i0.5){ch='x'+ch.toString(16);}D+='&#'+ch+';';}return D;};function Renderer(C){this.options=C||{};}Renderer.prototype.code=function(C,D,E){if(this.options.highlight){var F=this.options.highlight(C,D); -if(F!=null&&F!==C){E=true;C=F;}}else{E=true;}if(!D){return '
    '+(E?C:escape(C,true))+'\n
    ';}return '
    '+(E?C:escape(C,true))+'\n
    \n';};Renderer.prototype.blockquote=function(C){return '
    \n'+C+'
    \n'; -};Renderer.prototype.html=function(C){return C;};Renderer.prototype.heading=function(C,D,E){return ''+C+'\n';};Renderer.prototype.hr=function(){return this.options.xhtml?'
    \n':'
    \n'; -};Renderer.prototype.list=function(C,D){var E=D?'ol':'ul';return '<'+E+'>\n'+C+'\n';};Renderer.prototype.listitem=function(C){return '
  • '+C+'
  • \n';};Renderer.prototype.paragraph=function(C){return '

    '+C+'

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

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

    '+D+'

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

    '+escape(e.message+'',true)+'
    '; +}throw e;}}marked.options=marked.setOptions=function(D){merge(marked.defaults,D);return marked;};marked.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,sanitizer:null,mangle:true,smartLists:false,silent:false,highlight:null,langPrefix:'lang-',smartypants:false,headerPrefix:'',renderer:new Renderer,xhtml:false} +;marked.Parser=Parser;marked.parser=Parser.parse;marked.Renderer=Renderer;marked.Lexer=B;marked.lexer=B.lex;marked.InlineLexer=InlineLexer;marked.inlineLexer=InlineLexer.output;marked.parse=marked;Roo.Markdown.marked=marked;})(); // 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 72df33b2ab..0a37da05e6 100644 --- a/roojs-debug.js +++ b/roojs-debug.js @@ -16898,7 +16898,7 @@ Roo.Markdown.toHtml = function(text) { * Block Lexer */ - function Lexer(options) { + var Lexer = function (options) { this.tokens = []; this.tokens.links = {}; this.options = options || marked.defaults; -- 2.39.2