Ported. How does licensing work?



I ported commonmark.js to TypeScript, added a bunch of modifications. What do I do to make sure I respect the commonmark.js license? Is pointing out it is based on commonmark.js, letting the BSD license carry over, and copy-pasting the LICENSE file enough?

Hey, everyone. I’m sorry if this is the wrong place to ask about these kinds of things.

I got the Make-Yet-Another-Markdown-Parser bug, and struggled with trying to implement a Markdown parser from scratch (Probably tried like 5 different implementations that just weren’t good enough). I eventually caved in and looked at the commonmark.js source.

I spent the next few weeks tweaking it in my free time, and finally decided to put it up on Github, in case my laptop catches fire or something.

I made the following changes:

  • Ported to TypeScript
  • Refactored as much as I could into classes
  • Moved code for each block, and inline type into its own Parser class
  • Added some GFM, and random block/inline types
  • Added tests
  • Removed node.type as the identifier, use instanceof checks instead (which isn’t the best idea, but it allows me to add an arbitrary amount of Parsers and not worry about name clashes)
  • Probably other stuff, memory’s hazy

But then, I realized I couldn’t just put it up publicly and not acknowledge where the original source was from, and I honestly never wrapped my head around how software licenses work.

For now, I’ve naively copy-pasted the LICENSE file from the commonmark.js repo, and just said “I guess the BSD-license carries over” in my repo’s README file.

But if there’s a proper way to do these things, I think I should do it, and would like to know how to do it.

Don’t know if sharing links is allowed or not but here it is