Closed n457 closed 6 years ago
Hmm. Does the code above end with a semi-colon?
Nope, the lib code above doesn't end with a ;
, that's the problem.
But as you can see in the screenshot below, it seems that beginning the first function of a library with a !
or a ;
is some sort of convention, avoiding this kind of lib concatenation issues.
My project is using all of those following concatenated libs and after taking a look in all of them individually, most of them begin with a !
or ;
. For the others, it's pure luck that the whole code works : the previous concatenated lib has an ending ;
PS : to-markdown.custom.js means that i had a !
myself
Ah, OK. This library uses https://github.com/substack/node-browserify to build the browser version, which does not add a trailing ;
or !
. There may be an a way to customise this with the browserify JavaScript API (with wrap
?) If you fancy looking into this, I'd welcome a pull request.
Turndown v4 (an upcoming version of this library), uses rollup to build the browser version (https://unpkg.com/turndown/dist/turndown.js), and so should be fixed once released. Thanks for raising this.
to-markdown can trigger an issue with other concatenated codes :
Solution : adding
!
before the first function, like other libs :