bbcode.min.js

main 1 lines · 17 KB Raw
Alex Alex Commit Initial commit 01/10/2026 09:20
1(t=>{var e=t.escapeEntities,n=t.escapeUriScheme,r=t.dom,l=t.utils,i=r.css,o=r.attr,a=r.is,s=l.extend,u=l.each,c="data-sceditor-emoticon",f=t.command.get,d={always:1,never:2,auto:3},h={bold:{txtExec:["[b]","[/b]"]},italic:{txtExec:["[i]","[/i]"]},underline:{txtExec:["[u]","[/u]"]},strike:{txtExec:["[s]","[/s]"]},subscript:{txtExec:["[sub]","[/sub]"]},superscript:{txtExec:["[sup]","[/sup]"]},left:{txtExec:["[left]","[/left]"]},center:{txtExec:["[center]","[/center]"]},right:{txtExec:["[right]","[/right]"]},justify:{txtExec:["[justify]","[/justify]"]},font:{txtExec:function(t){var e=this;f("font")._dropDown(e,t,function(t){e.insertText("[font="+t+"]","[/font]")})}},size:{txtExec:function(t){var e=this;f("size")._dropDown(e,t,function(t){e.insertText("[size="+t+"]","[/size]")})}},color:{txtExec:function(t){var e=this;f("color")._dropDown(e,t,function(t){e.insertText("[color="+t+"]","[/color]")})}},bulletlist:{txtExec:function(t,e){this.insertText("[ul]\n[li]"+e.split(/\r?\n/).join("[/li]\n[li]")+"[/li]\n[/ul]")}},orderedlist:{txtExec:function(t,e){this.insertText("[ol]\n[li]"+e.split(/\r?\n/).join("[/li]\n[li]")+"[/li]\n[/ol]")}},table:{txtExec:["[table][tr][td]","[/td][/tr][/table]"]},horizontalrule:{txtExec:["[hr]"]},code:{txtExec:["[code]","[/code]"]},image:{txtExec:function(t,e){var n=this;f("image")._dropDown(n,t,e,function(t,e,r){var l="";e&&(l+=" width="+e),r&&(l+=" height="+r),n.insertText("[img"+l+"]"+t+"[/img]")})}},email:{txtExec:function(t,e){var n=this;f("email")._dropDown(n,t,function(t,r){n.insertText("[email="+t+"]"+(r||e||t)+"[/email]")})}},link:{txtExec:function(t,e){var n=this;f("link")._dropDown(n,t,function(t,r){n.insertText("[url="+t+"]"+(r||e||t)+"[/url]")})}},quote:{txtExec:["[quote]","[/quote]"]},youtube:{txtExec:function(t){var e=this;f("youtube")._dropDown(e,t,function(t){e.insertText("[youtube]"+t+"[/youtube]")})}},rtl:{txtExec:["[rtl]","[/rtl]"]},ltr:{txtExec:["[ltr]","[/ltr]"]}},m={b:{tags:{b:null,strong:null},styles:{"font-weight":["bold","bolder","401","700","800","900"]},format:"[b]{0}[/b]",html:"<strong>{0}</strong>"},i:{tags:{i:null,em:null},styles:{"font-style":["italic","oblique"]},format:"[i]{0}[/i]",html:"<em>{0}</em>"},u:{tags:{u:null},styles:{"text-decoration":["underline"]},format:"[u]{0}[/u]",html:"<u>{0}</u>"},s:{tags:{s:null,strike:null},styles:{"text-decoration":["line-through"]},format:"[s]{0}[/s]",html:"<s>{0}</s>"},sub:{tags:{sub:null},format:"[sub]{0}[/sub]",html:"<sub>{0}</sub>"},sup:{tags:{sup:null},format:"[sup]{0}[/sup]",html:"<sup>{0}</sup>"},font:{tags:{font:{face:null}},styles:{"font-family":null},quoteType:d.never,format:function(t,e){var n;return"[font="+b(n=a(t,"font")&&(n=o(t,"face"))?n:i(t,"font-family"))+"]"+e+"[/font]"},html:'<font face="{defaultattr}">{0}</font>'},size:{tags:{font:{size:null}},styles:{"font-size":null},format:function(t,e){var n=o(t,"size"),r=2;return-1<(n=n||i(t,"fontSize")).indexOf("px")?((n=+n.replace("px",""))<12&&(r=1),15<n&&(r=3),17<n&&(r=4),23<n&&(r=5),31<n&&(r=6),47<n&&(r=7)):r=n,"[size="+r+"]"+e+"[/size]"},html:'<font size="{defaultattr}">{!0}</font>'},color:{tags:{font:{color:null}},styles:{color:null},quoteType:d.never,format:function(t,e){var n;return"[color="+I(n=a(t,"font")&&(n=o(t,"color"))?n:t.style.color||i(t,"color"))+"]"+e+"[/color]"},html:function(t,n,r){return'<font color="'+e(I(n.defaultattr),!0)+'">'+r+"</font>"}},ul:{tags:{ul:null},breakStart:!0,isInline:!1,skipLastLineBreak:!0,format:"[ul]{0}[/ul]",html:"<ul>{0}</ul>"},list:{breakStart:!0,isInline:!1,skipLastLineBreak:!0,html:"<ul>{0}</ul>"},ol:{tags:{ol:null},breakStart:!0,isInline:!1,skipLastLineBreak:!0,format:"[ol]{0}[/ol]",html:"<ol>{0}</ol>"},li:{tags:{li:null},isInline:!1,closedBy:["/ul","/ol","/list","*","li"],format:"[li]{0}[/li]",html:"<li>{0}</li>"},"*":{isInline:!1,closedBy:["/ul","/ol","/list","*","li"],html:"<li>{0}</li>"},table:{tags:{table:null},isInline:!1,isHtmlInline:!0,skipLastLineBreak:!0,format:"[table]{0}[/table]",html:"<table>{0}</table>"},tr:{tags:{tr:null},isInline:!1,skipLastLineBreak:!0,format:"[tr]{0}[/tr]",html:"<tr>{0}</tr>"},th:{tags:{th:null},allowsEmpty:!0,isInline:!1,format:"[th]{0}[/th]",html:"<th>{0}</th>"},td:{tags:{td:null},allowsEmpty:!0,isInline:!1,format:"[td]{0}[/td]",html:"<td>{0}</td>"},emoticon:{allowsEmpty:!0,tags:{img:{src:null,"data-sceditor-emoticon":null}},format:function(t,e){return o(t,c)+e},html:"{0}"},hr:{tags:{hr:null},allowsEmpty:!0,isSelfClosing:!0,isInline:!1,format:"[hr]{0}",html:"<hr />"},img:{allowsEmpty:!0,tags:{img:{src:null}},allowedChildren:["#"],quoteType:d.never,format:function(t,e){function n(e){return t.style?t.style[e]:null}var l,i="";return o(t,c)?e:(e=o(t,"width")||n("width"),l=o(t,"height")||n("height"),"[img"+(i=t.complete&&(e||l)||e&&l?"="+r.width(t)+"x"+r.height(t):i)+"]"+o(t,"src")+"[/img]")},html:function(t,r,l){var i="",o=r.width,a=r.height;return r.defaultattr&&(o=(r=r.defaultattr.split(/x/i))[0],a=2===r.length?r[1]:r[0]),void 0!==o&&(i+=' width="'+e(o,!0)+'"'),void 0!==a&&(i+=' height="'+e(a,!0)+'"'),"<img"+i+' src="'+n(l)+'" />'}},url:{allowsEmpty:!0,tags:{a:{href:null}},quoteType:d.never,format:function(t,e){return"mailto:"===(t=o(t,"href")).substr(0,7)?'[email="'+t.substr(7)+'"]'+e+"[/email]":"[url="+t+"]"+e+"[/url]"},html:function(t,r,l){return r.defaultattr=e(r.defaultattr,!0)||l,'<a href="'+n(r.defaultattr)+'">'+l+"</a>"}},email:{quoteType:d.never,html:function(t,n,r){return'<a href="mailto:'+(e(n.defaultattr,!0)||r)+'">'+r+"</a>"}},quote:{tags:{blockquote:null},isInline:!1,quoteType:d.never,format:function(t,e){for(var n,r="data-author",l="",i=t.children,s=0;!n&&s<i.length;s++)a(i[s],"cite")&&(n=i[s]);return(n||o(t,r))&&(l=n&&n.textContent||o(t,r),o(t,r,l),n&&t.removeChild(n),e=this.elementToBbcode(t),l="="+l.replace(/(^\s+|\s+$)/g,""),n)&&t.insertBefore(n,t.firstChild),"[quote"+l+"]"+e+"[/quote]"},html:function(t,n,r){return"<blockquote>"+(r=n.defaultattr?"<cite>"+e(n.defaultattr)+"</cite>"+r:r)+"</blockquote>"}},code:{tags:{code:null},isInline:!1,allowedChildren:["#","#newline"],format:"[code]{0}[/code]",html:"<code>{0}</code>"},left:{styles:{"text-align":["left","-webkit-left","-moz-left","-khtml-left"]},isInline:!1,allowsEmpty:!0,format:"[left]{0}[/left]",html:'<div align="left">{0}</div>'},center:{styles:{"text-align":["center","-webkit-center","-moz-center","-khtml-center"]},isInline:!1,allowsEmpty:!0,format:"[center]{0}[/center]",html:'<div align="center">{0}</div>'},right:{styles:{"text-align":["right","-webkit-right","-moz-right","-khtml-right"]},isInline:!1,allowsEmpty:!0,format:"[right]{0}[/right]",html:'<div align="right">{0}</div>'},justify:{styles:{"text-align":["justify","-webkit-justify","-moz-justify","-khtml-justify"]},isInline:!1,allowsEmpty:!0,format:"[justify]{0}[/justify]",html:'<div align="justify">{0}</div>'},youtube:{allowsEmpty:!0,tags:{iframe:{"data-youtube-id":null}},format:function(t,e){return(t=o(t,"data-youtube-id"))?"[youtube]"+t+"[/youtube]":e},html:'<iframe width="560" height="315" frameborder="0" src="https://www.youtube-nocookie.com/embed/{0}?wmode=opaque" data-youtube-id="{0}" allowfullscreen></iframe>'},rtl:{styles:{direction:["rtl"]},isInline:!1,format:"[rtl]{0}[/rtl]",html:'<div style="direction: rtl">{0}</div>'},ltr:{styles:{direction:["ltr"]},isInline:!1,format:"[ltr]{0}[/ltr]",html:'<div style="direction: ltr">{0}</div>'},ignore:{}};function p(t,n){return t.replace(/\{([^}]+)\}/g,function(t,r){var l=!0;return"!"===r.charAt(0)&&(l=!1,r=r.substring(1)),"0"===r&&(l=!1),void 0===n[r]?t:l?e(n[r],!0):n[r]})}function g(t){return"function"==typeof t}function b(t){return t&&t.replace(/\\(.)/g,"$1").replace(/^(["'])(.*?)\1$/,"$2")}var y="open",v="content",x="newline",k="close";function w(t,e,n,r,l,i){var o=this;o.type=t,o.name=e,o.val=n,o.attrs=r||{},o.children=l||[],o.closing=i||null}function E(t){var n=this;function r(t,e){var n,r,l;return t===y&&(n=e.match(/\[([^\]\s=]+)(?:([^\]]+))?\]/))&&(l=c(n[1]),n[2])&&(n[2]=n[2].trim())&&(r=(t=>{var e,n=/([^\s=]+)=(?:(?:(["'])((?:\\\2|[^\2])*?)\2)|((?:.(?!\s\S+=))*.))/g,r={};if("="===t.charAt(0)&&t.indexOf("=",1)<0)r.defaultattr=b(t.substr(1));else for("="===t.charAt(0)&&(t="defaultattr"+t);e=n.exec(t);)r[c(e[1])]=b(e[3])||e[4];return r})(n[2])),t===k&&(n=e.match(/\[\/([^\[\]]+)\]/))&&(l=c(n[1])),(l=t===x?"#newline":l)&&(t!==y&&t!==k||m[l])||(t=v,l="#"),new w(t,l,e,r)}function l(t,e,n){for(var r=n.length;r--;)if(n[r].type===e&&n[r].name===t)return 1}function i(t,e){return t=(t?m[t.name]:{}).allowedChildren,!n.opts.fixInvalidChildren||!t||-1<t.indexOf(e.name||"#")}function o(t,r){for(var l,i,a,s,u,c,f="",d=function(t){return!1!==(!t||(void 0!==t.isHtmlInline?t.isHtmlInline:t.isInline))};0<t.length;)if(l=t.shift()){if(l.type===y)c=l.children[l.children.length-1]||{},i=m[l.name],s=r&&d(i),a=o(l.children,!1),c=i&&i.html?(d(i)||!d(m[c.name])||i.isPreFormatted||i.skipLastLineBreak||(a+="<br />"),g(i.html)?i.html.call(n,l,l.attrs,a):(l.attrs[0]=a,p(i.html,l.attrs))):l.val+a+(l.closing?l.closing.val:"");else{if(l.type===x){if(!r){f+="<br />";continue}u||(f+="<div>"),f+="<br />",t.length||(f+="<br />"),f+="</div>\n",u=!1;continue}s=r,c=e(l.val,!0)}s&&!u?(f+="<div>",u=!0):!s&&u&&(f+="</div>\n",u=!1),f+=c}return u&&(f+="</div>\n"),f}function a(t,e,n){var r=/\s|=/.test(t);return g(e)?e(t,n):e===d.never||e===d.auto&&!r?t:'"'+t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')+'"'}function u(t){return t.length?t[t.length-1]:null}function c(t){return t.toLowerCase()}n.opts=s({},E.defaults,t),n.tokenize=function(t){var e,n,l,i=[],o=[{type:v,regex:/^([^\[\r\n]+|\[)/},{type:x,regex:/^(\r\n|\r|\n)/},{type:y,regex:/^\[[^\[\]]+\]/},{type:k,regex:/^\[\/[^\[\]]+\]/}];t:for(;t.length;){for(l=o.length;l--;)if(n=o[l].type,(e=t.match(o[l].regex))&&e[0]){i.push(r(n,e[0])),t=t.substr(e[0].length);continue t}t.length&&i.push(r(v,t)),t=""}return i},n.parse=function(t,e){t=(t=>{function e(){return u(g)}function r(t){(e()?e().children:p).push(t)}function o(t){return e()&&(s=m[e().name])&&s.closedBy&&-1<s.closedBy.indexOf(t)}for(var a,s,c,f,d,h=[],p=[],g=[];a=t.shift();)switch(d=t[0],i(e(),a)||a.type===k&&e()&&a.name===e().name||(a.name="#",a.type=v),a.type){case y:o(a.name)&&g.pop(),r(a),(s=m[a.name])&&!s.isSelfClosing&&(s.closedBy||l(a.name,k,t))?g.push(a):s&&s.isSelfClosing||(a.type=v);break;case k:if(e()&&a.name!==e().name&&o("/"+a.name)&&g.pop(),e()&&a.name===e().name)e().closing=a,g.pop();else if(l(a.name,y,g)){for(;c=g.pop();){if(c.name===a.name){c.closing=a;break}c=c.clone(),h.length&&c.children.push(u(h)),h.push(c)}for(d&&d.type===x&&(s=m[a.name])&&!1===s.isInline&&(r(d),t.shift()),r(u(h)),f=h.length;f--;)g.push(h[f]);h.length=0}else a.type=v,r(a);break;case x:e()&&d&&o((d.type===k?"/":"")+d.name)&&(d.type===k&&d.name===e().name||((s=m[e().name])&&s.breakAfter||s&&!1===s.isInline&&n.opts.breakAfterBlock&&!1!==s.breakAfter)&&g.pop()),r(a);break;default:r(a)}return p})(n.tokenize(t));var r=n.opts;return r.fixInvalidNesting&&function t(e,n,r,l){var o,a,s,c,f=function(t){return!(t=m[t.name])||!1!==t.isInline};for(n=n||[],l=l||e,a=0;a<e.length;a++)if((o=e[a])&&o.type===y){var d,h;if(r&&!f(o)&&(c=(h=u(n)).splitAt(o),s=1<n.length?n[n.length-2].children:l,i(o,h)&&((d=h.clone()).children=o.children,o.children=[d]),-1<(d=s.indexOf(h))))return c.children.splice(0,1),s.splice(d+1,0,o,c),void((h=c.children[0])&&h.type===x&&!f(o)&&(c.children.splice(0,1),s.splice(d+2,0,h)));n.push(o),t(o.children,n,r||f(o),l),n.pop()}}(t),function t(e,r,l){var i,o,a,s,u,c,f,d,h=e.length;r&&(s=m[r.name]);for(var p=h;p--;)(i=e[p])&&(i.type===x?(o=0<p?e[p-1]:null,a=p<h-1?e[p+1]:null,d=!1,!l&&s&&!0!==s.isSelfClosing&&(o?c||a||(!1===s.isInline&&n.opts.breakEndBlock&&!1!==s.breakEnd&&(d=!0),s.breakEnd&&(d=!0),c=d):(!1===s.isInline&&n.opts.breakStartBlock&&!1!==s.breakStart&&(d=!0),s.breakStart&&(d=!0))),o&&o.type===y&&(u=m[o.name])&&(l?!1===u.isInline&&(d=!0):(!1===u.isInline&&n.opts.breakAfterBlock&&!1!==u.breakAfter&&(d=!0),u.breakAfter&&(d=!0))),!l&&!f&&a&&a.type===y&&(u=m[a.name])&&(!1===u.isInline&&n.opts.breakBeforeBlock&&!1!==u.breakBefore&&(d=!0),u.breakBefore&&(d=!0),f=d)?e.splice(p,1):(d&&e.splice(p,1),f=!1)):i.type===y&&t(i.children,i,l))}(t,null,e),r.removeEmptyTags&&function t(e){for(var n,r,l=function(t){for(var e=t.length;e--;){var n=t[e].type;if(n===y||n===k)return!1;if(n===v&&/\S|\u00A0/.test(t[e].val))return!1}return!0},i=e.length;i--;)(n=e[i])&&n.type===y&&(r=m[n.name],t(n.children),l(n.children))&&r&&!r.isSelfClosing&&!r.allowsEmpty&&e.splice.apply(e,[i,1].concat(n.children))}(t),t},n.toHTML=function(t,e){return o(n.parse(t,e),!0)},n.toHTMLFragment=function(t,e){return o(n.parse(t,e),!1)},n.toBBCode=function(t,e){return function t(e){for(var r,l,i,o,s,u,c,f,h,p="";0<e.length;)if(r=e.shift())if(h=!(!(i=m[r.name])||!1!==i.isInline),o=i&&i.isSelfClosing,u=h&&n.opts.breakBeforeBlock&&!1!==i.breakBefore||i&&i.breakBefore,c=h&&!o&&n.opts.breakStartBlock&&!1!==i.breakStart||i&&i.breakStart,f=h&&n.opts.breakEndBlock&&!1!==i.breakEnd||i&&i.breakEnd,h=h&&n.opts.breakAfterBlock&&!1!==i.breakAfter||i&&i.breakAfter,s=(i?i.quoteType:null)||n.opts.quoteType||d.auto,i||r.type!==y)if(r.type===y){if(u&&(p+="\n"),p+="["+r.name,r.attrs)for(l in r.attrs.defaultattr&&(p+="="+a(r.attrs.defaultattr,s,"defaultattr"),delete r.attrs.defaultattr),r.attrs)r.attrs.hasOwnProperty(l)&&(p+=" "+l+"="+a(r.attrs[l],s,l));p+="]",c&&(p+="\n"),r.children&&(p+=t(r.children)),o||i.excludeClosing||(f&&(p+="\n"),p+="[/"+r.name+"]"),h&&(p+="\n"),r.closing&&o&&(p+=r.closing.val)}else p+=r.val;else p+=r.val,r.children&&(p+=t(r.children)),r.closing&&(p+=r.closing.val);return p}(n.parse(t,e))}}function B(t){return t=parseInt(t,10),isNaN(t)?"00":(t=Math.max(0,Math.min(t,255)).toString(16)).length<2?"0"+t:t}function I(t){var e;return(e=(t=t||"#000").match(/rgb\((\d{1,3}),\s*?(\d{1,3}),\s*?(\d{1,3})\)/i))?"#"+B(e[1])+B(e[2])+B(e[3]):(e=t.match(/#([0-9a-f])([0-9a-f])([0-9a-f])\s*?$/i))?"#"+e[1]+e[1]+e[2]+e[2]+e[3]+e[3]:t}function C(){var t=this,e=(t.stripQuotes=b,{}),n={ul:["li","ol","ul"],ol:["li","ol","ul"],table:["tr"],tr:["td","th"],code:["br","p","div"]};function l(n,l,i){function a(t){var e=t[0],l=(t=t[1],r.getStyle(n,e)),i=n.parentNode;return!(!l||i&&r.hasStyle(i,e,l))&&(!t||t.includes(l))}function s(r){e[r]&&e[r][i]&&u(e[r][i],function(e,r){var i,s=m[e].strictMatch,u=(s=void 0===s?t.opts.strictMatch:s)?"every":"some";if(!r||r[u]((i=s,function(t){var e=t[0];t=t[1];return("style"!==e||"CODE"!==n.nodeName)&&("style"===e&&t?t[i?"every":"some"](a):(e=o(n,e))&&(!t||t.includes(e)))})))return r=m[e].format,l=g(r)?r.call(t,n,l):function(t){var e=arguments;return t.replace(/\{(\d+)\}/g,function(t,n){return void 0!==e[+n+1]?e[+n+1]:"{"+n+"}"})}(r,l),!1})}return s("*"),s(n.nodeName.toLowerCase()),l}function f(t,e){return function t(e,i,s){var u="";return r.traverse(e,function(e){var f="",d=e.nodeType,h=e.nodeName.toLowerCase(),m="code"===h,p="img"===h&&!!o(e,c),g=n[h],b=e.firstChild,y=!0;!s||(y=-1<s.indexOf(h),y=p||y)||(g=s),1===d?a(e,".sceditor-nlf")&&!b||("iframe"!==h&&(f=t(e,i||m,g)),y?(i&&!p||(m||(f=l(e,f,!1)),f=l(e,f,!0)),u+=((t,e)=>{var n=t.nodeName.toLowerCase(),l=r.isInline;if(!l(t,!0)||"br"===n){for(var i,o,s=t.previousSibling;s&&1===s.nodeType&&!a(s,"br")&&l(s,!0)&&!s.firstChild;)s=s.previousSibling;for(;i=((o=t.parentNode)&&o.lastChild)===t,(t=o)&&i&&l(o,!0););i&&"li"!==n||(e+="\n"),"br"!==n&&s&&!a(s,"br")&&l(s,!0)&&(e="\n"+e)}return e})(e,f)):u+=f):3===d&&(u+=e.nodeValue)},!1,!0),u}(t,e)}function d(e,n,r){var l=new E(t.opts.parserOptions);return(e||r?l.toHTMLFragment:l.toHTML)(t.opts.bbcodeTrim?n.trim():n)}function p(e,n,l,o){l=l||document;var a,s=!!r.closest(o,"code"),u=l.createElement("div"),c=l.createElement("div"),d=new E(t.opts.parserOptions);for(c.innerHTML=n,i(u,"visibility","hidden"),u.appendChild(c),l.body.appendChild(u),e&&(u.insertBefore(l.createTextNode("#"),u.firstChild),u.appendChild(l.createTextNode("#"))),o&&i(c,"whiteSpace",i(o,"whiteSpace")),a=c.getElementsByClassName("sceditor-ignore");a.length;)a[0].parentNode.removeChild(a[0]);return r.removeWhiteSpace(u),n=f(c,s),l.body.removeChild(u),n=d.toBBCode(n,!0),t.opts.bbcodeTrim?n.trim():n}t.init=function(){t.opts=this.opts,t.elementToBbcode=f,u(m,function(t,n){var r=!1===n.isInline,l=(n=m[t].tags,m[t].styles);l&&(e["*"]=e["*"]||{},e["*"][r]=e["*"][r]||{},e["*"][r][t]=[["style",Object.entries(l)]]),n&&u(n,function(n,l){l&&l.style&&(l.style=Object.entries(l.style)),e[n]=e[n]||{},e[n][r]=e[n][r]||{},e[n][r][t]=l&&Object.entries(l)})}),this.commands=s(!0,{},h,this.commands),this.toBBCode=t.toSource,this.fromBBCode=t.toHtml},t.toHtml=d.bind(null,!1),t.fragmentToHtml=d.bind(null,!0),t.toSource=p.bind(null,!1),t.fragmentToSource=p.bind(null,!0)}w.prototype={clone:function(){var t=this;return new w(t.type,t.name,t.val,s({},t.attrs),[],t.closing?t.closing.clone():null)},splitAt:function(t){var e,n=this.clone();return-1<(t=this.children.indexOf(t))&&(e=this.children.length-t,n.children=this.children.splice(t,e)),n}},E.QuoteType=d,E.defaults={breakBeforeBlock:!1,breakStartBlock:!1,breakEndBlock:!1,breakAfterBlock:!0,removeEmptyTags:!0,fixInvalidNesting:!0,fixInvalidChildren:!0,quoteType:d.auto,strictMatch:!1},C.get=function(t){return m[t]||null},C.set=function(t,e){return t&&e&&((e=s(m[t]||{},e)).remove=function(){delete m[t]},m[t]=e),this},C.rename=function(t,e){return t in m&&(m[e]=m[t],delete m[t]),this},C.remove=function(t){return t in m&&delete m[t],this},C.formatBBCodeString=p,t.formats.bbcode=C,t.BBCodeParser=E})(sceditor);
Top