timothycrosley / pdocs

A simple program and library to auto generate API documentation for Python modules.
Other
76 stars 20 forks source link

Handle CRLF & whitespace for markdown output #26

Closed KyleKing closed 1 year ago

KyleKing commented 3 years ago

On Windows, the final rendered pdocs output might look like this: # Module Name \r\n \r\n\r\n \r\n```\r\ndef function. The extra carriage returns and leading whitespace aren't removed, so tables and code blocks aren't valid markdown.

This PR is a very minor fix that first standardizes on newline-only line endings (remove carriage returns) then escapes optional internal spaces. If needed, I can add a fix to re-add carriage returns, but that doesn't appear to be necessary when testing on Windows and Mac.

I've been testing these changes as part of my calcipy project