miyuchina / mistletoe

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

weird hack in PygmentsRenderer #179

Closed rabinniroula closed 1 year ago

rabinniroula commented 1 year ago

the type mistletoe.block_token.BlockCode cannot directly access its attribute content, so I had to do this. :)

anderskaplan commented 1 year ago

I'm not too familiar with pygments, but it's clear to see that unit tests are sorely missing. I'd suggest to add at least one test case so that this type of problems wouldn't go undetected.

Are you sure this hack is needed with the master version, though? A content property was added to the BlockCode class a while back which is supposed to do this de-referencing for you.

pbodnar commented 1 year ago

close: I can confirm @anderskaplan's words, i.e. there seems to be no problem accessing the BlockCode's property content since e853a0def73f4d4.