From 32800a14a869cadb9ecbedded81947eb1fb1f2d4 Mon Sep 17 00:00:00 2001 From: Estevao Soares dos Santos Date: Tue, 24 Oct 2017 09:27:08 +0100 Subject: [PATCH] refactor: escaped characters within tag attributes --- dist/showdown.js | Bin 93665 -> 93550 bytes dist/showdown.js.map | Bin 270908 -> 270629 bytes dist/showdown.min.js | Bin 39643 -> 39638 bytes dist/showdown.min.js.map | Bin 41170 -> 41171 bytes .../escapeSpecialCharsWithinTagAttributes.js | 9 ++++----- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/dist/showdown.js b/dist/showdown.js index 9e12614737d1f296525b6fc02697f7d3de0a2e9d..bd88b9cae5fe213017728f92b097d1e1de93a3e9 100644 GIT binary patch delta 126 zcmaEOoAuo-)(u{#d`lA3ixoh?Rzcq;M&CXH?KdW;t!o0y1$j<9D&i`e(E!cb;zMfT;ut KZq`4uX(0eZZYw$f delta 210 zcmaENi}m4c)(u{#9EwuYQ!5l~74$W1q7!wiV)PYNVl|YaLP@^D^oK%>VkrvcsS3pfIhiF2B^jv-`8g>H5OXv0 zfJ#cr^K}&R^HLSk@{1Ho64Q$n67y2v0?GNgxv6<2#XwU*0Ibg$Dh6_wjiQFGu7{-FmlmD+1oBZL_IyQ*n&GS#6UkCt4Ur62n diff --git a/dist/showdown.js.map b/dist/showdown.js.map index 9dc87dd922e533172d7690e36ee64b7cdda19a7b..208e2387690cc11a54c82403175e8a995921d2b4 100644 GIT binary patch delta 349 zcmdmUL}2M5frc%NyGtf3RI*O~v4($gy$S#1fJdy;1ss{UCih<8ny#b9#5LVPf{|l+;Mpj0b>47ttM5Y&%F^WxJSI+p4v1}1Kd)fi z{=9;T<9~2TVtTOx2-qs<+r-4^+eatrR>j1m#9QgcYHQeAMaRSx$7+Mfn3&*LZF^07 zJN@)botQkZCWYku+}zZ>l47uSMGakDpqA+yDwrKvKn71Y%wiUs&Qr;}odc#2E~Gm> Uy^`5~`h{#}+3odJ%zKvu0OLz@!2kdN delta 456 zcmZ2_NMO$qfrc%NyGthbM2k#T2on*@bar&ibk=cobad4LGM%k~xXNYvhBPLr$q5o% z)8#W6xh99ZicB_O<(jOJ&owzgoNKZ}Kaeg3^6mMjH+V8}O;32rC^EevolyiR&Bq2Z zqsV>whuw@)VirI{Ezry_bDb`Dl+k$d{wDs(4m0?tFDPXcXDpchpo~#_`r}f@Ep7@ekbo%)UX5H!P70g|HD7qlB+kvuSD*)&%l~Moz diff --git a/dist/showdown.min.js b/dist/showdown.min.js index 93d433fdac4da3a71611194101e6274e021990f9..8cb3d2aa87414d3453521b41ca60abb7a5f5e082 100644 GIT binary patch delta 64 zcmcb;mFe16rVXK?hBh(!_R)#DRWT{?R=Tm;8unJvF~zakKq4kMR@+|F-cCO~Qzy|@ R-$qeGR~IO~xjQt#6#&ey6k7lQ delta 69 zcmcb%mFf0YrVXK?W*RopiMmxW`id&C8cNY|O0il>HR{oE>akktH9$(qE>=^^PE$WU XQzy|@-$qeGS69Q{s%CRrXn-pK03;NR diff --git a/dist/showdown.min.js.map b/dist/showdown.min.js.map index ac3e2899f9abe77c24e930d44f60729b3f1b9c99..8c8dc4d2e8ccab94626a78fd4157e0f9cfeeade2 100644 GIT binary patch delta 5959 zcmbUlYiwK9Sq|Fd0xeW&Y17iuCM|`=#diEIFm~?s_07%At>ZY3>kJ8;m*Z#riXWkE zs;;Go77h4#v{0Zhr2UyDP$rGBRa*aTnzR9v_=PI%&!kO4n>1;Ewuyb;ckGaK6|nue z_BrQ!zt8#Pde0xO_q_M`9rk)UQ|ov1&#X@05g9ws4m&gmpdj@L(b*G3Dp4P0!t{wdETJ~knnc-nYzYx{7(%b!`k1ltcn#Z; z5F+IXA0!?z!;!*OA?z@PFxxtcEz z5w<}eoux5~ypt$M1CR-$brr=L75EWGg^tmngpuSO&nRk)k|Y0_rnFJXlC0CXMGEJ% zC8o*<)(GJy7-kIRO9^#BZFbI4`shX)rqKKfY2^+xZ;@;Eq707DX>B>@)6>sm-PNrssKl;^f@LkL{N@gS$R!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regexComments = /-]|-[^>])(?:[^-]|-[^-])*)--)>/gi; + var tags = /<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi, + comments = /-]|-[^>])(?:[^-]|-[^-])*)--)>/gi; - text = text.replace(regex, function (wholeMatch) { + text = text.replace(tags, function (wholeMatch) { return wholeMatch .replace(/(.)<\/?code>(?=.)/g, '$1`') .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback); }); - text = text.replace(regexComments, function (wholeMatch) { + text = text.replace(comments, function (wholeMatch) { return wholeMatch .replace(/([\\`*_~=|])/g, showdown.helper.escapeCharactersCallback); });