pycco-docs / pycco

Literate-style documentation generator.
https://pycco-docs.github.io/pycco/
Other
842 stars 144 forks source link

newline string bugfix in issue #17 #91

Closed iamtrask closed 8 years ago

iamtrask commented 8 years ago

Fixed the bug documented in issue #17 wherein multi-line strings can cause undesirable behavior in the comment detection logic. The following python code duplicates the bug in the master codebase and works as desired with this fix.

The Bug

does this render on the left or right?

print smushed(2, 5)==4

x = """ how about this? """

y = z # is this where it should be?

how did this get so BIG!

subsetpark commented 8 years ago

@iamtrask, thanks for opening this! I recently updated Pycco with a simple test suite, in an attempt to get some proper unit tests in place for the whole script. It will be a while until we have full test coverage (and will probably require more refactors of the Pycco internals) but would you be able to add a test for the fix you're implementing?

iamtrask commented 8 years ago

@subsetpark , no problem. I've merged it to the most recent branch and created a unit test around the new support for multiline comments.