From db6f79b08d0ad8ae1241ab39b7c6ae8b0b8032d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Estev=C3=A3o=20Soares=20dos=20Santos?= Date: Wed, 27 May 2015 01:37:01 +0100 Subject: [PATCH] feat(Converter.options): add getOption(), setOption() and getOptions() to Converter object Provides a way to get and set options directly in a Converter object --- dist/showdown.js | Bin 46754 -> 47397 bytes dist/showdown.js.map | Bin 152248 -> 154419 bytes dist/showdown.min.js | Bin 14354 -> 14503 bytes dist/showdown.min.js.map | Bin 15494 -> 15677 bytes src/showdown.js | 31 ++++++++++++++++++++++++++++++- 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/dist/showdown.js b/dist/showdown.js index 773d2484b700d0b31da1b8a59f7bcc022f4d6460..774d2c8bb133cc233384f171486fc1ae67fe9c74 100644 GIT binary patch delta 562 zcmZ4VmTBoHCIM@GEk%XmjQsMH{PH{nBlC>{O)@6>T3TER3JO{Z!Koz*iFpe71tppJ zKq^h4BqOs}!8t##EVZa4wMZc|uec;JFF6&cdUBwwFk5zNC6qb&JR^HO&vV*J4X3^WIbsl^J_)wQ)CuYm$V8xaa{ zmlSJYcgN&T8I1rPaG=0L%t`^ygvh{6u~L9D(PWB|q>49hlqpda1RDwp?Yz{A66cJ> yqREo+3X@Bm6ei!F%(XeiiJOrlFSR@;GcUDxvT=OKU2GI(6ozxQGw#l`+XXtUR7pD*1>0qCcacP)*mk<|rwO!CLJTFafx)iAY~2|x zf6_I^tdYOEZ^(fJ%0kjW1nnkGESQiqUbnQ%1xhfXHwq?T3Kw3g->&I~4S~e(X3jTn z&ig*+d{>8+(I1qY)`qE<6;2sc%QHQsBHLbr+>uJ0_)x{bA1Z$N%}*=waa|q4ud3(@ zX_&mHK=(;FwcU@sf2pPa#yW-d#Z-lhp$1e=s64ZuWd8njVLENdFpg=^uPYdT&5H}? zG!7r2K(RObqYqQJeK@5B(AE$r=i%_%qQ7soirH&w8C2-GP~(z{T<3qF=R!*aPXp$) z_}IUme7rnJnowmNx-WQ^N^}6aK$c7eU zetIENahX+i7;BjZFyuBzgCB8r`PZjq?*B+*CDWSE!lq!~%Yn&@#CI+o!}*`ZbLFBac2hK13LN zsG#eC{NF?mw7$lSA1m~Z(#fSJJtOeAwPwxn)$o)Dkiy4xFf^k~BV)JnQmQjgn?8?$#>9BJ~@SA1mcFBZHt zO)5vvQjP3b?xsE-N>hD>t|vI37I^7)Pc`2?LrTj!Vej@@|Hr?($y38aUz4}!Z+uYj zFTgd6@D}}GPqN3>#YtN3C&@W*XR8pmwesif9<3N0EDv^`H(4RjbMP~M^DNajmExS{ zXNK{jVOsINF-KC|K!I?TUMfps$#0cjDxVgeCsb#wYnbvuZO*Xlbn_u0WXumJsXn^cNCTh0WFuXGXWEmaC{4s&^!c_5MTt8JD1-AdPA3iUjZtU zFR=xa-Ix!9T9~(5m;qxFm)@)aA_rV@Ty7vBeU~A)0T{PwGy)2@lGp(m0hed`0WFs#+5r&+CtO@^w>;Vb_kfy>T!R1r diff --git a/dist/showdown.min.js b/dist/showdown.min.js index 76c620d1197cd545ddf324462afc4994ece5576d..512c53766b9ff5f3d48e8bf7f37d3d261f264935 100644 GIT binary patch delta 513 zcmYLFPixdb93{o=vMsuZ)QZqG4OkL)NX3J~W@is7=tU}c3^`0@C&^5bnK3hQE$LEv z@C!H}Ko5c^53&aj{R%z$DeBF$2NV3Wm&g0P$M4^JFF(H?9^TuxRVEg5vEcTDM_-4( zuH49hsI{#13o)k&C6$^KX4E^gnEBYd-Qsy~?;!)R7bK!`-=NCI@P2@&rC$)9>MR(K zvDb8Z0?QCb0fHnu5Erg?OK;f&9SC}+ql(ZuVEpIV7!(y7kN!ZbX{?~^VSY^ z*Txb-baK)xgKisx%@X7=j6l&r2}38PI;-O+Von|x0_VyBPG&AQUs>GD`n#vxJ2-Gz z$Rn7x-~}{s9T78vwF99(mP8~r^8S4(Y|7gb`59723;wbal2rQG6@R9P2%=E5Q@UFu z)EQO5-v^{$qMSU}WdUQreDYQkuBb5I`#Tm}UG^_5OPX(kiItn5gTw8@m$m8wXmbZ! zx9$Q(^pWh+nqZLr=h>R830*zi`mk-DjfUpO&by7+H=~VRBSwSkDRic?BC{!OW0*PP N)Lgv-R$p$C{onMUu?YYG delta 378 zcmZ9H&q~8U7{m!0s}(FLSSTooV#sPp)kDF=Jqlh#PhMgU+jNuN{5RQHCC$MH=*4{i zJqY4W>Csp4kwk11J$M<0kKcU5JYC+Ut?srgw+E-34}2Yt)6O$4#! z*(%Z;zBKnJ*U<_=G#ZtaSz`_?D~&+Q)@Ut0?=<|aK%%ka0Z%6=KOM$rS(4(6-KYUj z6xFc;8+um2pBu6l)+7SxKN!r1^AdnA?$08j;|Sx zbDG4tq6~C`!)c>F-FSo?qB@hk`FBBx_~(Kl5Ps0?Zc;rha-t$&{J9ELKr4U08vV&j W^L~+^ua3FcUY^;wh$o%)SpEX?GJq2R diff --git a/dist/showdown.min.js.map b/dist/showdown.min.js.map index e37603335b90104171687bf52f3f79f80685551b..0184f2b56431f38eb852d6184027ad80a0c93435 100644 GIT binary patch delta 945 zcmZuvK~ED=5Kb$kXsRKKa;O$)%7O335AVJ1F59}6ZEd@4;sFX2XjzKHwzM%^ zj2AumE*|vY$*akpO-wv^^A~t9F`m3=V&V~JrZuABvhU6NzWHY6n|*xnw)5uRz^Qd_ zO_c{c|Kq@mU~tw^^-wlAEd0Bd0A8${^%y z3nJ_Il3zj^yx4%Yh}7d|`Yem3xm+fA7hx@ZcNGwYSsq%WyK5c0OIGB(#6iVzJzosJKND(+HBf4*aKwzsa@D|c zMQ8_P+!~Ez1HDoJQkfg77I}HglRC1T8-mRWs5VC-(#$O7mso}KD)bDjQXhm+Z_2iz zy738RURH-74whJT!6dh`Aiu=>Pn4%O$YqDEa9#mvnGm~46tw<@aUg`R{ee5wLJs@` z5AxVaWe?q#ny3?$Mx%=7Y7|&N$j^w5s$O|Mv14FM6%P@)wo8N()uhTLO^ruKN4F?Q zZPT%iX37OoO{zQ5O94&2ieFI6;X(gl^iv?vQswdMH}4y0dl9wMv_?s*+QVuxOWVee zLxY*e*yg_aFn;@dv+qQjbDJ^`)a1lbps6NfouNhQ+1AwS*x2dmBo?t7ruuPpWMseh zZ(>Rg{M{0rWJCRmb**W#zNpch?lf(vv`ITJ|K0ft?%cItPS8Ag+3IQJNnl->@v(~= z|1UdXv<<%-|2#ZZr#|dz??~t%t1pwe7A9pD2}o&DJxY9?@_Muy9XSozvTzdHe>VSf F@HdQ<4W|GA delta 777 zcmZuvO>YuW6b%#tF^aWnVp38TA!{do}lq z@2%IH%3~)`^mfYbr@*4$-`P3Vv$%8VSMXu>faPJBb?uPtUFc^tzR8&bPy%K_VK3o+ zo&S6x(B?H_wea<#c>}CQh8Y0m7H0xVw>cq2XmFehzri1|%OQ|xg|#^tEiuCQ>N1{% z@p+Ro6Tng`t4N|O%t}gN^mJALD6m6-D$N#2-qmF%>tDDmdlMZ03!f-APM@<9*=ALe z_YE2)(!8ahoZP1zYN`*52;}($mzG`~wKLLEwIdNx>ncJ;%~X>snjo9tP{lkJGdVfR zHxx`6N^V^yB{aS+WV1RQChbVNJg^*Cdm6sHc@=jr`rXaQ#N&B{SE3u+4>F7vDN99; zSVm8%(EHMmC^DPW@+hd?&2wyXfX||L7e=$NasakcKE_G(w`YWt<#8~j*0MFczY>XW z>2iqOGo@EYEtF5`tjU4m9|&1h0Xby3$;WyR->p0eZmFMD)-WEsc59tWmQ8CO?i1_4 zN~@lQ1ZQ_Ri2YL)jl|935yrw#Han)odob)D6Z^J~Lt p>+bYQ8r0s{J(u*xH0gwn+o|tsqbY5mE+;M7V*h_^*V2Ca{{Rbl;3NP5 diff --git a/src/showdown.js b/src/showdown.js index e427fd3..5b23692 100644 --- a/src/showdown.js +++ b/src/showdown.js @@ -280,7 +280,36 @@ showdown.Converter = function (converterOptions) { return text; } + /** + * Set an option of this Converter instance + * @param {string} key + * @param {string} value + */ + function setOption (key, value) { + options[key] = value; + } + + /** + * Get the option of this Converter instance + * @param {string} key + * @returns {*} + */ + function getOption(key) { + return options[key]; + } + + /** + * Get the options of this Converter instance + * @returns {{}} + */ + function getOptions() { + return options; + } + return { - makeHtml: makeHtml + makeHtml: makeHtml, + setOption: setOption, + getOption: getOption, + getOptions: getOptions }; };