From 01dd8db0364ff0076a3819753b33f8c2f0208e58 Mon Sep 17 00:00:00 2001
From: Jason Meller S; ([\\w\\W]*?)<\\/p>/gi,"$2 "+7.C.22+" "+7.C.22+" ").Y(d(j).4H());d(j).1U(i);y g=d(i).6b();if(1o(g[0])!=="1k"&&g[0].X=="fN"){g.1j()}7.5G(i)}if((7.C.9z||7.C.7M||7.C.9D)&&f===7.2s.7m){7.9H(7.C.6f,7.C.9z,7.C.7M,7.C.9D);2h(d.K(B(){if(7.C.7M){7.3s()}if(7.C.5d){7.5d()}},7),5)}if(7.C.1B===E&&(f===7.2s.am||f===7.2s.6J)){F 7.dP(l)}7.1h("3D",l);7.12()},cB:B(){if(!7.C.9O){F}d.19(7.C.9O,d.K(B(f,g){if(9P[g]){d.3P(7,9P[g]);if(d.4V(9P[g].5t)){7.5t()}}},7))},cD:B(){7.cx();if(7.C.4S){7.a2(7.$1g)}G{7.$9Z=7.$1g.1T();7.$1g=7.7r(7.$9Z);7.a2(7.$9Z)}},a2:B(f){7.$1g.15("4r",7.C.4n).1T();7.$1M.7s(f).Y(7.$2e).Y(7.$1g)},cx:B(){7.$2e=d(\'<1p 16="2i: 2x%;" cm="0" />\').7O("bn",d.K(B(){if(7.C.2W){7.9X();if(7.3H===""){7.3H=7.C.22}7.$2e.1K()[0].cy(7.3H);7.$2e.1K()[0].cF();y f=dX(d.K(B(){if(7.$2e.1K().T("1Q").V()){cG(f);7.9S()}},7),0)}G{7.9S()}},7))},8f:B(){F 7.$2e[0].b0.Q},9X:B(){y f=7.8f();if(f.cO){f.km(f.cO)}F f},9V:B(f){f=f||7.C.U;if(7.f1(f)){7.$2e.1K().T("6u").Y(\'<2m 33="ki" 1w="\'+f+\'" />\')}if(d.kf(f)){d.19(f,d.K(B(h,g){7.9V(g)},7))}},9S:B(){7.$J=7.$2e.1K().T("1Q").15({30:M,4r:7.C.4n});if(7.$J[0]){7.Q=7.$J[0].kn;7.2Y=7.Q.ko||2Y}7.9V();if(7.C.2W){7.8Z(7.$J.V())}G{7.7x(7.3H,M,E)}7.9x();7.9b()},dZ:B(f){if(7.8p(f)){if(7.$44.15("3I")){7.C.3I=7.$44.15("3I")}if(7.C.3I===""){7.C.3I=E}if(7.C.3I!==E){7.C.1s=E;7.$J.7O("1s.4o",d.K(7.cJ,7));F d(\' ").Y(t.1K()))}G{j+=t.V()+" $2 \\\\s* &2j; \\\\s* "+p[h].I(/^\\n+|\\n+$/g,"")+" ","");t=t.I(" s* ([^<]+)(N|a3|1C)>","gi"," $1 s*(?"+f+"[^>]*>)s* (<1u.+?) s*(?"+f+"[^>]*>)","gi","$1");m=j("(?"+f+"[^>]*>)s*
")}}f=7.9p(f);7.$J.V(f);7.12()},bD:B(f){y g=7.9X();7.$2e[0].2w="hY:hZ";f=7.9n(f);f=7.6y(f);f=7.61(f);g.7q();g.cy(f);g.cF();if(7.C.2W){7.$J=7.$2e.1K().T("1Q").15({30:M,4r:7.C.4n})}7.12()},8Z:B(f){f=7.9r(f,M);f=7.9o(f);f=7.9p(f);7.$J.V(f);7.12()},12:B(){y f="";7.bX();if(7.C.2W){f=7.dw()}G{f=7.$J.V()}f=7.8K(f);f=7.61(f);f=7.9R(f);f=f.I(/<\\/1u><(2d|2y)>([\\w\\W]*?)<\\/(2d|2y)>/gi,"<$1>$2$1>1u>");if(d.2o(f)==="
"){f=""}if(f!==""&&7.C.ds){f=7.bZ(f)}f=f.I(/
/gi,"
");f=7.1h("ic",E,f);7.$1g.1f(f);7.1h("ie",E,f);if(7.4X===E){7.1h("7A",E,f)}},8K:B(f){if(!7.C.2W){f=7.6c(f)}f=d.2o(f);f=7.dc(f);f=f.I(/S;/gi,"");f=f.I(/d5;/gi,"");f=f.I(/&2j;/gi," ");if(7.C.dy){f=f.I(//gi,"");f=f.I(//gi,\'\')}f=f.I("","?>");f=f.I(/ 1i-5Q=""/gi,"");f=f.I(/
\\n?<\\/(P|H[1-6]|2H|7F|7G|7K|7H|7z|7y)>/gi,"$1>");f=f.I(/
"+7.C.22)}d(m).1U(g);7.3A(g)}if(1o m.5U!=="1k"&&m.5U!==2b){y n=d.2o(m.5U.I(/[^\\fb-\\fc]/g,""));if(m.1j&&m.3n===3&&m.5U.gS(0)==d5&&n==""){m.1j()}}}},9B:B(f){7.1x();f.1X();7.a0();7.1h("5Z",f);F},d6:B(l){if(a){F E}y f=l.6I;y h=7.3w();y j=7.2B();if(!7.C.1B&&j.3n==3&&(h==E||h.X=="8J")){y i=d("
"}if(v==0){u.28("L-jg").6a();s=7.5u(u)}G{u.1j()}}},7));V=7.$J.V().I(s,""+o+">"+j+"<"+o+">");7.$J.V(V);7.$J.T(o+":6a").1j()}G{7.Q.1H(i);y r=7.3w();y m=d(r).2A("2y, 2d");if(m.11){if((7.1G("3j")||7.1G("3o"))&&r.X!=="2H"){d(r).1U(d(r).V())}y n=m.1N();if(7.7d(n)&&7.6i(n[0])){n.1U(n.1K())}}if(7.1G("3o")){7.$J.1s()}}7.1n();7.12();7.1h("1H",i,h);F}if(i==="4z"){7.1x();y p=7.5M("A");if(p){d(p).1U(d(p).1e());7.12();7.1h("1H",i,h);F}}7.1P(i,h,q);if(i==="ba"){7.$J.T("hr").26("id")}},a5:B(){7.9A("4t")},9N:B(){7.9A("5n")},9A:B(i){7.1x();if(i==="4t"){y j=7.1Y();7.1F();if(j&&j.X=="2H"){y o=7.3w();y l=d(o).2A("2y, 2d");y n=l[0].X;y g=7.2E();d.19(g,B(t,u){if(u.X=="2H"){y r=d(u).6N();if(r.2n()!=0&&r[0].X=="2H"){y q=r.6O("2d, 2y");if(q.2n()==0){r.Y(d("<"+n+">").Y(u))}G{q.Y(u)}}}})}G{if(j===E&&7.C.1B===M){7.1P("59","2u");y p=7.1Y();y j=d(\'
$/gi)!==-1){f="
"+7.C.41}}}F f},9o:B(f){if(7.C.9E){f=f.I(/
\\\\s*
\\\\s*
\\s*
/gi,"\\n\\n");B j(s,i,q){F m.I(1V 2I(s,i),q)}y f="(jh|V|1Q|6u|R|9k|16|2p|2m|1p|1l|2Q|9y|iV|iU|iT|4y|2P|1E|9q|N|dl|dd|dt|2d|2y|1u|2l|5m|3t|1C|cq|cr|2u|a3|iG|16|p|h[1-6]|hr|co|jd|1D|fF|fD|iY|68|35|j4|kV|l8|kK|kI|kH)";m=j("(<"+f+"[^>]*>)","gi","\\n$1");m=j("("+f+">)","gi","$1\\n\\n");m=j("\\r\\n","g","\\n");m=j("\\r","g","\\n");m=j("/\\n\\n+/","g","\\n\\n");y p=m.3x(1V 2I("\\kA*\\n","g"),-1);m="";2O(y h in p){if(p.ky(h)){if(p[h].45("{I")==-1){m+="
");m=m.I(r,t)})}m=j("
","gi","$1");m=j("
(s*?(?:p|1u|N|dl|dd|dt|9q|2l|1E|2d|2y)[^>]*>)","gi","$1");m=j("\\n
","gi","<1u>");m=j("
1u>","gi","1u>");m=j("1u>","gi","1u>");m=j("
\\t?\\n?
","gi","
");m=j("
","gi","");m=j("
","gi","");m=j("
\\t*
","gi","");d.19(o,B(q,r){m=m.I("{I"+q+"}",r)});F d.2o(m)},6y:B(f){y g="3O";if(7.C.9v==="b"){g="b"}y h="em";if(7.C.9w==="i"){h="i"}f=f.I(/\\s?<\\/p>/gi,"");if(f===""||h===""){i.1X();y g=d(7.C.41).1S(0);7.$J.V(g);7.1s()}7.12()},3N:B(f){7.1x();y g=7.2E();7.1F();d.19(g,d.K(B(h,j){if(j.X!=="2H"){7.59(f,j)}},7));7.1n();7.12()},59:B(f,i){if(i===E){i=7.1Y()}if(i===E){if(7.C.1B===M){7.1H("fJ",f)}F M}y h="";if(f!=="2l"){h=d(i).1K()}G{h=d(i).V();if(d.2o(h)===""){h=\' "+h+" /gi,"<2d> ");h=h.I(/ /gi," 2d>");h=h.I(/|<\\?(?:3k)?[\\s\\S]*?\\?>/gi,"");h=h.I(/(&2j;){2,}/gi,"&2j;");h=h.I(/&2j;/gi," ");h=h.I(/([\\w\\W]*?)<\\/b>/gi,"$2");h=h.I(/([\\w\\W]*?)<\\/b>/gi,"$3");h=7.6c(h);h=h.I(/<1E><\\/1E>/gi,"[1E]");h=h.I(/<1E>&2j;<\\/1E>/gi,"[1E]");h=h.I(/<1E> )/gi,"$1");h=h.I(/\\[1E\\]/gi,"<1E>&2j;1E>");h=h.I(/\\[a 1w="(.*?)"\\]([\\w\\W]*?)\\[\\/a\\]/gi,\'$2\');h=h.I(/\\[1p(.*?)\\]([\\w\\W]*?)\\[\\/1p\\]/gi,"<1p$1>$21p>");h=h.I(/\\[2J(.*?)\\]([\\w\\W]*?)\\[\\/2J\\]/gi,"<2J$1>$22J>");h=h.I(/\\[4j(.*?)\\]([\\w\\W]*?)\\[\\/4j\\]/gi,"<4j$1>$24j>");h=h.I(/\\[3m(.*?)\\]([\\w\\W]*?)\\[\\/3m\\]/gi,"<3m$1>$23m>");h=h.I(/\\[2R(.*?)\\]([\\w\\W]*?)\\[\\/2R\\]/gi,"<2R$1>$22R>");h=h.I(/\\[5a(.*?)\\]/gi,"<5a$1>");h=h.I(/\\[1q(.*?)\\]/gi,"<1q$1>");if(7.C.9E){h=h.I(/ $2 /gi," ");h=h.I(/<\\/p><\\/N>/gi," ([\\w\\W]*?)<\\/p>/gi,"$1 /gi," ");h=h.I(/<\\/p><\\/p>/gi," /gi,"<1u>");h=h.I(/<\\/p>(\\s*|\\t*|\\n*)<\\/1u>/gi,"1u>");if(7.C.1B===M){h=h.I(/ ([\\w\\W]*?)<\\/p>/gi,"$2 •([\\w\\W]*?)<\\/p>/gi,"<1u>$11u>");2D(/<3B>([\\w\\W]*?)<\\/3B>/gi.3u(h)){h=h.I(/<3B>([\\w\\W]*?)<\\/3B>/gi,"$1")}7.7c(h)},eG:B(g){g=g.I(/ "+f+" "+f+" "+f+" "+i+" [^\\W\\w\\D\\d]*?<\\/p>$/i,"");F f==""},1G:B(g){y h=8E.8P.2X();y f=/(8L)[ \\/]([\\w.]+)/.1P(h)||/(3G)[ \\/]([\\w.]+)/.1P(h)||/(6H)(?:.*6M|)[ \\/]([\\w.]+)/.1P(h)||/(3j) ([\\w.]+)/.1P(h)||h.3r("g4")<0&&/(3o)(?:.*? gU:([\\w.]+)|)/.1P(h)||[];if(g=="6M"){F f[2]}if(g=="3G"){F(f[1]=="8L"||f[1]=="3G")}F f[1]==g},7Z:B(){if(7.1G("3j")&&6G(7.1G("6M"),10)<9){F M}F E},fk:B(g){y f=g.k0(M);y h=7.Q.3F("N");h.5v(f);F h.4v},8a:B(){y f=7.$J[0];y h=7.Q.ek();y g;2D((g=f.8V)){h.5v(g)}F h},7d:B(f){if(!f){F E}if(7.C.1p){F f}if(d(f).9I("N.34").11==0||d(f).3i("34")){F E}G{F f}},5M:B(f){y g=7.3w(),h=7.2B();F g&&g.X===f?g:h&&h.X===f?h:E},e7:B(){y g=7.1Y();y i=7.eF(g);y h=d.2o(d(g).1e()).I(/\\n\\r\\n/g,"");y f=h.11;if(i==f){F M}G{F E}},7b:B(){y f,g=7.1L();if(g&&g.4g&&g.4g>0){f=g.2U(0).4E}if(!f){F E}if(7.C.1p){if(7.eH().eL()){F!7.$J.is(f)}G{F M}}F d(f).2A("N.34").11!=0},3Q:B(g,f){if(d(g).15(f)==""){d(g).26(f)}},eJ:B(h,g){y f=2b;2D((f=h.3r(g))!==-1){h.6E(f,1)}F h}};c.4l.5t.4l=c.4l;d.3V.fn.9H=B(x,u,m,r){y s=/(^|&6d;|\\s)(9F\\..+?\\..+?)(\\s|>|$)/g,q=/(^|&6d;|\\s)(((71?|a1):\\/\\/|5S:).+?)(\\s|>|$)/g,f=/(71?:\\/\\/.*\\.(?:fP|hW|fK|eg))/gi,w=/^.*(hR.be\\/|v\\/|u\\/\\w\\/|3m\\/|gs\\?v=|\\&v=)([^#\\&\\?]*).*/,t=/7k:\\/\\/(9F\\.)?bJ.8v\\/(\\d+)($|\\/)/;y v=(7.$J?7.$J.1S(0):7).8Y,l=v.11;2D(l--){y j=v[l];if(j.3n===3){y p=j.5U;if(r&&p){y o=\'<1p 2i="bV" 1I="kY" 2w="\',h=\'" cm="0" l2>1p>\';if(p.1J(w)){p=p.I(w,o+"//9F.iI.8v/3m/$2"+h);d(j).1W(p).1j()}G{if(p.1J(t)){p=p.I(t,o+"//jm.bJ.8v/2J/$2"+h);d(j).1W(p).1j()}}}if(m&&p&&p.1J(f)){p=p.I(f,\'<1q 2w="$1">\');d(j).1W(p).1j()}if(u&&p&&(p.1J(s)||p.1J(q))){y g=(p.1J(s)||p.1J(q));g=g[0];if(g.11>50){g=g.7T(0,50)+"..."}p=p.I(/&/g,"&7Q;").I(/ S; ([\\w\\W]*?)<\\/p>/gi,"$2 "+7.C.22+" "+7.C.22+" ").Y(d(j).4H());d(j).1U(i);y g=d(i).6b();if(1o(g[0])!=="1k"&&g[0].X=="fN"){g.1j()}7.5G(i)}if((7.C.9z||7.C.7M||7.C.9D)&&f===7.2s.7m){7.9H(7.C.6f,7.C.9z,7.C.7M,7.C.9D);2h(d.K(B(){if(7.C.7M){7.3s()}if(7.C.5d){7.5d()}},7),5)}if(7.C.1B===E&&(f===7.2s.am||f===7.2s.6J)){F 7.dP(l)}7.1h("3D",l);7.12()},cB:B(){if(!7.C.9O){F}d.19(7.C.9O,d.K(B(f,g){if(9P[g]){d.3P(7,9P[g]);if(d.4V(9P[g].5t)){7.5t()}}},7))},cD:B(){7.cx();if(7.C.4S){7.a2(7.$1g)}G{7.$9Z=7.$1g.1T();7.$1g=7.7r(7.$9Z);7.a2(7.$9Z)}},a2:B(f){7.$1g.15("4r",7.C.4n).1T();7.$1M.7s(f).Y(7.$2e).Y(7.$1g)},cx:B(){7.$2e=d(\'<1p 16="2i: 2x%;" cm="0" />\').7O("bn",d.K(B(){if(7.C.2W){7.9X();if(7.3H===""){7.3H=7.C.22}7.$2e.1K()[0].cy(7.3H);7.$2e.1K()[0].cF();y f=dX(d.K(B(){if(7.$2e.1K().T("1Q").V()){cG(f);7.9S()}},7),0)}G{7.9S()}},7))},8f:B(){F 7.$2e[0].b0.Q},9X:B(){y f=7.8f();if(f.cO){f.km(f.cO)}F f},9V:B(f){f=f||7.C.U;if(7.f1(f)){7.$2e.1K().T("6u").Y(\'<2m 33="ki" 1w="\'+f+\'" />\')}if(d.kf(f)){d.19(f,d.K(B(h,g){7.9V(g)},7))}},9S:B(){7.$J=7.$2e.1K().T("1Q").15({30:M,4r:7.C.4n});if(7.$J[0]){7.Q=7.$J[0].kn;7.2Y=7.Q.ko||2Y}7.9V();if(7.C.2W){7.8Z(7.$J.V())}G{7.7x(7.3H,M,E)}7.9x();7.9b()},dZ:B(f){if(7.8p(f)){if(7.$44.15("3I")){7.C.3I=7.$44.15("3I")}if(7.C.3I===""){7.C.3I=E}if(7.C.3I!==E){7.C.1s=E;7.$J.7O("1s.4o",d.K(7.cJ,7));F d(\' ").Y(t.1K()))}G{j+=t.V()+" $2 \\\\s* &2j; \\\\s* "+p[h].I(/^\\n+|\\n+$/g,"")+" ","");t=t.I(" s* ([^<]+)(N|a3|1C)>","gi"," $1 s*(?"+f+"[^>]*>)s* (<1u.+?) s*(?"+f+"[^>]*>)","gi","$1");m=j("(?"+f+"[^>]*>)s* ","gi","<1u>");m=j(" ","gi","1u>");m=j(" \\t?\\n? ","gi"," ");m=j(" ","gi","");m=j(" ","gi","");m=j(" \\t* \\s?<\\/p>/gi,"");if(f===""||h===""){i.1X();y g=d(7.C.41).1S(0);7.$J.V(g);7.1s()}7.12()},3N:B(f){7.1x();y g=7.2E();7.1F();d.19(g,d.K(B(h,j){if(j.X!=="2H"){7.59(f,j)}},7));7.1n();7.12()},59:B(f,i){if(i===E){i=7.1Y()}if(i===E){if(7.C.1B===M){7.1H("fJ",f)}F M}y h="";if(f!=="2l"){h=d(i).1K()}G{h=d(i).V();if(d.2o(h)===""){h=\' "+h+" /gi,"<2d> ");h=h.I(/ /gi," 2d>");h=h.I(/|<\\?(?:3k)?[\\s\\S]*?\\?>/gi,"");h=h.I(/(&2j;){2,}/gi,"&2j;");h=h.I(/&2j;/gi," ");h=h.I(/([\\w\\W]*?)<\\/b>/gi,"$2");h=h.I(/([\\w\\W]*?)<\\/b>/gi,"$3");h=7.6c(h);h=h.I(/<1E><\\/1E>/gi,"[1E]");h=h.I(/<1E>&2j;<\\/1E>/gi,"[1E]");h=h.I(/<1E> )/gi,"$1");h=h.I(/\\[1E\\]/gi,"<1E>&2j;1E>");h=h.I(/\\[a 1w="(.*?)"\\]([\\w\\W]*?)\\[\\/a\\]/gi,\'$2\');h=h.I(/\\[1p(.*?)\\]([\\w\\W]*?)\\[\\/1p\\]/gi,"<1p$1>$21p>");h=h.I(/\\[2J(.*?)\\]([\\w\\W]*?)\\[\\/2J\\]/gi,"<2J$1>$22J>");h=h.I(/\\[4j(.*?)\\]([\\w\\W]*?)\\[\\/4j\\]/gi,"<4j$1>$24j>");h=h.I(/\\[3m(.*?)\\]([\\w\\W]*?)\\[\\/3m\\]/gi,"<3m$1>$23m>");h=h.I(/\\[2R(.*?)\\]([\\w\\W]*?)\\[\\/2R\\]/gi,"<2R$1>$22R>");h=h.I(/\\[5a(.*?)\\]/gi,"<5a$1>");h=h.I(/\\[1q(.*?)\\]/gi,"<1q$1>");if(7.C.9E){h=h.I(/ $2 /gi," ");h=h.I(/<\\/p><\\/N>/gi," ([\\w\\W]*?)<\\/p>/gi,"$1 /gi," ");h=h.I(/<\\/p><\\/p>/gi," /gi,"<1u>");h=h.I(/<\\/p>(\\s*|\\t*|\\n*)<\\/1u>/gi,"1u>");if(7.C.1B===M){h=h.I(/ ([\\w\\W]*?)<\\/p>/gi,"$2 •([\\w\\W]*?)<\\/p>/gi,"<1u>$11u>");2D(/<3B>([\\w\\W]*?)<\\/3B>/gi.3u(h)){h=h.I(/<3B>([\\w\\W]*?)<\\/3B>/gi,"$1")}7.7c(h)},eG:B(g){g=g.I(/ "+f+" "+f+" "+f+" "+i+" [^\\W\\w\\D\\d]*?<\\/p>$/i,"");F f==""},1G:B(g){y h=8E.8P.2X();y f=/(8L)[ \\/]([\\w.]+)/.1P(h)||/(3G)[ \\/]([\\w.]+)/.1P(h)||/(6H)(?:.*6M|)[ \\/]([\\w.]+)/.1P(h)||/(3j) ([\\w.]+)/.1P(h)||h.3r("g4")<0&&/(3o)(?:.*? gU:([\\w.]+)|)/.1P(h)||[];if(g=="6M"){F f[2]}if(g=="3G"){F(f[1]=="8L"||f[1]=="3G")}F f[1]==g},7Z:B(){if(7.1G("3j")&&6G(7.1G("6M"),10)<9){F M}F E},fk:B(g){y f=g.k0(M);y h=7.Q.3F("N");h.5v(f);F h.4v},8a:B(){y f=7.$J[0];y h=7.Q.ek();y g;2D((g=f.8V)){h.5v(g)}F h},7d:B(f){if(!f){F E}if(7.C.1p){F f}if(d(f).9I("N.34").11==0||d(f).3i("34")){F E}G{F f}},5M:B(f){y g=7.3w(),h=7.2B();F g&&g.X===f?g:h&&h.X===f?h:E},e7:B(){y g=7.1Y();y i=7.eF(g);y h=d.2o(d(g).1e()).I(/\\n\\r\\n/g,"");y f=h.11;if(i==f){F M}G{F E}},7b:B(){y f,g=7.1L();if(g&&g.4g&&g.4g>0){f=g.2U(0).4E}if(!f){F E}if(7.C.1p){if(7.eH().eL()){F!7.$J.is(f)}G{F M}}F d(f).2A("N.34").11!=0},3Q:B(g,f){if(d(g).15(f)==""){d(g).26(f)}},eJ:B(h,g){y f=2b;2D((f=h.3r(g))!==-1){h.6E(f,1)}F h}};c.4l.5t.4l=c.4l;d.3V.fn.9H=B(x,u,m,r){y s=/(^|&6d;|\\s)(9F\\..+?\\..+?)(\\s|>|$)/g,q=/(^|&6d;|\\s)(((71?|a1):\\/\\/|5S:).+?)(\\s|>|$)/g,f=/(71?:\\/\\/.*\\.(?:fP|hW|fK|eg))/gi,w=/^.*(hR.be\\/|v\\/|u\\/\\w\\/|3m\\/|gs\\?v=|\\&v=)([^#\\&\\?]*).*/,t=/7k:\\/\\/(9F\\.)?bJ.8v\\/(\\d+)($|\\/)/;y v=(7.$J?7.$J.1S(0):7).8Y,l=v.11;2D(l--){y j=v[l];if(j.3n===3){y p=j.5U;if(r&&p){y o=\'<1p 2i="bV" 1I="kY" 2w="\',h=\'" cm="0" l2>1p>\';if(p.1J(w)){p=p.I(w,o+"//9F.iI.8v/3m/$2"+h);d(j).1W(p).1j()}G{if(p.1J(t)){p=p.I(t,o+"//jm.bJ.8v/2J/$2"+h);d(j).1W(p).1j()}}}if(m&&p&&p.1J(f)){p=p.I(f,\'<1q 2w="$1">\');d(j).1W(p).1j()}if(u&&p&&(p.1J(s)||p.1J(q))){y g=(p.1J(s)||p.1J(q));g=g[0];if(g.11>50){g=g.7T(0,50)+"..."}p=p.I(/&/g,"&7Q;").I(/ ([\w\W]*?)<\/p>/gi, '$2 ' + this.opts.invisibleSpace + ' ' + this.opts.invisibleSpace + ' ').append(cloned.contents()));
- else data += cloned.html() + ' ').append(cloned.contents()));
+ else data += cloned.html() + ' ', '');
- str = str.replace(' \s* ([^<]+)(div|address|form)>', 'gi', " $1 \s*(?' + blocks + '[^>]*>)\s* \s?<\/p>/gi, '');
- html = html.replace(/ \s?<\/p>/gi, '');
-
- if (html === '' || thtml === '')
- {
- e.preventDefault();
+ if (html === '' || thtml === '')
+ {
+ e.preventDefault();
- var node = $(this.opts.emptyHtml).get(0);
- this.$editor.html(node);
- this.focus();
+ var node = $(this.opts.emptyHtml).get(0);
+ this.$editor.html(node);
+ this.focus();
+ }
}
this.sync();
@@ -3287,7 +3392,26 @@
{
if (node.tagName !== 'LI')
{
- this.formatBlock(tag, node);
+ var parent = $(node).parent();
+
+ if (tag === 'p')
+ {
+ if ((node.tagName === 'P'
+ && parent.size() != 0
+ && parent[0].tagName === 'BLOCKQUOTE')
+ ||
+ node.tagName === 'BLOCKQUOTE')
+ {
+ this.formatQuote();
+ return;
+ }
+ else if (this.opts.linebreaks) return;
+
+ }
+ else
+ {
+ this.formatBlock(tag, node);
+ }
}
}, this));
@@ -3348,25 +3472,109 @@
{
this.bufferSet();
+ // paragraphy
if (this.opts.linebreaks === false)
{
this.selectionSave();
var blocks = this.getBlocks();
+ var blockquote = false;
+ var blocksLen = blocks.length;
if (blocks)
{
+ var data = '';
+ var replaced = '';
+ var replace = false;
+ var paragraphsOnly = true;
+
+ $.each(blocks, function(i,s)
+ {
+ if (s.tagName !== 'P') paragraphsOnly = false;
+ });
+
$.each(blocks, $.proxy(function(i,s)
{
if (s.tagName === 'BLOCKQUOTE')
{
this.formatBlock('p', s, false);
}
+ else if (s.tagName === 'P')
+ {
+ blockquote = $(s).parent();
+ // from blockquote
+ if (blockquote[0].tagName == 'BLOCKQUOTE')
+ {
+ var count = $(blockquote).children('p').size();
+
+ // one
+ if (count == 1)
+ {
+ $(blockquote).replaceWith(s);
+ }
+ // all
+ else if (count == blocksLen)
+ {
+ replace = 'blockquote';
+ data += this.outerHtml(s);
+ }
+ // some
+ else
+ {
+ replace = 'html';
+ data += this.outerHtml(s);
+
+ if (i == 0)
+ {
+ $(s).addClass('redactor-replaced').empty();
+ replaced = this.outerHtml(s);
+ }
+ else $(s).remove();
+ }
+ }
+ // to blockquote
+ else
+ {
+ if (paragraphsOnly === false || blocks.length == 1)
+ {
+ this.formatBlock('blockquote', s, false);
+ }
+ else
+ {
+ replace = 'paragraphs';
+ data += this.outerHtml(s);
+ }
+ }
+
+ }
else if (s.tagName !== 'LI')
{
this.formatBlock('blockquote', s, false);
}
}, this));
+
+ if (replace)
+ {
+ if (replace == 'paragraphs')
+ {
+ $(blocks[0]).replaceWith(' ' + html + ' /gi, ' ');
- html = html.replace(/ /gi, ' /gi, ' /gi, ' /gi, ' /gi, '
")}G{y g=d("<"+f+">").Y(h);d(i).1U(g)}},ed:B(h,f,g){if(g!==E){7.1F()}y i=d("<"+f+"/>");d(h).1U(B(){F i.Y(d(7).1K())});if(g!==E){7.1n()}F i},fI:B(){7.1x();if(7.C.1B===E){7.1F();y l=7.2E();if(l){d.19(l,d.K(B(n,o){if(o.X==="4D"){7.59("p",o,E)}G{if(o.X!=="2H"){7.59("2u",o,E)}}},7))}7.1n()}G{y j=7.1Y();if(j.X==="4D"){7.1F();d(j).1U(d(j).V()+"
");7.1n()}G{y m=7.ec("2u");y h=d(m).V();y g=["2d","2y","1l","2P","4y","2Q","9y","dl"];d.19(g,B(n,o){h=h.I(1V 2I("<"+o+"(.*?)>","gi"),"");h=h.I(1V 2I(""+o+">","gi"),"")});y f=7.C.9W;f.23("1E");d.19(f,B(n,o){h=h.I(1V 2I("<"+o+"(.*?)>","gi"),"");h=h.I(1V 2I(""+o+">","gi"),"
")});d(m).V(h);7.8l(m);y i=d(m).6b();if(i.2n()!=0&&i[0].X==="fN"){i.1j()}}}7.12()},gf:B(f,h){y g=7.2E();d(g).26(f);7.12()},gn:B(f,h){y g=7.2E();d(g).15(f,h);7.12()},gp:B(g){y f=7.2E();d(f).U(g,"");7.3Q(f,"16");7.12()},gc:B(h,g){y f=7.2E();d(f).U(h,g);7.12()},fY:B(g){y f=7.2E();d(f).2k(g);7.3Q(f,"Z");7.12()},fX:B(g){y f=7.2E();d(f).28(g);7.12()},fW:B(f){7.1F();7.9U(B(g){d(g).2k(f);7.3Q(g,"Z")});7.1n();7.12()},g9:B(f){y g=7.2B();if(!d(g).3i(f)){7.4h("28",f)}},gb:B(f){7.1F();7.9U(B(g){d(g).U(f,"");7.3Q(g,"16")});7.1n();7.12()},g7:B(g,f){7.4h("U",g,f)},hg:B(f){7.1F();y h=7.2C(),i=7.64(),g=7.4Y();if(h.4w||h.4E===h.63&&i){g=d(i)}d(g).26(f);7.fH();7.1n();7.12()},he:B(f,g){7.4h("15",f,g)},4h:B(i,f,j){7.1x();7.1F();y g=7.2C();y h=7.64();if((g.4w||g.4E===g.63)&&h&&!7.6i(h)){d(h)[i](f,j)}G{7.Q.1H("5K",E,4);y l=7.$J.T("3B");d.19(l,d.K(B(m,n){7.fM(i,n,f,j)},7))}7.1n();7.12()},fM:B(j,i,f,l){y h=d(i).1N(),g;if(h&&h[0].X==="9T"&&h[0].gB.11!=0){g=h;d(i).1U(d(i).V())}G{g=d(\'
"+(7.1G("3G")?7.C.22:""));7.1n()},l5:B(){7.1F();7.$J.T("#2c-1y-1").38("
"+(7.1G("3G")?7.C.22:""));7.1n()},ev:B(f){y g=d("
"+7.C.22);d(f).1U(g);7.3A(g)},er:B(h){h=7.1h("iN",E,h);if(7.C.es){y g=7.Q.3F("N");h=h.I(/
|<\\/H[1-6]>|<\\/p>|<\\/N>/gi,"\\n");g.4v=h;h=g.80||g.e6;h=h.I("\\n","
");h=7.70(h);7.7c(h);F E}if(7.5M("4C")){h=7.eG(h);7.7c(h);F M}h=h.I(/
<\\/1E>/gi,"[1E]");h=h.I(/([\\w\\W]*?)<\\/a>/gi,\'[a 1w="$2"]$4[/a]\');h=h.I(/<1p(.*?)>([\\w\\W]*?)<\\/1p>/gi,"[1p$1]$2[/1p]");h=h.I(/<2J(.*?)>([\\w\\W]*?)<\\/2J>/gi,"[2J$1]$2[/2J]");h=h.I(/<4j(.*?)>([\\w\\W]*?)<\\/4j>/gi,"[4j$1]$2[/4j]");h=h.I(/<3m(.*?)>([\\w\\W]*?)<\\/3m>/gi,"[3m$1]$2[/3m]");h=h.I(/<2R(.*?)>([\\w\\W]*?)<\\/2R>/gi,"[2R$1]$2[/2R]");h=h.I(/<5a(.*?)>/gi,"[5a$1]");h=h.I(/<1q(.*?)16="(.*?)"(.*?)>/gi,"[1q$1$3]");h=h.I(/<1q(.*?)>/gi,"[1q$1]");h=h.I(/ Z="(.*?)"/gi,"");h=h.I(/<(\\w+)([\\w\\W]*?)>/gi,"<$1>");h=h.I(/<[^\\/>][^>]*>(\\s*|\\t*|\\n*|&2j;|
)<\\/[^>]+>/gi,"");h=h.I(/
")}G{h=7.70(h)}h=h.I(/
)<\\/[^>]+>/gi,"");h=h.I(/\\n{3,}/gi,"\\n");h=h.I(/
")}h=h.I(/<[^\\/>][^>][^1q|5a|1g]*>(\\s*|\\t*|\\n*|&2j;|
)<\\/[^>]+>/gi,"");h=h.I(/<1q 2w="3G-iO-32\\:\\/\\/(.*?)"(.*?)>/gi,"");7.9G=E;if(7.1G("3o")){if(7.C.7h){y i=h.1J(/<1q 2w="1i:1c(.*?)"(.*?)>/gi);if(i!==2b){7.9G=i;2O(k in i){y f=i[k].I("<1q",\'<1q 1i-3o-7j-1c="\'+k+\'" \');h=h.I(i[k],f)}}}2D(/
$/gi.3u(h)){h=h.I(/
$/gi,"")}}h=h.I(/
|<\\/H[1-6]>|<\\/p>|<\\/N>/gi,"\\n");y f=7.Q.3F("N");f.4v=g;F 7.9C(f.80||f.e6)},7c:B(f){if(7.4F){if(!7.C.1B){7.$J.V(7.C.41)}G{7.$J.V("")}7.$J.1s()}f=7.1h("iK",E,f);7.7g(f);7.4F=E;2h(d.K(B(){a=E;if(7.1G("3o")){7.$J.T("p:6a").1j()}if(7.9G!==E){7.e8()}},7),2x);if(7.C.4a){d(7.Q.1Q).3v(7.7i)}G{7.$J.3v(7.7i)}},e8:B(){y f=7.$J.T("1q[1i-3o-7j-1c]");d.19(f,d.K(B(j,l){y h=d(l);y g=l.2w.3x(",");y m=g[1];y n=g[0].3x(";")[0].3x(":")[1];d.5g(7.C.9L,{aH:n,1i:m},d.K(B(o){y i=d.6Y(o);h.15("2w",i.4J);h.26("1i-3o-7j-1c");7.12();7.1h("3c",h,i)},7))},7))},e9:B(i){y g=i.1z.j1;y f=g.3x(",");y h=f[1];y j=f[0].3x(";")[0].3x(":")[1];if(7.C.7h){d.5g(7.C.9L,{aH:j,1i:h},d.K(B(n){y m=d.6Y(n);y l=\'<1q 2w="\'+m.4J+\'" id="e4-1c-1y" />\';7.1H("3M",l,E);y o=d(7.$J.T("1q#e4-1c-1y"));if(o.11){o.26("id")}G{o=E}7.12();if(o){7.1h("3c",o,m)}},7))}G{7.7g(\'<1q 2w="\'+g+\'" />\')}},1x:B(f){if(f!==1k){7.C.4d.23(f)}G{7.1F();7.C.4d.23(7.$J.V());7.7V("4d")}},e0:B(){if(7.C.4d.11===0){7.$J.1s();F}7.1F();7.C.5z.23(7.$J.V());7.1n(E,M);7.$J.V(7.C.4d.e3());7.1n();2h(d.K(7.5c,7),2x)},e1:B(){if(7.C.5z.11===0){7.$J.1s();F E}7.1F();7.C.4d.23(7.$J.V());7.1n(E,M);7.$J.V(7.C.5z.e3());7.1n(M);2h(d.K(7.5c,7),4)},5c:B(){7.3s();7.ea();if(7.C.5d){7.5d()}},5d:B(){7.$J.T("a").1d("1v",d.K(7.eb,7));7.$J.1d("1v.L",d.K(B(f){7.5I(f)},7))},ea:B(){7.$J.T("1l").1d("1v",d.K(7.8H,7))},3s:B(){if(7.C.3s===E){F E}7.$J.T("1q").19(d.K(B(f,g){if(7.1G("3j")){d(g).15("kz","1d")}7.f9(g)},7))},eb:B(h){y i=d(h.1z);y l=i.2M();if(7.C.1p){y g=7.$2e.2M();l.1O=g.1O+(l.1O-d(7.Q).3v());l.1m+=g.1m}y o=d(\'2P>");2O(n=0;n
|
|&2j;/gi,"");f=f.I(/\\s/g,"");f=f.I(/^
")}}f=7.9p(f);7.$J.V(f);7.12()},bD:B(f){y g=7.9X();7.$2e[0].2w="hY:hZ";f=7.9n(f);f=7.6y(f);f=7.61(f);g.7q();g.cy(f);g.cF();if(7.C.2W){7.$J=7.$2e.1K().T("1Q").15({30:M,4r:7.C.4n})}7.12()},8Z:B(f){f=7.9r(f,M);f=7.9o(f);f=7.9p(f);7.$J.V(f);7.12()},12:B(){y f="";7.bX();if(7.C.2W){f=7.dw()}G{f=7.$J.V()}f=7.8K(f);f=7.61(f);f=7.9R(f);f=f.I(/<\\/1u><(2d|2y)>([\\w\\W]*?)<\\/(2d|2y)>/gi,"<$1>$2$1>1u>");if(d.2o(f)==="
"){f=""}if(f!==""&&7.C.ds){f=7.bZ(f)}f=f.I(/
/gi,"
");f=7.1h("ic",E,f);7.$1g.1f(f);7.1h("ie",E,f);if(7.4X===E){7.1h("7A",E,f)}},8K:B(f){if(!7.C.2W){f=7.6c(f)}f=d.2o(f);f=7.dc(f);f=f.I(/S;/gi,"");f=f.I(/d5;/gi,"");f=f.I(/&2j;/gi," ");if(7.C.dy){f=f.I(//gi,"");f=f.I(//gi,\'\')}f=f.I("","?>");f=f.I(/ 1i-5Q=""/gi,"");f=f.I(/
\\n?<\\/(P|H[1-6]|2H|7F|7G|7K|7H|7z|7y)>/gi,"$1>");f=f.I(/
"+7.C.22)}d(m).1U(g);7.3A(g)}if(1o m.5U!=="1k"&&m.5U!==2b){y n=d.2o(m.5U.I(/[^\\fb-\\fc]/g,""));if(m.1j&&m.3n===3&&m.5U.gS(0)==d5&&n==""){m.1j()}}}},9B:B(f){7.1x();f.1X();7.a0();7.1h("5Z",f);F},d6:B(l){if(a){F E}y f=l.6I;y h=7.3w();y j=7.2B();if(!7.C.1B&&j.3n==3&&(h==E||h.X=="8J")){y i=d("
"}if(v==0){u.28("L-jg").6a();s=7.5u(u)}G{u.1j()}}},7));V=7.$J.V().I(s,""+o+">"+j+"<"+o+">");7.$J.V(V);7.$J.T(o+":6a").1j()}G{7.Q.1H(i);y r=7.3w();y m=d(r).2A("2y, 2d");if(m.11){if((7.1G("3j")||7.1G("3o"))&&r.X!=="2H"){d(r).1U(d(r).V())}y n=m.1N();if(7.7d(n)&&7.6i(n[0])){n.1U(n.1K())}}if(7.1G("3o")){7.$J.1s()}}7.1n();7.12();7.1h("1H",i,h);F}if(i==="4z"){7.1x();y p=7.5M("A");if(p){d(p).1U(d(p).1e());7.12();7.1h("1H",i,h);F}}7.1P(i,h,q);if(i==="ba"){7.$J.T("hr").26("id")}},a5:B(){7.9A("4t")},9N:B(){7.9A("5n")},9A:B(i){7.1x();if(i==="4t"){y j=7.1Y();7.1F();if(j&&j.X=="2H"){y o=7.3w();y l=d(o).2A("2y, 2d");y n=l[0].X;y g=7.2E();d.19(g,B(t,u){if(u.X=="2H"){y r=d(u).6N();if(r.2n()!=0&&r[0].X=="2H"){y q=r.6O("2d, 2y");if(q.2n()==0){r.Y(d("<"+n+">").Y(u))}G{q.Y(u)}}}})}G{if(j===E&&7.C.1B===M){7.1P("59","2u");y p=7.1Y();y j=d(\'
$/gi)!==-1){f="
"+7.C.41}}}F f},9o:B(f){if(7.C.9E){f=f.I(/
\\\\s*
\\\\s*
\\s*
/gi,"\\n\\n");B j(s,i,q){F m.I(1V 2I(s,i),q)}y f="(jh|V|1Q|6u|R|9k|16|2p|2m|1p|1l|2Q|9y|iV|iU|iT|4y|2P|1E|9q|N|dl|dd|dt|2d|2y|1u|2l|5m|3t|1C|cq|cr|2u|a3|iG|16|p|h[1-6]|hr|co|jd|1D|fF|fD|iY|68|35|j4|kV|l8|kK|kI|kH)";m=j("(<"+f+"[^>]*>)","gi","\\n$1");m=j("("+f+">)","gi","$1\\n\\n");m=j("\\r\\n","g","\\n");m=j("\\r","g","\\n");m=j("/\\n\\n+/","g","\\n\\n");y p=m.3x(1V 2I("\\kA*\\n","g"),-1);m="";2O(y h in p){if(p.ky(h)){if(p[h].45("{I")==-1){m+="
");m=m.I(r,t)})}m=j("
","gi","$1");m=j("
(s*?(?:p|1u|N|dl|dd|dt|9q|2l|1E|2d|2y)[^>]*>)","gi","$1");m=j("\\n
/i,"");y h=f.I(/
")}G{y g=d("<"+f+">").Y(h);d(i).1U(g)}},ed:B(h,f,g){if(g!==E){7.1F()}y i=d("<"+f+"/>");d(h).1U(B(){F i.Y(d(7).1K())});if(g!==E){7.1n()}F i},fI:B(){7.1x();if(7.C.1B===E){7.1F();y l=7.2E();if(l){d.19(l,d.K(B(n,o){if(o.X==="4D"){7.59("p",o,E)}G{if(o.X!=="2H"){7.59("2u",o,E)}}},7))}7.1n()}G{y j=7.1Y();if(j.X==="4D"){7.1F();d(j).1U(d(j).V()+"
");7.1n()}G{y m=7.ec("2u");y h=d(m).V();y g=["2d","2y","1l","2P","4y","2Q","9y","dl"];d.19(g,B(n,o){h=h.I(1V 2I("<"+o+"(.*?)>","gi"),"");h=h.I(1V 2I(""+o+">","gi"),"")});y f=7.C.9W;f.23("1E");d.19(f,B(n,o){h=h.I(1V 2I("<"+o+"(.*?)>","gi"),"");h=h.I(1V 2I(""+o+">","gi"),"
")});d(m).V(h);7.8l(m);y i=d(m).6b();if(i.2n()!=0&&i[0].X==="fN"){i.1j()}}}7.12()},gf:B(f,h){y g=7.2E();d(g).26(f);7.12()},gn:B(f,h){y g=7.2E();d(g).15(f,h);7.12()},gp:B(g){y f=7.2E();d(f).U(g,"");7.3Q(f,"16");7.12()},gc:B(h,g){y f=7.2E();d(f).U(h,g);7.12()},fY:B(g){y f=7.2E();d(f).2k(g);7.3Q(f,"Z");7.12()},fX:B(g){y f=7.2E();d(f).28(g);7.12()},fW:B(f){7.1F();7.9U(B(g){d(g).2k(f);7.3Q(g,"Z")});7.1n();7.12()},g9:B(f){y g=7.2B();if(!d(g).3i(f)){7.4h("28",f)}},gb:B(f){7.1F();7.9U(B(g){d(g).U(f,"");7.3Q(g,"16")});7.1n();7.12()},g7:B(g,f){7.4h("U",g,f)},hg:B(f){7.1F();y h=7.2C(),i=7.64(),g=7.4Y();if(h.4w||h.4E===h.63&&i){g=d(i)}d(g).26(f);7.fH();7.1n();7.12()},he:B(f,g){7.4h("15",f,g)},4h:B(i,f,j){7.1x();7.1F();y g=7.2C();y h=7.64();if((g.4w||g.4E===g.63)&&h&&!7.6i(h)){d(h)[i](f,j)}G{7.Q.1H("5K",E,4);y l=7.$J.T("3B");d.19(l,d.K(B(m,n){7.fM(i,n,f,j)},7))}7.1n();7.12()},fM:B(j,i,f,l){y h=d(i).1N(),g;if(h&&h[0].X==="9T"&&h[0].gB.11!=0){g=h;d(i).1U(d(i).V())}G{g=d(\'
"+(7.1G("3G")?7.C.22:""));7.1n()},l5:B(){7.1F();7.$J.T("#2c-1y-1").38("
"+(7.1G("3G")?7.C.22:""));7.1n()},ev:B(f){y g=d("
"+7.C.22);d(f).1U(g);7.3A(g)},er:B(h){h=7.1h("iN",E,h);if(7.C.es){y g=7.Q.3F("N");h=h.I(/
|<\\/H[1-6]>|<\\/p>|<\\/N>/gi,"\\n");g.4v=h;h=g.80||g.e6;h=h.I("\\n","
");h=7.70(h);7.7c(h);F E}if(7.5M("4C")){h=7.eG(h);7.7c(h);F M}h=h.I(/
<\\/1E>/gi,"[1E]");h=h.I(/([\\w\\W]*?)<\\/a>/gi,\'[a 1w="$2"]$4[/a]\');h=h.I(/<1p(.*?)>([\\w\\W]*?)<\\/1p>/gi,"[1p$1]$2[/1p]");h=h.I(/<2J(.*?)>([\\w\\W]*?)<\\/2J>/gi,"[2J$1]$2[/2J]");h=h.I(/<4j(.*?)>([\\w\\W]*?)<\\/4j>/gi,"[4j$1]$2[/4j]");h=h.I(/<3m(.*?)>([\\w\\W]*?)<\\/3m>/gi,"[3m$1]$2[/3m]");h=h.I(/<2R(.*?)>([\\w\\W]*?)<\\/2R>/gi,"[2R$1]$2[/2R]");h=h.I(/<5a(.*?)>/gi,"[5a$1]");h=h.I(/<1q(.*?)16="(.*?)"(.*?)>/gi,"[1q$1$3]");h=h.I(/<1q(.*?)>/gi,"[1q$1]");h=h.I(/ Z="(.*?)"/gi,"");h=h.I(/<(\\w+)([\\w\\W]*?)>/gi,"<$1>");h=h.I(/<[^\\/>][^>]*>(\\s*|\\t*|\\n*|&2j;|
)<\\/[^>]+>/gi,"");h=h.I(/
")}G{h=7.70(h)}h=h.I(/
)<\\/[^>]+>/gi,"");h=h.I(/\\n{3,}/gi,"\\n");h=h.I(/
")}h=h.I(/<[^\\/>][^>][^1q|5a|1g]*>(\\s*|\\t*|\\n*|&2j;|
)<\\/[^>]+>/gi,"");h=h.I(/<1q 2w="3G-iO-32\\:\\/\\/(.*?)"(.*?)>/gi,"");7.9G=E;if(7.1G("3o")){if(7.C.7h){y i=h.1J(/<1q 2w="1i:1c(.*?)"(.*?)>/gi);if(i!==2b){7.9G=i;2O(k in i){y f=i[k].I("<1q",\'<1q 1i-3o-7j-1c="\'+k+\'" \');h=h.I(i[k],f)}}}2D(/
$/gi.3u(h)){h=h.I(/
$/gi,"")}}h=h.I(/
|<\\/H[1-6]>|<\\/p>|<\\/N>/gi,"\\n");y f=7.Q.3F("N");f.4v=g;F 7.9C(f.80||f.e6)},7c:B(f){if(7.4F){if(!7.C.1B){7.$J.V(7.C.41)}G{7.$J.V("")}7.$J.1s()}f=7.1h("iK",E,f);7.7g(f);7.4F=E;2h(d.K(B(){a=E;if(7.1G("3o")){7.$J.T("p:6a").1j()}if(7.9G!==E){7.e8()}},7),2x);if(7.C.4a){d(7.Q.1Q).3v(7.7i)}G{7.$J.3v(7.7i)}},e8:B(){y f=7.$J.T("1q[1i-3o-7j-1c]");d.19(f,d.K(B(j,l){y h=d(l);y g=l.2w.3x(",");y m=g[1];y n=g[0].3x(";")[0].3x(":")[1];d.5g(7.C.9L,{aH:n,1i:m},d.K(B(o){y i=d.6Y(o);h.15("2w",i.4J);h.26("1i-3o-7j-1c");7.12();7.1h("3c",h,i)},7))},7))},e9:B(i){y g=i.1z.j1;y f=g.3x(",");y h=f[1];y j=f[0].3x(";")[0].3x(":")[1];if(7.C.7h){d.5g(7.C.9L,{aH:j,1i:h},d.K(B(n){y m=d.6Y(n);y l=\'<1q 2w="\'+m.4J+\'" id="e4-1c-1y" />\';7.1H("3M",l,E);y o=d(7.$J.T("1q#e4-1c-1y"));if(o.11){o.26("id")}G{o=E}7.12();if(o){7.1h("3c",o,m)}},7))}G{7.7g(\'<1q 2w="\'+g+\'" />\')}},1x:B(f){if(f!==1k){7.C.4d.23(f)}G{7.1F();7.C.4d.23(7.$J.V());7.7V("4d")}},e0:B(){if(7.C.4d.11===0){7.$J.1s();F}7.1F();7.C.5z.23(7.$J.V());7.1n(E,M);7.$J.V(7.C.4d.e3());7.1n();2h(d.K(7.5c,7),2x)},e1:B(){if(7.C.5z.11===0){7.$J.1s();F E}7.1F();7.C.4d.23(7.$J.V());7.1n(E,M);7.$J.V(7.C.5z.e3());7.1n(M);2h(d.K(7.5c,7),4)},5c:B(){7.3s();7.ea();if(7.C.5d){7.5d()}},5d:B(){7.$J.T("a").1d("1v",d.K(7.eb,7));7.$J.1d("1v.L",d.K(B(f){7.5I(f)},7))},ea:B(){7.$J.T("1l").1d("1v",d.K(7.8H,7))},3s:B(){if(7.C.3s===E){F E}7.$J.T("1q").19(d.K(B(f,g){if(7.1G("3j")){d(g).15("kz","1d")}7.f9(g)},7))},eb:B(h){y i=d(h.1z);y l=i.2M();if(7.C.1p){y g=7.$2e.2M();l.1O=g.1O+(l.1O-d(7.Q).3v());l.1m+=g.1m}y o=d(\'2P>");2O(n=0;n
|
|&2j;/gi,"");f=f.I(/\\s/g,"");f=f.I(/^
');
@@ -745,6 +760,10 @@
html = this.cleanEmpty(html);
this.$editor.html(html);
+
+ // set no editable
+ this.setNonEditable();
+ this.setSpansVerified();
this.sync();
},
setCodeIframe: function(html)
@@ -766,6 +785,9 @@
this.$editor = this.$frame.contents().find('body').attr({ 'contenteditable': true, 'dir': this.opts.direction });
}
+ // set no editable
+ this.setNonEditable();
+ this.setSpansVerified();
this.sync();
},
@@ -777,8 +799,41 @@
// set code
this.$editor.html(html);
+
+ // set no editable
+ this.setNonEditable();
+ this.setSpansVerified();
this.sync();
},
+ setSpansVerified: function()
+ {
+ var spans = this.$editor.find('span');
+ var replacementTag = 'inline';
+
+ $.each(spans, function() {
+ var outer = this.outerHTML;
+
+ // Replace opening tag
+ var regex = new RegExp('<' + this.tagName, 'i');
+ var newTag = outer.replace(regex, '<' + replacementTag);
+
+ // Replace closing tag
+ regex = new RegExp('' + this.tagName, 'i');
+ newTag = newTag.replace(regex, '' + replacementTag);
+
+ $(this).replaceWith(newTag);
+ });
+
+ },
+ setSpansVerifiedHtml: function(html)
+ {
+ html = html.replace(//, '
') html = '';
- if (html !== '' && this.opts.tidyHtml) html = this.cleanHtml(html);
- html = html.replace(/
/gi, '
');
+ // xhtml
+ if (this.opts.xhtml)
+ {
+ var xhtmlTags = ['br', 'hr', 'img', 'link', 'input', 'meta'];
+ $.each(xhtmlTags, function(i,s)
+ {
+ html = html.replace(new RegExp('<' + s + '(.*?[^\/$]?)>', 'gi'), '<' + s + '$1 />');
+ });
+
+ }
// before callback
html = this.callback('syncBefore', false, html);
@@ -841,6 +904,9 @@
html = html.replace('', '?>');
+ // revert no editable
+ html = html.replace(/<(.*?)class="noeditable"(.*?) contenteditable="false"(.*?)>/gi, '<$1class="noeditable"$2$3>');
+
html = html.replace(/ data-tagblock=""/gi, '');
html = html.replace(/
\n?<\/(P|H[1-6]|LI|ADDRESS|SECTION|HEADER|FOOTER|ASIDE|ARTICLE)>/gi, '$1>');
@@ -849,20 +915,16 @@
html = html.replace(/(.*?)<\/span>/i, '');
html = html.replace(/(.*?)<\/span>/i, '');
+ // remove font
+ html = html.replace(/([\w\W]*?)<\/font>/gi, '$2');
+
// remove spans
- html = html.replace(/([\w\W]*?)<\/span>/gi, '$1');
- html = html.replace(/([\w\W]*?)<\/span>/gi, '$3');
- html = html.replace(/([\w\W]*?)<\/span>/gi, '$3' );
- html = html.replace(/([\w\W]*?)<\/span>/gi, '$1');
- html = html.replace(/([\w\W]*?)<\/span>/gi, '');
- html = html.replace(/([\w\W]*?)<\/span>/gi, '$1');
- html = html.replace(/([\w\W]*?)<\/span>/gi, '$3');
- html = html.replace(/([\w\W]*?)<\/span>/gi, '$3' );
- html = html.replace(/([\w\W]*?)<\/span>/gi, '$1');
+ html = html.replace(/([\w\W]*?)<\/span>/gi, '$2');
+ html = html.replace(/
' + this.opts.invisibleSpace);
+ var node;
+ if (this.opts.linebreaks === false) node = $('
' + this.opts.invisibleSpace);
- $(current).replaceWith(node);
- this.selectionStart(node);
- }
+ $(current).replaceWith(node);
+ this.selectionStart(node);
+ }
- if (typeof current.nodeValue !== 'undefined' && current.nodeValue !== null)
+ if (typeof current.nodeValue !== 'undefined' && current.nodeValue !== null)
+ {
+ //var value = $.trim(current.nodeValue.replace(/[^\u0000-\u1C7F]/g, ''));
+ if (current.remove && current.nodeType === 3 && current.nodeValue.match(/[^/\u200B]/g) == null)
{
- var value = $.trim(current.nodeValue.replace(/[^\u0000-\u1C7F]/g, ''));
- if (current.remove && current.nodeType === 3 && current.nodeValue.charCodeAt(0) == 8203 && value == '')
- {
- current.remove();
- }
+ current.remove();
}
}
},
@@ -1392,7 +1478,7 @@
},
buildEventKeyup: function(e)
{
- if (rtePaste) return false;
+ if (this.rtePaste) return false;
var key = e.which;
var parent = this.getParent();
@@ -1414,17 +1500,11 @@
// convert links
if ((this.opts.convertLinks || this.opts.convertImageLinks || this.opts.convertVideoLinks) && key === this.keyCode.ENTER)
{
- this.formatLinkify(this.opts.linkProtocol, this.opts.convertLinks, this.opts.convertImageLinks, this.opts.convertVideoLinks);
-
- setTimeout($.proxy(function()
- {
- if (this.opts.convertImageLinks) this.observeImages();
- if (this.opts.observeLinks) this.observeLinks();
- }, this), 5);
+ this.buildEventKeyupConverters();
}
// if empty
- if (this.opts.linebreaks === false && (key === this.keyCode.DELETE || key === this.keyCode.BACKSPACE))
+ if (key === this.keyCode.DELETE || key === this.keyCode.BACKSPACE)
{
return this.formatEmpty(e);
}
@@ -1432,6 +1512,16 @@
this.callback('keyup', e);
this.sync();
},
+ buildEventKeyupConverters: function()
+ {
+ this.formatLinkify(this.opts.linkProtocol, this.opts.convertLinks, this.opts.convertImageLinks, this.opts.convertVideoLinks, this.opts.linkSize);
+
+ setTimeout($.proxy(function()
+ {
+ if (this.opts.convertImageLinks) this.observeImages();
+ if (this.opts.observeLinks) this.observeLinks();
+ }, this), 5);
+ },
buildPlugins: function()
{
if (!this.opts.plugins ) return;
@@ -1576,6 +1666,10 @@
// place the cursor inside emptyHtml
this.selectionStart(this.$editor.children()[0]);
}
+ else
+ {
+ this.focus();
+ }
this.sync();
},
@@ -1657,89 +1751,95 @@
sel.addRange(range);
},
-
// TOGGLE
toggle: function(direct)
{
- var html;
- if (this.opts.visual)
+ if (this.opts.visual) this.toggleCode(direct);
+ else this.toggleVisual();
+ },
+ toggleVisual: function()
+ {
+ var html = this.$source.hide().val();
+
+ if (typeof this.modified !== 'undefined')
{
- if (direct !== false) this.selectionSave();
+ this.modified = this.cleanRemoveSpaces(this.modified, false) !== this.cleanRemoveSpaces(html, false);
+ }
- var height = null;
- if (this.opts.iframe)
- {
- height = this.$frame.height();
- if (this.opts.fullpage) this.$editor.removeAttr('contenteditable');
- this.$frame.hide();
- }
+ if (this.modified)
+ {
+ // don't remove the iframe even if cleared all.
+ if (this.opts.fullpage && html === '') this.setFullpageOnInit(html);
else
{
- height = this.$editor.innerHeight();
- this.$editor.hide();
+ this.set(html);
+ if (this.opts.fullpage) this.buildBindKeyboard();
}
+ }
- html = this.$source.val();
- this.modified = html;
+ if (this.opts.iframe) this.$frame.show();
+ else this.$editor.show();
- this.$source.height(height).show().focus();
+ if (this.opts.fullpage) this.$editor.attr('contenteditable', true );
- // textarea indenting
- this.$source.on('keydown.redactor-textarea-indenting', function (e)
- {
- if (e.keyCode === 9)
- {
- var $el = $(this);
- var start = $el.get(0).selectionStart;
- $el.val($el.val().substring(0, start) + "\t" + $el.val().substring($el.get(0).selectionEnd));
- $el.get(0).selectionStart = $el.get(0).selectionEnd = start + 1;
- return false;
- }
- });
+ this.$source.off('keydown.redactor-textarea-indenting');
+
+ this.$editor.focus();
+ this.selectionRestore();
- this.buttonInactiveVisual();
- this.buttonActive('html');
- this.opts.visual = false;
+ this.observeStart();
+ this.buttonActiveVisual();
+ this.buttonInactive('html');
+ this.opts.visual = true;
+ },
+ toggleCode: function(direct)
+ {
+ if (direct !== false) this.selectionSave();
+ var height = null;
+ if (this.opts.iframe)
+ {
+ height = this.$frame.height();
+ if (this.opts.fullpage) this.$editor.removeAttr('contenteditable');
+ this.$frame.hide();
}
else
{
- html = this.$source.hide().val();
-
- if (typeof this.modified !== 'undefined')
- {
- this.modified = this.cleanRemoveSpaces(this.modified, false) !== this.cleanRemoveSpaces(html, false);
- }
+ height = this.$editor.innerHeight();
+ this.$editor.hide();
+ }
- if (this.modified)
- {
- // don't remove the iframe even if cleared all.
- if (this.opts.fullpage && html === '') this.setFullpageOnInit(html);
- else
- {
- this.set(html);
- if (this.opts.fullpage) this.buildBindKeyboard();
- }
- }
+ var html = this.$source.val();
- if (this.opts.iframe) this.$frame.show();
- else this.$editor.show();
+ // tidy html
+ if (html !== '' && this.opts.tidyHtml)
+ {
+ this.$source.val(this.cleanHtml(html));
+ }
- if (this.opts.fullpage ) this.$editor.attr('contenteditable', true );
+ this.modified = html;
- this.$source.off('keydown.redactor-textarea-indenting');
+ this.$source.height(height).show().focus();
- this.$editor.focus();
- this.selectionRestore();
+ // textarea indenting
+ this.$source.on('keydown.redactor-textarea-indenting', this.textareaIndenting);
- this.observeStart();
- this.buttonActiveVisual();
- this.buttonInactive('html');
- this.opts.visual = true;
+ this.buttonInactiveVisual();
+ this.buttonActive('html');
+ this.opts.visual = false;
+ },
+ textareaIndenting: function(e)
+ {
+ if (e.keyCode === 9)
+ {
+ var $el = $(this);
+ var start = $el.get(0).selectionStart;
+ $el.val($el.val().substring(0, start) + "\t" + $el.val().substring($el.get(0).selectionEnd));
+ $el.get(0).selectionStart = $el.get(0).selectionEnd = start + 1;
+ return false;
}
},
-
// AUTOSAVE
autosave: function()
{
@@ -1904,7 +2004,6 @@
var text = this.getSelectionText();
if (e.type === 'mouseup' && text != '') this.airShow(e);
-
if (e.type === 'keyup' && e.shiftKey && text != '')
{
var $focusElem = $(this.getElement(this.getSelection().focusNode)), offset = $focusElem.offset();
@@ -2113,7 +2212,7 @@
// BUTTONS
buttonBuild: function(btnName, btnObject)
{
- var $button = $('');
+ var $button = $('');
$button.on('click', $.proxy(function(e)
{
@@ -2369,128 +2468,138 @@
return;
}
- // stop formatting pre
- if (this.currentOrParentIs('PRE') && !this.opts.formattingPre)
- {
- return false;
- }
-
- if (cmd === 'insertunorderedlist' || cmd === 'insertorderedlist')
- {
- this.bufferSet();
+ // Stop formatting pre
+ if (this.currentOrParentIs('PRE') && !this.opts.formattingPre) return false;
- var parent = this.getParent();
- var $list = $(parent).closest('ol, ul');
- var remove = false;
+ // Lists
+ if (cmd === 'insertunorderedlist' || cmd === 'insertorderedlist') return this.execLists(cmd, param);
- if ($list.length)
- {
- remove = true;
- var listTag = $list[0].tagName;
- if ((cmd === 'insertunorderedlist' && listTag === 'OL')
- || (cmd === 'insertorderedlist' && listTag === 'UL'))
- {
- remove = false;
- }
- }
+ // Unlink
+ if (cmd === 'unlink') return this.execUnlink(cmd, param);
- this.selectionSave();
+ // Usual exec
+ this.exec(cmd, param, sync);
- // remove lists
- if (remove)
- {
- var nodes = this.getNodes();
- var elems = this.getBlocks(nodes);
+ // Line
+ if (cmd === 'inserthorizontalrule') this.$editor.find('hr').removeAttr('id');
- if (typeof nodes[0] != 'undefined' && nodes.length > 1 && nodes[0].nodeType == 3)
- {
- // fix the adding the first li to the array
- elems.unshift(this.getBlock());
- }
+ },
+ execUnlink: function(cmd, param)
+ {
+ this.bufferSet();
- var data = '', replaced = '';
- $.each(elems, $.proxy(function(i,s)
- {
- if (s.tagName == 'LI')
- {
- var $s = $(s);
- var cloned = $s.clone();
- cloned.find('ul', 'ol').remove();
+ var link = this.currentOrParentIs('A');
+ if (link)
+ {
+ $(link).replaceWith($(link).text());
- if (this.opts.linebreaks === false) data += this.outerHtml($('
';
+ this.sync();
+ this.callback('execCommand', cmd, param);
+ return;
+ }
+ },
+ execLists: function(cmd, param)
+ {
+ this.bufferSet();
- if (i == 0)
- {
- $s.addClass('redactor-replaced').empty();
- replaced = this.outerHtml($s);
- }
- else $s.remove();
- }
+ var parent = this.getParent();
+ var $list = $(parent).closest('ol, ul');
+ var remove = false;
- }, this));
+ if ($list.length)
+ {
+ remove = true;
+ var listTag = $list[0].tagName;
+ if ((cmd === 'insertunorderedlist' && listTag === 'OL')
+ || (cmd === 'insertorderedlist' && listTag === 'UL'))
+ {
+ remove = false;
+ }
+ }
- html = this.$editor.html().replace(replaced, '' + listTag + '>' + data + '<' + listTag + '>');
+ this.selectionSave();
- this.$editor.html(html);
- this.$editor.find(listTag + ':empty').remove();
+ // remove lists
+ if (remove)
+ {
+ var nodes = this.getNodes();
+ var elems = this.getBlocks(nodes);
+ if (typeof nodes[0] != 'undefined' && nodes.length > 1 && nodes[0].nodeType == 3)
+ {
+ // fix the adding the first li to the array
+ elems.unshift(this.getBlock());
}
- // insert lists
- else
+ var data = '', replaced = '';
+ $.each(elems, $.proxy(function(i,s)
{
- this.document.execCommand(cmd);
-
- var parent = this.getParent();
- var $list = $(parent).closest('ol, ul');
-
- if ($list.length)
+ if (s.tagName == 'LI')
{
- if ((this.browser('msie') || this.browser('mozilla')) && parent.tagName !== 'LI')
- {
- $(parent).replaceWith($(parent).html());
- }
+ var $s = $(s);
+ var cloned = $s.clone();
+ cloned.find('ul', 'ol').remove();
- var $listParent = $list.parent();
- if (this.isParentRedactor($listParent) && this.nodeTestBlocks($listParent[0]))
+ if (this.opts.linebreaks === false) data += this.outerHtml($('
';
+
+ if (i == 0)
{
- $listParent.replaceWith($listParent.contents());
+ $s.addClass('redactor-replaced').empty();
+ replaced = this.outerHtml($s);
}
+ else $s.remove();
}
- if (this.browser('mozilla')) this.$editor.focus();
+ }, this));
- }
+ html = this.$editor.html().replace(replaced, '' + listTag + '>' + data + '<' + listTag + '>');
- this.selectionRestore();
+ this.$editor.html(html);
+ this.$editor.find(listTag + ':empty').remove();
- this.sync();
- this.callback('execCommand', cmd, param);
- return;
}
- if (cmd === 'unlink')
+ // insert lists
+ else
{
- this.bufferSet();
+ var firstParent = this.getParent();
+
+ this.document.execCommand(cmd);
+
+ var parent = this.getParent();
+ var $list = $(parent).closest('ol, ul');
- var link = this.currentOrParentIs('A');
- if (link)
+ if (firstParent && firstParent.tagName == 'TD')
{
- $(link).replaceWith($(link).text());
+ $list.wrapAll('');
+ }
- this.sync();
- this.callback('execCommand', cmd, param);
- return;
+
+
+ if ($list.length)
+ {
+ if ((this.browser('msie') || this.browser('mozilla')) && parent.tagName !== 'LI')
+ {
+ $(parent).replaceWith($(parent).html());
+ }
+
+ var $listParent = $list.parent();
+ if (this.isParentRedactor($listParent) && this.nodeTestBlocks($listParent[0]))
+ {
+ $listParent.replaceWith($listParent.contents());
+ }
}
- }
- this.exec(cmd, param, sync);
+ if (this.browser('mozilla')) this.$editor.focus();
- if (cmd === 'inserthorizontalrule')
- {
- this.$editor.find('hr').removeAttr('id');
}
+
+ this.selectionRestore();
+
+ this.sync();
+ this.callback('execCommand', cmd, param);
+ return;
},
// INDENTING
@@ -2512,7 +2621,6 @@
this.selectionSave();
-
if (block && block.tagName == 'LI')
{
// li
@@ -2637,6 +2745,8 @@
this.selectionRestore();
}
+ this.sync();
+
},
insideOutdent: function (li, index, elems)
{
@@ -2664,8 +2774,84 @@
}
},
- // CLEAN
- cleanEmpty: function(html)
+ // ALIGNMENT
+ alignmentLeft: function()
+ {
+ this.alignmentSet('', 'JustifyLeft');
+ },
+ alignmentRight: function()
+ {
+ this.alignmentSet('right', 'JustifyRight');
+ },
+ alignmentCenter: function()
+ {
+ this.alignmentSet('center', 'JustifyCenter');
+ },
+ alignmentJustify: function()
+ {
+ this.alignmentSet('justify', 'JustifyFull');
+ },
+ alignmentSet: function(type, cmd)
+ {
+ this.bufferSet();
+
+ if (this.oldIE())
+ {
+ this.document.execCommand(cmd, false, false);
+ return true;
+ }
+
+ this.selectionSave();
+
+ var block = this.getBlock();
+ if (!block && this.opts.linebreaks)
+ {
+ // one element
+ this.exec('formatBlock', 'blockquote');
+ var newblock = this.getBlock();
+ var block = $(' ([\w\W]*?)<\/blockquote>/gi), function(i,s)
- {
- var str = '';
- str = s.replace('
');
- html = html.replace(s, str);
- });
- }
-
html = R('([\w\W]*?)<\/strike>/gi, '$1');
-
- if (!/([\w\W]*?)<\/span>/gi.test(html))
+ if (set !== true)
+ {
+ html = html.replace(/([\w\W]*?)<\/strike>/gi, '$1');
+ }
+ else
{
- html = html.replace(/([\w\W]*?)<\/span>/gi, '$3');
+ html = html.replace(/([\w\W]*?)<\/del>/gi, '$1');
}
return html;
@@ -2975,21 +3149,16 @@
cleanUnverified: function()
{
// label, abbr, mark, meter, code, q, dfn, ins, time, kbd, var
-
var $elem = this.$editor.find('li, img, a, b, strong, sub, sup, i, em, u, small, strike, del, span, cite');
- $elem.not('[data-redactor="verified"]').filter('[style*="font-size"][style*="line-height"]')
- .css('font-size', '')
- .css('line-height', '');
-
- $elem.not('[data-redactor="verified"]').filter('[style*="background-color: transparent;"][style*="line-height"]')
+ $elem.filter('[style*="background-color: transparent;"][style*="line-height"]')
.css('background-color', '')
.css('line-height', '');
- $elem.not('[data-redactor="verified"]').filter('[style*="background-color: transparent;"]')
+ $elem.filter('[style*="background-color: transparent;"]')
.css('background-color', '');
- $elem.not('[data-redactor="verified"]').css('line-height', '');
+ $elem.css('line-height', '');
$.each($elem, $.proxy(function(i,s)
{
@@ -3181,97 +3350,33 @@
return out;
},
- // ALIGNMENT
- alignmentLeft: function()
- {
- this.alignmentSet('', 'JustifyLeft');
- },
- alignmentRight: function()
- {
- this.alignmentSet('right', 'JustifyRight');
- },
- alignmentCenter: function()
- {
- this.alignmentSet('center', 'JustifyCenter');
- },
- alignmentJustify: function()
- {
- this.alignmentSet('justify', 'JustifyFull');
- },
- alignmentSet: function(type, cmd)
+ // FORMAT
+ formatEmpty: function(e)
{
- this.bufferSet();
-
- if (this.oldIE())
- {
- this.document.execCommand(cmd, false, false);
- return true;
- }
-
- this.selectionSave();
+ var html = $.trim(this.$editor.html());
- var block = this.getBlock();
- if (!block && this.opts.linebreaks)
+ if (this.opts.linebreaks)
{
- // one element
- this.exec('formatBlock', 'blockquote');
- var newblock = this.getBlock();
- var block = $('
/i, '');
+ var thtml = html.replace(/
/i, '');
- var thtml = html.replace(/' + data + '
');
+ $(blocks).remove();
+ }
+ else if (replace == 'blockquote')
+ {
+ $(blockquote).replaceWith(data);
+ }
+ else if (replace == 'html')
+ {
+ var html = this.$editor.html().replace(replaced, '' + data + '');
+
+ this.$editor.html(html);
+ this.$editor.find('blockquote').each(function()
+ {
+ if ($.trim($(this).html()) == '') $(this).remove();
+ })
+ }
+ }
}
this.selectionRestore();
@@ -3379,9 +3587,34 @@
{
this.selectionSave();
- $(block).replaceWith($(block).html() + '
' + this.opts.invisibleSpace + '' + selection + '
');
+ var html = $.trim($(block).html());
+ var selection = $.trim(this.getSelectionHtml());
+
+ html = html.replace(//gi, '');
+
+ if (html == selection)
+ {
+ $(block).replaceWith($(block).html() + '
');
+ }
+ else
+ {
+ // replace
+ this.inlineFormat('tmp');
+ var tmp = this.$editor.find('tmp');
+ tmp.empty();
+
+ var newhtml = this.$editor.html().replace('');
+
+ this.$editor.html(newhtml);
+ tmp.remove();
+ this.$editor.find('blockquote').each(function()
+ {
+ if ($.trim($(this).html()) == '') $(this).remove();
+ })
+ }
this.selectionRestore();
+ this.$editor.find('span#selection-marker-1').attr('id', false);
}
else
{
@@ -3416,8 +3649,7 @@
this.sync();
},
-
- // BLOCK CLASS AND STYLE
+ // BLOCK
blockRemoveAttr: function(attr, value)
{
var nodes = this.getBlocks();
@@ -3463,7 +3695,7 @@
this.sync();
},
- // INLINE CLASS AND STYLE
+ // INLINE
inlineRemoveClass: function(className)
{
this.selectionSave();
@@ -3554,14 +3786,14 @@
{
var parent = $(s).parent(), el;
- if (parent && parent[0].tagName === 'SPAN' && parent[0].attributes.length != 0)
+ if (parent && parent[0].tagName === 'INLINE' && parent[0].attributes.length != 0)
{
el = parent;
$(s).replaceWith($(s).html());
}
else
{
- el = $('').append($(s).contents());
+ el = $('
');
html = this.cleanParagraphy(html);
@@ -3889,9 +4134,15 @@
return true;
}
+
// ms word list
- html = html.replace(/
');
+ html = html.replace(/
');
+ // one line
+ html = html.replace(/');
+ // remove ms word's bullet
+ html = html.replace(/·/g, '');
// remove comments and php tags
html = html.replace(/|<\?(?:php)?[\s\S]*?\?>/gi, '');
@@ -3911,6 +4162,7 @@
html = html.replace(/
<\/td>/gi, '[td]');
html = html.replace(/ <\/td>/gi, '[td]');
html = html.replace(/
<\/td>/gi, '[td]');
+ html = html.replace(/([\w\W]*?)<\/td>/gi, '[td colspan="$2"]$4[/td]');
html = html.replace(/([\w\W]*?)<\/a>/gi, '[a href="$2"]$4[/a]');
html = html.replace(/