py-lua-doc icon indicating copy to clipboard operation
py-lua-doc copied to clipboard

Remove at most one leading space from comments

Open Lattay opened this issue 1 year ago • 0 comments

Hi,

I want to use your sphinx-lua project and I noticed that currently all leading spaces are removed from each line. This is not compatible with the significant indentation used in rst syntax. For example a multiline list would not be handled as expected:

--- Foo
--- * single line elements works as expected
--- * multi line elements
---   are supposed to be aligned with the previous lines
--- * but the leading spaces are removed by the parser
function foo()
    print("foo")
end

This PR simply change the line where the leading comment mark was removed to remove at most one leading space. The problem was that the lstrip method takes a list of independent characters as an argument, not a fixed string.

Hopefully, this fix fits your vision for this project.

Lattay avatar Nov 01 '23 18:11 Lattay