unofficial mirror of emacs-orgmode@gnu.org
 help / color / Atom feed
* [PATCH] Org-mode publish avoids inserting licensed content into target documents.
@ 2020-06-17  0:45 Anthony Carrico
  0 siblings, 0 replies; only message in thread
From: Anthony Carrico @ 2020-06-17  0:45 UTC (permalink / raw)
  To: emacs-orgmode

* 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



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-17  0:45 [PATCH] Org-mode publish avoids inserting licensed content into target documents Anthony Carrico

unofficial mirror of emacs-orgmode@gnu.org

Archives are clonable:
	git clone --mirror https://yhetil.org/orgmode/0 orgmode/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 orgmode orgmode/ https://yhetil.org/orgmode \
		emacs-orgmode@gnu.org
	public-inbox-index orgmode

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git