#4567 (Non-free) Minified JS excerpt on diff2html library
Opened 2 months ago by sergiodj. Modified a month ago

While working on the Pagure package for Debian, I found that the files:

https://pagure.io/pagure/blob/master/f/pagure/static/vendor/diff2html/diff2html-ui.js
https://pagure.io/pagure/blob/master/f/pagure/static/vendor/diff2html/diff2html.js

start with a minified JavaScript excerpt. This is really strange, because the files are supposed to contain only non-minified JS; also there is no comment about what the minified JS is supposed to do.

I am opening this issue because I would like to understand the purpose of that code, and to check if it is OK to remove it (I can propose a PR if wanted). Thanks in advance!


I think that first line is about wiring diff2html into highlight.js, but I'm not sure...

Thanks for the reply. The file was added on e2f045f by @ryanlerch; maybe he knows more about it? It'd be good if we could either remove this excerpt from these files, or un-minify them.

@sergiodj Well, if it's about wiring the file into highlightjs, then it's not minified logic, just compactly written logic.

Assuming that it is minified (aka not the preferred form) is probably wrong here.

Sorry, but I don't see much difference between "minified JS" and "compactly written logic" in this case. And, TBH, I don't think this definition matters for the problem at hand. The fact that we are not sure what the code does reinforces the point that it is non-free, so it should either be removed or unminified.

This is one of the last things I'd like to fix before I'm finally able to upload pagure to Debian :-).

I haven't had the time to experiment with removing that piece of code and checking if it breaks anything. I'll try to do that this weekend, if @ryanlerch doesn't chime in.

@sergiodj I'm fairly certain that the one line up there exports it as something for hljs. We do the same thing for our "hand written" spec.js file to add the rpmspec syntax highlighting.

It won't break anything to remove it, since we use the minified version by default. But removing that will make it so you cannot trivially substitute the minified version for the non-minified version.

Login to comment on this ticket.

Metadata