Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove at most one leading space from comments #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Lattay
Copy link

@Lattay Lattay commented Nov 1, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant