leeoniya / reMarked.js

client-side HTML > markdown
http://leeoniya.github.io/reMarked.js/
396 stars 97 forks source link

ES6 classes #46

Open leeoniya opened 7 years ago

leeoniya commented 7 years ago

would be good to refactor reMarked to ween it off klass and use ES6 classes with an ES5 transpiler. would also allow it to run in use strict mode, which is currently not possible since klass relies on arguments.callee

leeoniya commented 6 years ago

a tricky part of this is that there are a bunch of conditional extends based on the passed options that would need to be reworked: https://github.com/leeoniya/reMarked.js/blob/master/reMarked.js#L595-L601

i don't have a clear idea of how to do that cleanly besides using composition rather than es6 classes and rather than calling super(), just calling the predefined parent's function in the context of the derived instances.