viebel / klipse

Klipse is a JavaScript plugin for embedding interactive code snippets in tech blogs.
http://blog.klipse.tech/
GNU General Public License v3.0
3.1k stars 153 forks source link

klipse_plugin_min.js global variable issue #370

Open rdbeach opened 4 years ago

rdbeach commented 4 years ago

It appears that the minified version of the plugin contains several short global variables, among them "io", which is also used globally by socket.io. Using both files at the same time causes a variable naming conflict and will ultimately cause socket.io to break. I temporarily resolved this issue by simply renaming "io".

Is it ok to wrap the klipse plugin in a closure to prevent these variables from having global scope? Or will that cause other things to break?

viebel commented 4 years ago

It should be ok to wrap the klipse plugin in a closure. Can you open a PR for it?