From e09437f4fac47305679374d2b2516a76f6ceb899 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Wed, 9 Sep 2020 11:42:34 +0200 Subject: [PATCH] escape HTML entities in code parsed from markdown, fixes #2744 --- plugin/markdown/markdown.esm.js | 2 +- plugin/markdown/markdown.js | 2 +- plugin/markdown/plugin.js | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/plugin/markdown/markdown.esm.js b/plugin/markdown/markdown.esm.js index a29739f..dfe475e 100644 --- a/plugin/markdown/markdown.esm.js +++ b/plugin/markdown/markdown.esm.js @@ -1 +1 @@ -var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var n=function(e){return e&&e.Math==Math&&e},r=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||Function("return this")(),i=function(e){try{return!!e()}catch(e){return!0}},o=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),a={}.propertyIsEnumerable,s=Object.getOwnPropertyDescriptor,l={f:s&&!a.call({1:2},1)?function(e){var t=s(this,e);return!!t&&t.enumerable}:a},c=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},u={}.toString,f=function(e){return u.call(e).slice(8,-1)},h="".split,p=i((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==f(e)?h.call(e,""):Object(e)}:Object,g=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},d=function(e){return p(g(e))},v=function(e){return"object"==typeof e?null!==e:"function"==typeof e},y=function(e,t){if(!v(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!v(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!v(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!v(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},b={}.hasOwnProperty,m=function(e,t){return b.call(e,t)},k=r.document,x=v(k)&&v(k.createElement),w=function(e){return x?k.createElement(e):{}},S=!o&&!i((function(){return 7!=Object.defineProperty(w("div"),"a",{get:function(){return 7}}).a})),_=Object.getOwnPropertyDescriptor,E={f:o?_:function(e,t){if(e=d(e),t=y(t,!0),S)try{return _(e,t)}catch(e){}if(m(e,t))return c(!l.f.call(e,t),e[t])}},A=function(e){if(!v(e))throw TypeError(String(e)+" is not an object");return e},T=Object.defineProperty,O={f:o?T:function(e,t,n){if(A(e),t=y(t,!0),A(n),S)try{return T(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},R=o?function(e,t,n){return O.f(e,t,c(1,n))}:function(e,t,n){return e[t]=n,e},j=function(e,t){try{R(r,e,t)}catch(n){r[e]=t}return t},z=r["__core-js_shared__"]||j("__core-js_shared__",{}),$=Function.toString;"function"!=typeof z.inspectSource&&(z.inspectSource=function(e){return $.call(e)});var P,I,C,L=z.inspectSource,M=r.WeakMap,N="function"==typeof M&&/native code/.test(L(M)),D=t((function(e){(e.exports=function(e,t){return z[e]||(z[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),q=0,U=Math.random(),Z=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++q+U).toString(36)},F=D("keys"),G=function(e){return F[e]||(F[e]=Z(e))},H={},W=r.WeakMap;if(N){var B=new W,V=B.get,K=B.has,X=B.set;P=function(e,t){return X.call(B,e,t),t},I=function(e){return V.call(B,e)||{}},C=function(e){return K.call(B,e)}}else{var Y=G("state");H[Y]=!0,P=function(e,t){return R(e,Y,t),t},I=function(e){return m(e,Y)?e[Y]:{}},C=function(e){return m(e,Y)}}var J,Q,ee={set:P,get:I,has:C,enforce:function(e){return C(e)?I(e):P(e,{})},getterFor:function(e){return function(t){var n;if(!v(t)||(n=I(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},te=t((function(e){var t=ee.get,n=ee.enforce,i=String(String).split("String");(e.exports=function(e,t,o,a){var s=!!a&&!!a.unsafe,l=!!a&&!!a.enumerable,c=!!a&&!!a.noTargetGet;"function"==typeof o&&("string"!=typeof t||m(o,"name")||R(o,"name",t),n(o).source=i.join("string"==typeof t?t:"")),e!==r?(s?!c&&e[t]&&(l=!0):delete e[t],l?e[t]=o:R(e,t,o)):l?e[t]=o:j(t,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||L(this)}))})),ne=r,re=function(e){return"function"==typeof e?e:void 0},ie=function(e,t){return arguments.length<2?re(ne[e])||re(r[e]):ne[e]&&ne[e][t]||r[e]&&r[e][t]},oe=Math.ceil,ae=Math.floor,se=function(e){return isNaN(e=+e)?0:(e>0?ae:oe)(e)},le=Math.min,ce=function(e){return e>0?le(se(e),9007199254740991):0},ue=Math.max,fe=Math.min,he=function(e,t){var n=se(e);return n<0?ue(n+t,0):fe(n,t)},pe=function(e){return function(t,n,r){var i,o=d(t),a=ce(o.length),s=he(r,a);if(e&&n!=n){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},ge={includes:pe(!0),indexOf:pe(!1)},de=ge.indexOf,ve=function(e,t){var n,r=d(e),i=0,o=[];for(n in r)!m(H,n)&&m(r,n)&&o.push(n);for(;t.length>i;)m(r,n=t[i++])&&(~de(o,n)||o.push(n));return o},ye=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],be=ye.concat("length","prototype"),me={f:Object.getOwnPropertyNames||function(e){return ve(e,be)}},ke={f:Object.getOwnPropertySymbols},xe=ie("Reflect","ownKeys")||function(e){var t=me.f(A(e)),n=ke.f;return n?t.concat(n(e)):t},we=function(e,t){for(var n=xe(t),r=O.f,i=E.f,o=0;o=74)&&(J=Fe.match(/Chrome\/(\d+)/))&&(Q=J[1]);var Be=Q&&+Q,Ve=qe("species"),Ke=function(e){return Be>=51||!i((function(){var t=[];return(t.constructor={})[Ve]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Xe=qe("isConcatSpreadable"),Ye=Be>=51||!i((function(){var e=[];return e[Xe]=!1,e.concat()[0]!==e})),Je=Ke("concat"),Qe=function(e){if(!v(e))return!1;var t=e[Xe];return void 0!==t?!!t:$e(e)};ze({target:"Array",proto:!0,forced:!Ye||!Je},{concat:function(e){var t,n,r,i,o,a=Pe(this),s=Ze(a,0),l=0;for(t=-1,r=arguments.length;t9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n=9007199254740991)throw TypeError("Maximum allowed index exceeded");Ie(s,l++,o)}return s.length=l,s}});var et=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},tt=function(e,t,n){if(et(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},nt=[].push,rt=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,o=6==e,a=5==e||o;return function(s,l,c,u){for(var f,h,g=Pe(s),d=p(g),v=tt(l,c,3),y=ce(d.length),b=0,m=u||Ze,k=t?m(s,y):n?m(s,0):void 0;y>b;b++)if((a||b in d)&&(h=v(f=d[b],b,g),e))if(t)k[b]=h;else if(h)switch(e){case 3:return!0;case 5:return f;case 6:return b;case 2:nt.call(k,f)}else if(i)return!1;return o?-1:r||i?i:k}},it={forEach:rt(0),map:rt(1),filter:rt(2),some:rt(3),every:rt(4),find:rt(5),findIndex:rt(6)},ot=function(e,t){var n=[][e];return!!n&&i((function(){n.call(null,t||function(){throw 1},1)}))},at=Object.defineProperty,st={},lt=function(e){throw e},ct=function(e,t){if(m(st,e))return st[e];t||(t={});var n=[][e],r=!!m(t,"ACCESSORS")&&t.ACCESSORS,a=m(t,0)?t[0]:lt,s=m(t,1)?t[1]:void 0;return st[e]=!!n&&!i((function(){if(r&&!o)return!0;var e={length:-1};r?at(e,1,{enumerable:!0,get:lt}):e[1]=1,n.call(e,a,s)}))},ut=it.forEach,ft=ot("forEach"),ht=ct("forEach"),pt=ft&&ht?[].forEach:function(e){return ut(this,e,arguments.length>1?arguments[1]:void 0)};ze({target:"Array",proto:!0,forced:[].forEach!=pt},{forEach:pt});var gt,dt=Object.keys||function(e){return ve(e,ye)},vt=o?Object.defineProperties:function(e,t){A(e);for(var n,r=dt(t),i=r.length,o=0;i>o;)O.f(e,n=r[o++],t[n]);return e},yt=ie("document","documentElement"),bt=G("IE_PROTO"),mt=function(){},kt=function(e){return"