emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Org-mode publish avoids inserting licensed content into target d


From: Anthony Carrico
Subject: [PATCH] Org-mode publish avoids inserting licensed content into target documents.
Date: Tue, 16 Jun 2020 20:45:45 -0400

* It is customary for compilers to avoid claiming authorship over target
code.  However, the org-mode publish document publisher silently
inserted licensed content into target documents.  This patch replaces
the GPL-V3 licensed highlighter script with a public domain version to
resolve this issue.

The public domain version works in a different way than the original.
It adds(removes) highlighting rather than replacing the original
format.  In contrast, the old version caches(restores).  Because the
new add(remove) method is idempotent, the public domain version avoids
a potential bug in the original: the cached value would be lost if it
was called twice in succession.

This entire patch is released to the public domain by its author,
Anthony Carrico.  TINYCHANGE
---
 lisp/ox-html.el | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 32996c2c2..6a4555bc7 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -233,25 +233,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
-- 
2.25.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]