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

Optionally preserve whitespace in Lua stringify function #10015

Open
jeffvalk opened this issue Jul 21, 2024 · 0 comments
Open

Optionally preserve whitespace in Lua stringify function #10015

jeffvalk opened this issue Jul 21, 2024 · 0 comments

Comments

@jeffvalk
Copy link

The pandoc.utils.stringify function normalizes all whitespace. It would be very useful to have the option to return whitespace as represented in the AST.

Addition of an optional preserve_whitespace argument to the stringify function could allow for this. And it could be fully backward compatible:

  • If the argument is false or omitted, stringify would normalize all whitespace as it currently does
  • If the argument is true, stringify would include all whitespace literally (including multiple consecutive line breaks or spaces)

This would allow for other values of preserve_whitespace to be added later if desired (for example, including line breaks but merging consecutive line breaks together). A value of true would mean "preserve whitespace maximally"; false would be the minimal version; and anything in between (if desired) could be named (i.e., a string value).

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

No branches or pull requests

1 participant