keewis / blackdoc

run black on documentation code snippets
https://blackdoc.readthedocs.io
MIT License
47 stars 4 forks source link

properly detect triple quotes #132

Closed keewis closed 2 years ago

keewis commented 2 years ago

It doesn't seem to be possible to detect the difference between "string""" and """string""" with just string matching (or, at least, it seems complicated), so this uses the tokenize module instead. In the future we might want to switch to ast instead, which in other places would also allow fixing #15.