lisp/ox-html.el (org-html-scripts): Small refactoring

* lisp/ox-html.el (org-html-scripts): Small refactoring.

This replays the Javascript refactoring of commit 471054136.

Link: https://orgmode.org/list/498dbe2e-0cd2-c81e-7960-4a26c566a1f7@memebeam.org/
This commit is contained in:
Anthony Carrico 2021-05-01 11:10:17 +02:00 committed by Bastien Guerry
parent 2d1d59d5c0
commit 7c9bf397b5
1 changed files with 5 additions and 8 deletions

View File

@ -240,19 +240,16 @@ property on the headline itself.")
{
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
</script>"