From c2fd760f8f14482510b3a3125dbb5f669579d477 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Fri, 21 May 2021 09:13:40 +0200 Subject: [PATCH] replace deprecated hljs.highlightBlock calls, fix #2958 --- css/theme/template/theme.scss | 8 ++++++++ dist/theme/beige.css | 8 ++++++++ dist/theme/black.css | 8 ++++++++ dist/theme/blood.css | 8 ++++++++ dist/theme/league.css | 8 ++++++++ dist/theme/moon.css | 8 ++++++++ dist/theme/night.css | 8 ++++++++ dist/theme/serif.css | 8 ++++++++ dist/theme/simple.css | 8 ++++++++ dist/theme/sky.css | 8 ++++++++ dist/theme/solarized.css | 8 ++++++++ dist/theme/white.css | 8 ++++++++ plugin/highlight/highlight.esm.js | 4 ++-- plugin/highlight/highlight.js | 4 ++-- plugin/highlight/plugin.js | 10 ++++++---- 15 files changed, 106 insertions(+), 8 deletions(-) diff --git a/css/theme/template/theme.scss b/css/theme/template/theme.scss index 98d9f11..a77041e 100644 --- a/css/theme/template/theme.scss +++ b/css/theme/template/theme.scss @@ -196,6 +196,14 @@ word-wrap: normal; } +.reveal .code-wrapper { + white-space: normal; +} + +.reveal .code-wrapper code { + white-space: pre; +} + .reveal table { margin: auto; border-collapse: collapse; diff --git a/dist/theme/beige.css b/dist/theme/beige.css index 2a19b24..818ac02 100644 --- a/dist/theme/beige.css +++ b/dist/theme/beige.css @@ -236,6 +236,14 @@ section.has-dark-background, section.has-dark-background h1, section.has-dark-ba word-wrap: normal; } +.reveal .code-wrapper { + white-space: normal; +} + +.reveal .code-wrapper code { + white-space: pre; +} + .reveal table { margin: auto; border-collapse: collapse; diff --git a/dist/theme/black.css b/dist/theme/black.css index 59f118a..798bc6f 100644 --- a/dist/theme/black.css +++ b/dist/theme/black.css @@ -229,6 +229,14 @@ section.has-light-background, section.has-light-background h1, section.has-light word-wrap: normal; } +.reveal .code-wrapper { + white-space: normal; +} + +.reveal .code-wrapper code { + white-space: pre; +} + .reveal table { margin: auto; border-collapse: collapse; diff --git a/dist/theme/blood.css b/dist/theme/blood.css index 5590074..c259cff 100644 --- a/dist/theme/blood.css +++ b/dist/theme/blood.css @@ -235,6 +235,14 @@ section.has-light-background, section.has-light-background h1, section.has-light word-wrap: normal; } +.reveal .code-wrapper { + white-space: normal; +} + +.reveal .code-wrapper code { + white-space: pre; +} + .reveal table { margin: auto; border-collapse: collapse; diff --git a/dist/theme/league.css b/dist/theme/league.css index 0eea22e..83ce5a5 100644 --- a/dist/theme/league.css +++ b/dist/theme/league.css @@ -238,6 +238,14 @@ section.has-light-background, section.has-light-background h1, section.has-light word-wrap: normal; } +.reveal .code-wrapper { + white-space: normal; +} + +.reveal .code-wrapper code { + white-space: pre; +} + .reveal table { margin: auto; border-collapse: collapse; diff --git a/dist/theme/moon.css b/dist/theme/moon.css index 03c3a3b..9c4fa17 100644 --- a/dist/theme/moon.css +++ b/dist/theme/moon.css @@ -237,6 +237,14 @@ section.has-light-background, section.has-light-background h1, section.has-light word-wrap: normal; } +.reveal .code-wrapper { + white-space: normal; +} + +.reveal .code-wrapper code { + white-space: pre; +} + .reveal table { margin: auto; border-collapse: collapse; diff --git a/dist/theme/night.css b/dist/theme/night.css index f30c5fc..3812d57 100644 --- a/dist/theme/night.css +++ b/dist/theme/night.css @@ -230,6 +230,14 @@ section.has-light-background, section.has-light-background h1, section.has-light word-wrap: normal; } +.reveal .code-wrapper { + white-space: normal; +} + +.reveal .code-wrapper code { + white-space: pre; +} + .reveal table { margin: auto; border-collapse: collapse; diff --git a/dist/theme/serif.css b/dist/theme/serif.css index 02a5557..80bcf86 100644 --- a/dist/theme/serif.css +++ b/dist/theme/serif.css @@ -233,6 +233,14 @@ section.has-dark-background, section.has-dark-background h1, section.has-dark-ba word-wrap: normal; } +.reveal .code-wrapper { + white-space: normal; +} + +.reveal .code-wrapper code { + white-space: pre; +} + .reveal table { margin: auto; border-collapse: collapse; diff --git a/dist/theme/simple.css b/dist/theme/simple.css index 2813d8f..c5f8003 100644 --- a/dist/theme/simple.css +++ b/dist/theme/simple.css @@ -232,6 +232,14 @@ section.has-dark-background, section.has-dark-background h1, section.has-dark-ba word-wrap: normal; } +.reveal .code-wrapper { + white-space: normal; +} + +.reveal .code-wrapper code { + white-space: pre; +} + .reveal table { margin: auto; border-collapse: collapse; diff --git a/dist/theme/sky.css b/dist/theme/sky.css index c3c09e4..8376bb0 100644 --- a/dist/theme/sky.css +++ b/dist/theme/sky.css @@ -240,6 +240,14 @@ section.has-dark-background, section.has-dark-background h1, section.has-dark-ba word-wrap: normal; } +.reveal .code-wrapper { + white-space: normal; +} + +.reveal .code-wrapper code { + white-space: pre; +} + .reveal table { margin: auto; border-collapse: collapse; diff --git a/dist/theme/solarized.css b/dist/theme/solarized.css index 0106b82..74bee8f 100644 --- a/dist/theme/solarized.css +++ b/dist/theme/solarized.css @@ -233,6 +233,14 @@ html * { word-wrap: normal; } +.reveal .code-wrapper { + white-space: normal; +} + +.reveal .code-wrapper code { + white-space: pre; +} + .reveal table { margin: auto; border-collapse: collapse; diff --git a/dist/theme/white.css b/dist/theme/white.css index 823e45e..cd1ca22 100644 --- a/dist/theme/white.css +++ b/dist/theme/white.css @@ -229,6 +229,14 @@ section.has-dark-background, section.has-dark-background h1, section.has-dark-ba word-wrap: normal; } +.reveal .code-wrapper { + white-space: normal; +} + +.reveal .code-wrapper code { + white-space: pre; +} + .reveal table { margin: auto; border-collapse: collapse; diff --git a/plugin/highlight/highlight.esm.js b/plugin/highlight/highlight.esm.js index 14e2516..61bddeb 100644 --- a/plugin/highlight/highlight.esm.js +++ b/plugin/highlight/highlight.esm.js @@ -1,5 +1,5 @@ -function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=new Array(t);n0?dt:_t)(e)},mt=ut,pt=Math.min,gt=function(e){return e>0?pt(mt(e),9007199254740991):0},Et=ut,St=Math.max,bt=Math.min,Tt=function(e,t){var n=Et(e);return n<0?St(n+t,0):bt(n,t)},ft=M,Ct=gt,Nt=Tt,Rt=function(e){return function(t,n,a){var r,i=ft(t),o=Ct(i.length),s=Nt(a,o);if(e&&n!=n){for(;o>s;)if((r=i[s++])!=r)return!0}else for(;o>s;s++)if((e||s in i)&&i[s]===n)return e||s||0;return!e&&-1}},vt={includes:Rt(!0),indexOf:Rt(!1)},Ot=B,ht=M,yt=vt.indexOf,It=Pe,At=function(e,t){var n,a=ht(e),r=0,i=[];for(n in a)!Ot(It,n)&&Ot(a,n)&&i.push(n);for(;t.length>r;)Ot(a,n=t[r++])&&(~yt(i,n)||i.push(n));return i},Dt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Mt=At,Lt=Dt.concat("length","prototype");ct.f=Object.getOwnPropertyNames||function(e){return Mt(e,Lt)};var wt={};wt.f=Object.getOwnPropertySymbols;var xt=ct,Pt=wt,kt=ne,Ut=lt("Reflect","ownKeys")||function(e){var t=xt.f(kt(e)),n=Pt.f;return n?t.concat(n(e)):t},Ft=B,Bt=Ut,Gt=g,Yt=ee,Ht=function(e,t){for(var n=Bt(t),a=Yt.f,r=Gt.f,i=0;i0&&(!i.multiline||i.multiline&&"\n"!==e[i.lastIndex-1])&&(l="(?: "+l+")",_=" "+_,c++),n=new RegExp("^(?:"+l+")",s)),In&&(n=new RegExp("^"+l+"$(?!\\s)",s)),hn&&(t=i.lastIndex),a=Rn.call(o?n:i,_),o?a?(a.input=a.input.slice(c),a[0]=a[0].slice(c),a.index=i.lastIndex,i.lastIndex+=a[0].length):i.lastIndex=0:hn&&a&&(i.lastIndex=i.global?a.index+a[0].length:t),In&&a&&a.length>1&&vn.call(a[0],n,(function(){for(r=1;r=74)&&(Dn=Ln.match(/Chrome\/(\d+)/))&&(Mn=Dn[1]);var kn=Mn&&+Mn,Un=kn,Fn=E,Bn=!!Object.getOwnPropertySymbols&&!Fn((function(){return!String(Symbol())||!Symbol.sham&&Un&&Un<41})),Gn=Bn&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Yn=p,Hn=Re.exports,Vn=B,qn=De,zn=Bn,Wn=Gn,$n=Hn("wks"),Qn=Yn.Symbol,Kn=Wn?Qn:Qn&&Qn.withoutSetter||qn,jn=function(e){return Vn($n,e)&&(zn||"string"==typeof $n[e])||(zn&&Vn(Qn,e)?$n[e]=Qn[e]:$n[e]=Kn("Symbol."+e)),$n[e]},Xn=de.exports,Zn=An,Jn=E,ea=jn,ta=_e,na=ea("species"),aa=RegExp.prototype,ra=!Jn((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")})),ia="$0"==="a".replace(/./,"$0"),oa=ea("replace"),sa=!!/./[oa]&&""===/./[oa]("a","$0"),la=!Jn((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),ca=function(e,t,n,a){var r=ea(e),i=!Jn((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),o=i&&!Jn((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[na]=function(){return n},n.flags="",n[r]=/./[r]),n.exec=function(){return t=!0,null},n[r](""),!t}));if(!i||!o||"replace"===e&&(!ra||!ia||sa)||"split"===e&&!la){var s=/./[r],l=n(r,""[e],(function(e,t,n,a,r){var o=t.exec;return o===Zn||o===aa.exec?i&&!r?{done:!0,value:s.call(t,n,a)}:{done:!0,value:e.call(n,t,a)}:{done:!1}}),{REPLACE_KEEPS_$0:ia,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:sa}),c=l[0],_=l[1];Xn(String.prototype,e,c),Xn(aa,r,2==t?function(e,t){return _.call(e,this,t)}:function(e){return _.call(e,this)})}a&&ta(aa[r],"sham",!0)},_a=L,da=v,ua=jn("match"),ma=function(e){var t;return _a(e)&&(void 0!==(t=e[ua])?!!t:"RegExp"==da(e))},pa=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},ga=ne,Ea=pa,Sa=jn("species"),ba=ut,Ta=I,fa=function(e){return function(t,n){var a,r,i=String(Ta(t)),o=ba(n),s=i.length;return o<0||o>=s?e?"":void 0:(a=i.charCodeAt(o))<55296||a>56319||o+1===s||(r=i.charCodeAt(o+1))<56320||r>57343?e?i.charAt(o):a:e?i.slice(o,o+2):r-56320+(a-55296<<10)+65536}},Ca={codeAt:fa(!1),charAt:fa(!0)},Na=Ca.charAt,Ra=function(e,t,n){return t+(n?Na(e,t).length:1)},va=v,Oa=An,ha=function(e,t){var n=e.exec;if("function"==typeof n){var a=n.call(e,t);if("object"!=typeof a)throw TypeError("RegExp exec method returned something other than an Object or null");return a}if("RegExp"!==va(e))throw TypeError("RegExp#exec called on incompatible receiver");return Oa.call(e,t)},ya=ca,Ia=ma,Aa=ne,Da=I,Ma=function(e,t){var n,a=ga(e).constructor;return void 0===a||null==(n=ga(a)[Sa])?t:Ea(n)},La=Ra,wa=gt,xa=ha,Pa=An,ka=Sn.UNSUPPORTED_Y,Ua=[].push,Fa=Math.min;ya("split",2,(function(e,t,n){var a;return a="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var a=String(Da(this)),r=void 0===n?4294967295:n>>>0;if(0===r)return[];if(void 0===e)return[a];if(!Ia(e))return t.call(a,e,r);for(var i,o,s,l=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),_=0,d=new RegExp(e.source,c+"g");(i=Pa.call(d,a))&&!((o=d.lastIndex)>_&&(l.push(a.slice(_,i.index)),i.length>1&&i.index=r));)d.lastIndex===i.index&&d.lastIndex++;return _===a.length?!s&&d.test("")||l.push(""):l.push(a.slice(_)),l.length>r?l.slice(0,r):l}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var r=Da(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,r,n):a.call(String(r),t,n)},function(e,r){var i=n(a,e,this,r,a!==t);if(i.done)return i.value;var o=Aa(e),s=String(this),l=Ma(o,RegExp),c=o.unicode,_=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(ka?"g":"y"),d=new l(ka?"^(?:"+o.source+")":o,_),u=void 0===r?4294967295:r>>>0;if(0===u)return[];if(0===s.length)return null===xa(d,s)?[s]:[];for(var m=0,p=0,g=[];p]*>)/g,Qa=/\$([$&'`]|\d{1,2})/g,Ka=ca,ja=ne,Xa=gt,Za=ut,Ja=I,er=Ra,tr=function(e,t,n,a,r,i){var o=n+e.length,s=a.length,l=Qa;return void 0!==r&&(r=qa(r),l=$a),Wa.call(i,l,(function(i,l){var c;switch(l.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(o);case"<":c=r[l.slice(1,-1)];break;default:var _=+l;if(0===_)return i;if(_>s){var d=za(_/10);return 0===d?i:d<=s?void 0===a[d-1]?l.charAt(1):a[d-1]+l.charAt(1):i}c=a[_-1]}return void 0===c?"":c}))},nr=ha,ar=Math.max,rr=Math.min;Ka("replace",2,(function(e,t,n,a){var r=a.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,i=a.REPLACE_KEEPS_$0,o=r?"$":"$0";return[function(n,a){var r=Ja(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,r,a):t.call(String(r),n,a)},function(e,a){if(!r&&i||"string"==typeof a&&-1===a.indexOf(o)){var s=n(t,e,this,a);if(s.done)return s.value}var l=ja(e),c=String(this),_="function"==typeof a;_||(a=String(a));var d=l.global;if(d){var u=l.unicode;l.lastIndex=0}for(var m=[];;){var p=nr(l,c);if(null===p)break;if(m.push(p),!d)break;""===String(p[0])&&(l.lastIndex=er(c,Xa(l.lastIndex),u))}for(var g,E="",S=0,b=0;b=S&&(E+=c.slice(S,f)+O,S=f+T.length)}return E+c.slice(S)}]}));var ir={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},or=pa,sr=function(e,t,n){if(or(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,a){return e.call(t,n,a)};case 3:return function(n,a,r){return e.call(t,n,a,r)}}return function(){return e.apply(t,arguments)}},lr=v,cr=Array.isArray||function(e){return"Array"==lr(e)},_r=L,dr=cr,ur=jn("species"),mr=function(e,t){var n;return dr(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!dr(n.prototype)?_r(n)&&null===(n=n[ur])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},pr=sr,gr=y,Er=k,Sr=gt,br=mr,Tr=[].push,fr=function(e){var t=1==e,n=2==e,a=3==e,r=4==e,i=6==e,o=7==e,s=5==e||i;return function(l,c,_,d){for(var u,m,p=Er(l),g=gr(p),E=pr(c,_,3),S=Sr(g.length),b=0,T=d||br,f=t?T(l,S):n||o?T(l,0):void 0;S>b;b++)if((s||b in g)&&(m=E(u=g[b],b,p),e))if(t)f[b]=m;else if(m)switch(e){case 3:return!0;case 5:return u;case 6:return b;case 2:Tr.call(f,u)}else switch(e){case 4:return!1;case 7:Tr.call(f,u)}return i?-1:a||r?r:f}},Cr={forEach:fr(0),map:fr(1),filter:fr(2),some:fr(3),every:fr(4),find:fr(5),findIndex:fr(6),filterOut:fr(7)},Nr=E,Rr=function(e,t){var n=[][e];return!!n&&Nr((function(){n.call(null,t||function(){throw 1},1)}))},vr=Cr.forEach,Or=p,hr=ir,yr=Rr("forEach")?[].forEach:function(e){return vr(this,e,arguments.length>1?arguments[1]:void 0)},Ir=_e;for(var Ar in hr){var Dr=Or[Ar],Mr=Dr&&Dr.prototype;if(Mr&&Mr.forEach!==yr)try{Ir(Mr,"forEach",yr)}catch(gm){Mr.forEach=yr}}var Lr=x,wr=ee,xr=N,Pr=function(e,t,n){var a=Lr(t);a in e?wr.f(e,a,xr(0,n)):e[a]=n},kr=E,Ur=kn,Fr=jn("species"),Br=function(e){return Ur>=51||!kr((function(){var t=[];return(t.constructor={})[Fr]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Gr=rn,Yr=L,Hr=cr,Vr=Tt,qr=gt,zr=M,Wr=Pr,$r=jn,Qr=Br("slice"),Kr=$r("species"),jr=[].slice,Xr=Math.max;Gr({target:"Array",proto:!0,forced:!Qr},{slice:function(e,t){var n,a,r,i=zr(this),o=qr(i.length),s=Vr(e,o),l=Vr(void 0===t?o:t,o);if(Hr(i)&&("function"!=typeof(n=i.constructor)||n!==Array&&!Hr(n.prototype)?Yr(n)&&null===(n=n[Kr])&&(n=void 0):n=void 0,n===Array||void 0===n))return jr.call(i,s,l);for(a=new(void 0===n?Array:n)(Xr(l-s,0)),r=0;s1?arguments[1]:void 0)}});var Jr=rn,ei=M,ti=[].join,ni=y!=Object,ai=Rr("join",",");Jr({target:"Array",proto:!0,forced:ni||!ai},{join:function(e){return ti.call(ei(this),void 0===e?",":e)}});var ri=rn,ii=Tt,oi=ut,si=gt,li=k,ci=mr,_i=Pr,di=Br("splice"),ui=Math.max,mi=Math.min;ri({target:"Array",proto:!0,forced:!di},{splice:function(e,t){var n,a,r,i,o,s,l=li(this),c=si(l.length),_=ii(e,c),d=arguments.length;if(0===d?n=a=0:1===d?(n=0,a=c-_):(n=d-2,a=mi(ui(oi(t),0),c-_)),c+n-a>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(r=ci(l,a),i=0;ic-a+n;i--)delete l[i-1]}else if(n>a)for(i=c-a;i>_;i--)s=i+n-1,(o=i+a-1)in l?l[s]=l[o]:delete l[s];for(i=0;ii;)Oi.f(e,n=a[i++],t[n]);return e},Ai=lt("document","documentElement"),Di=ne,Mi=Ii,Li=Dt,wi=Pe,xi=Ai,Pi=V,ki=xe("IE_PROTO"),Ui=function(){},Fi=function(e){return"