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

Make whitespace handling configurable; always remove some space around HORIZONTALLINE #295

Merged
merged 5 commits into from
Aug 22, 2024

Conversation

felixfontein
Copy link
Collaborator

Currently all whitespace is kept while parsing. This is potentially problematic, for example in RST or MarkDown output, where whitespace can have semantic (for example indentation, double newlines), and whitespace can result in invalid output (say when processing "B(a\nb)" and converting to RST, you get a newline inside a role argument that shouldn't be there).

As a first step to get rid of these problems, allow to configure how to handle whitespace during parsing. The default is as now (ignore). You can now strip whitespace, or keep newlines (so that line-breaks are kept when converting to RST or MarkDown markup, for example).

I also added code to strip some whitespace (spaces and tabs) around HORIZONTALLINE. These result in whitespace in resulting MarkDown or RST markup that shouldn't be there, and there is no reason to keep these at all.

@felixfontein felixfontein merged commit e599e6d into ansible-community:main Aug 22, 2024
6 checks passed
@felixfontein felixfontein deleted the space branch August 22, 2024 11:51
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