miyuchina / mistletoe

A fast, extensible and spec-compliant Markdown parser in pure Python.
MIT License
818 stars 118 forks source link

Merge block_token._root_node and span_token._root_node into a single object #171

Closed anderskaplan closed 1 year ago

anderskaplan commented 1 year ago

This is a proposed refactoring to clean up the state management during parsing a tiny little bit. Instead of having separate _root_node references in the block_token and span_token modules, we merge the two into one and move it to a module already referenced by both of them: token.py.

pbodnar commented 1 year ago

Nice DRYing, thank you. :)