emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Anthony Carrico <acarrico@memebeam.org>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Org-mode publish avoids inserting licensed content into target documents.
Date: Tue, 16 Jun 2020 20:45:45 -0400	[thread overview]
Message-ID: <20200617002335.l4lg3slfxm74vx3h@silver> (raw)

* 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	other threads:[~2020-06-17  0:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17  0:45 Anthony Carrico [this message]
2020-09-05  8:03 ` Bastien
2020-09-09 14:44   ` Anthony Carrico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200617002335.l4lg3slfxm74vx3h@silver \
    --to=acarrico@memebeam.org \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: [PATCH] Org-mode publish avoids inserting licensed content into target documents.' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).