Simple inheritance? · Issue #78 · Knagis/CommonMark.NET (original) (raw)

Hi there!

Looking at the code, I'm trying to understand the rationale behind making a sealed Block class, use a BlockTag enum to differentiate blocks, forcing to have all datas related to a specific kind of blocks appearing on the Block class, at the same level, making the Block class almost a blob class, rather than using a simple inheritance scheme? With the current code base:

We can divide blocks into two types: container blocks, which can contain other blocks, and leaf blocks, which cannot.

If you think it would benefit the lib, would you accept a PR for this kind of refactoring? (I'm not promising anything, just taking the pulse! 😅 )