From 31cd10e7443913bcdfecf561702a33b06dcc3840 Mon Sep 17 00:00:00 2001 From: loic <910041@gmail.com> Date: Sun, 7 Jul 2024 11:40:24 +0800 Subject: [PATCH 1/2] Upgrade markdeep to v1.16 to fix the subheading issue and make sure markdeep.min.js is always used --- LaTexMD/template.md.html | 2 +- resources/tonemapping/index.html | 2 +- scripts/LICENSE | 25 + scripts/markdeep.js | 4266 ------------------------ scripts/markdeep.min.js | 5164 +----------------------------- 5 files changed, 35 insertions(+), 9424 deletions(-) create mode 100644 scripts/LICENSE delete mode 100644 scripts/markdeep.js diff --git a/LaTexMD/template.md.html b/LaTexMD/template.md.html index 98ac4b8..624cba6 100644 --- a/LaTexMD/template.md.html +++ b/LaTexMD/template.md.html @@ -15,6 +15,6 @@ - + diff --git a/resources/tonemapping/index.html b/resources/tonemapping/index.html index ddd3e39..d150ef1 100644 --- a/resources/tonemapping/index.html +++ b/resources/tonemapping/index.html @@ -328,7 +328,7 @@ - + diff --git a/scripts/LICENSE b/scripts/LICENSE new file mode 100644 index 0000000..0340655 --- /dev/null +++ b/scripts/LICENSE @@ -0,0 +1,25 @@ +BSD 2-Clause License + +Copyright (c) 2020, Morgan McGuire +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/scripts/markdeep.js b/scripts/markdeep.js deleted file mode 100644 index 737023a..0000000 --- a/scripts/markdeep.js +++ /dev/null @@ -1,4266 +0,0 @@ -/** - Markdeep.js - Version 1.04 - - Copyright 2015-2019, Morgan McGuire, http://casual-effects.com - All rights reserved. - - ------------------------------------------------------------- - - See http://casual-effects.com/markdeep for documentation on how to - use this script make your plain text documents render beautifully - in web browsers. - - Markdeep was created by Morgan McGuire. It extends the work of: - - - John Gruber's original Markdown - - Ben Hollis' Maruku Markdown dialect - - Michel Fortin's Markdown Extras dialect - - Ivan Sagalaev's highlight.js - - Contributors to the above open source projects - - ------------------------------------------------------------- - - You may use, extend, and redistribute this code under the terms of - the BSD license at https://opensource.org/licenses/BSD-2-Clause. - - Contains highlight.js (https://github.com/isagalaev/highlight.js) by Ivan - Sagalaev, which is used for code highlighting. (BSD 3-clause license) -*/ -/**See http://casual-effects.com/markdeep for @license and documentation. -markdeep.min.js 1.04 (C) 2019 Morgan McGuire -highlight.min.js 9.13.1 (C) 2017 Ivan Sagalaev https://highlightjs.org/*/ -(function() { -'use strict'; - -var MARKDEEP_FOOTER = '
'; - -// For minification. This is admittedly scary. -var _ = String.prototype; -_.rp = _.replace; -_.ss = _.substring; - -// Regular expression version of String.indexOf -_.regexIndexOf = function(regex, startpos) { - var i = this.ss(startpos || 0).search(regex); - return (i >= 0) ? (i + (startpos || 0)) : i; -} - -/** Enable for debugging to view character bounds in diagrams */ -var DEBUG_SHOW_GRID = false; - -/** Overlay the non-empty characters of the original source in diagrams */ -var DEBUG_SHOW_SOURCE = DEBUG_SHOW_GRID; - -/** Use to suppress passing through text in diagrams */ -var DEBUG_HIDE_PASSTHROUGH = DEBUG_SHOW_SOURCE; - -/** In pixels of lines in diagrams */ -var STROKE_WIDTH = 2; - -/** A box of these denotes a diagram */ -var DIAGRAM_MARKER = '*'; - -// http://stackoverflow.com/questions/1877475/repeat-character-n-times -// ECMAScript 6 has a String.repeat method, but that's not available everywhere -var DIAGRAM_START = Array(5 + 1).join(DIAGRAM_MARKER); - -/** attribs are optional */ -function entag(tag, content, attribs) { - return '<' + tag + (attribs ? ' ' + attribs : '') + '>' + content + '' + tag + '>'; -} - - -function measureFontSize(fontStack) { - try { - var canvas = document.createElement('canvas'); - var ctx = canvas.getContext('2d'); - ctx.font = '10pt ' + fontStack; - return ctx.measureText("M").width; - } catch (e) { - // Needed for Firefox include...iframe canvas doesn't work for some reason - return 10; - } -} - -/*! highlight.js v9.13.1 | BSD3 License | git.io/hljslicense extended with PyxScript mode */ -!function(e){var t="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):t&&(t.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return t.hljs}))}(function(e){function t(e){return e.replace(/&/g,"&").replace(//g,">")}function r(e){return e.nodeName.toLowerCase()}function a(e,t){var r=e&&e.exec(t);return r&&0===r.index}function n(e){return k.test(e)}function i(e){var t,r,a,i,s=e.className+" ";if(s+=e.parentNode?e.parentNode.className:"",r=A.exec(s))return v(r[1])?r[1]:"no-highlight";for(s=s.split(/\s+/),t=0,a=s.length;a>t;t++)if(i=s[t],n(i)||v(i))return i}function s(e){var t,r={},a=Array.prototype.slice.call(arguments,1);for(t in e)r[t]=e[t];return a.forEach(function(e){for(t in e)r[t]=e[t]}),r}function c(e){var t=[];return function a(e,n){for(var i=e.firstChild;i;i=i.nextSibling)3===i.nodeType?n+=i.nodeValue.length:1===i.nodeType&&(t.push({event:"start",offset:n,node:i}),n=a(i,n),r(i).match(/br|hr|img|input/)||t.push({event:"stop",offset:n,node:i}));return n}(e,0),t}function o(e,a,n){function i(){return e.length&&a.length?e[0].offset!==a[0].offset?e[0].offset"}function c(e){u+=""+r(e)+">"}function o(e){("start"===e.event?s:c)(e.node)}for(var l=0,u="",b=[];e.length||a.length;){var d=i();if(u+=t(n.substring(l,d[0].offset)),l=d[0].offset,d===e){b.reverse().forEach(c);do o(d.splice(0,1)[0]),d=i();while(d===e&&d.length&&d[0].offset===l);b.reverse().forEach(s)}else"start"===d[0].event?b.push(d[0].node):b.pop(),o(d.splice(0,1)[0])}return u+t(n.substr(l))}function l(e){return e.v&&!e.cached_variants&&(e.cached_variants=e.v.map(function(t){return s(e,{v:null},t)})),e.cached_variants||e.eW&&[s(e)]||[e]}function u(e){function t(e){return e&&e.source||e}function r(r,a){return new RegExp(t(r),"m"+(e.cI?"i":"")+(a?"g":""))}function a(n,i){if(!n.compiled){if(n.compiled=!0,n.k=n.k||n.bK,n.k){var s={},c=function(t,r){e.cI&&(r=r.toLowerCase()),r.split(" ").forEach(function(e){var r=e.split("|");s[r[0]]=[t,r[1]?Number(r[1]):1]})};"string"==typeof n.k?c("keyword",n.k):w(n.k).forEach(function(e){c(e,n.k[e])}),n.k=s}n.lR=r(n.l||/\w+/,!0),i&&(n.bK&&(n.b="\\b("+n.bK.split(" ").join("|")+")\\b"),n.b||(n.b=/\B|\b/),n.bR=r(n.b),n.endSameAsBegin&&(n.e=n.b),n.e||n.eW||(n.e=/\B|\b/),n.e&&(n.eR=r(n.e)),n.tE=t(n.e)||"",n.eW&&i.tE&&(n.tE+=(n.e?"|":"")+i.tE)),n.i&&(n.iR=r(n.i)),null==n.r&&(n.r=1),n.c||(n.c=[]),n.c=Array.prototype.concat.apply([],n.c.map(function(e){return l("self"===e?n:e)})),n.c.forEach(function(e){a(e,n)}),n.starts&&a(n.starts,i);var o=n.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([n.tE,n.i]).map(t).filter(Boolean);n.t=o.length?r(o.join("|"),!0):{exec:function(){return null}}}}a(e)}function b(e,r,n,i){function s(e){return new RegExp(e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")}function c(e,t){var r,n;for(r=0,n=t.c.length;n>r;r++)if(a(t.c[r].bR,e))return t.c[r].endSameAsBegin&&(t.c[r].eR=s(t.c[r].bR.exec(e)[0])),t.c[r]}function o(e,t){if(a(e.eR,t)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?o(e.parent,t):void 0}function l(e,t){return!n&&a(t.iR,e)}function p(e,t){var r=N.cI?t[0].toLowerCase():t[0];return e.k.hasOwnProperty(r)&&e.k[r]}function m(e,t,r,a){var n=a?"":L.classPrefix,i='',i+t+s}function g(){var e,r,a,n;if(!y.k)return t(k);for(n="",r=0,y.lR.lastIndex=0,a=y.lR.exec(k);a;)n+=t(k.substring(r,a.index)),e=p(y,a),e?(A+=e[1],n+=m(e[0],t(a[0]))):n+=t(a[0]),r=y.lR.lastIndex,a=y.lR.exec(k);return n+t(k.substr(r))}function f(){var e="string"==typeof y.sL;if(e&&!M[y.sL])return t(k);var r=e?b(y.sL,k,!0,w[y.sL]):d(k,y.sL.length?y.sL:void 0);return y.r>0&&(A+=r.r),e&&(w[y.sL]=r.top),m(r.language,r.value,!1,!0)}function _(){E+=null!=y.sL?f():g(),k=""}function h(e){E+=e.cN?m(e.cN,"",!0):"",y=Object.create(e,{parent:{value:y}})}function x(e,t){if(k+=e,null==t)return _(),0;var r=c(t,y);if(r)return r.skip?k+=t:(r.eB&&(k+=t),_(),r.rB||r.eB||(k=t)),h(r,t),r.rB?0:t.length;var a=o(y,t);if(a){var n=y;n.skip?k+=t:(n.rE||n.eE||(k+=t),_(),n.eE&&(k=t));do y.cN&&(E+=B),y.skip||y.sL||(A+=y.r),y=y.parent;while(y!==a.parent);return a.starts&&(a.endSameAsBegin&&(a.starts.eR=a.eR),h(a.starts,"")),n.rE?0:t.length}if(l(t,y))throw new Error('Illegal lexeme "'+t+'" for mode "'+(y.cN||"