ldoc
ldoc copied to clipboard
@usage rendering retains leading white-space from source comment
In a comment with @usage, all white-space from right after the double-dash is added to the rendered source code in documentation. This prevents clean copy&paste and also prevents developers from writing nice comments.
Example
---
-- @usage
-- foo = bar(flag, ...)
turns into
foo = bar(flag, ...)
instead of
foo = bar(flag, ...)
When trying to remove all white-space from the start of the code in the comment, comments in the @usage sample code break the @usage context:
---
-- @usage
--foo = bar(flag, ...)
---- The next line is essential
--bar=bar-foo
Sorry about the delay - been MIA! The fix is to strip any leading spaces in usage blocks, based on the indentation of the first line.
Sorry about the delay - been MIA!
It happens... cough (Okay, I blame GitHub notifications failing for mine.)
Anyway, my incredible test file renders great in LDoc 1.4.6, in case you were leaving this open due to missing confirmation :)
Fixed in 7bed1fa.