summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Carrico <acarrico@memebeam.org>2020-06-16 20:45:45 -0400
committerBastien <bzg@gnu.org>2020-09-05 10:02:10 +0200
commit47105413657dd4986c2402b6250f06e56530b644 (patch)
treea5aea3c63fb5aea29e77d4563e078544253d56af
parent3f8fe3969550182b26f5c745c82dd8721dc5c6b5 (diff)
downloadorg-mode-471054136.tar.gz
ox-html.el: Use classList and put in the public domain
* lisp/ox-html.el (org-html-scripts): Fix a potential bug by using the classList within the Javascript code, and put this new version of the code in the public domain. See <https://orgmode.org/list/20200617002335.l4lg3slfxm74vx3h@silver> TINYCHANGE
-rw-r--r--lisp/ox-html.el16
1 files changed, 7 insertions, 9 deletions
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index dae19ad..4b2f3c5 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -232,25 +232,23 @@ property on the headline itself.")
(defconst org-html-scripts
"<script type=\"text/javascript\">
-// @license magnet:?xt=urn:btih:1f739d935676111cfff4b4693e3816e664797050&amp;dn=gpl-3.0.txt GPL-v3-or-Later
+// @license magnet:?xt=urn:btih:e95b018ef3580986a04669f1b5879592219e2a7a&dn=public-domain.txt Public Domain
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
- elem.cacheClassElem = elem.className;
- elem.cacheClassTarget = target.className;
- target.className = \"code-highlighted\";
- elem.className = \"code-highlighted\";
+ elem.classList.add(\"code-highlighted\");
+ target.classList.add(\"code-highlighted\");
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
- if(elem.cacheClassElem)
- elem.className = elem.cacheClassElem;
- if(elem.cacheClassTarget)
- target.className = elem.cacheClassTarget;
+ if(null != target) {
+ elem.classList.remove(\"code-highlighted\");
+ target.classList.remove(\"code-highlighted\");
+ }
}
/*]]>*///-->
// @license-end