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

Initial and trailing whitespace is inconsistently not preserved #391

Open
panglesd opened this issue Aug 25, 2022 · 1 comment
Open

Initial and trailing whitespace is inconsistently not preserved #391

panglesd opened this issue Aug 25, 2022 · 1 comment

Comments

@panglesd
Copy link
Collaborator

Let me give a few examples (using docstring comment syntax) of the current behaviour:

# Original Corrected
1
{[
1+1 + 2
   ]}
{[1+1 + 2]}
2
{[   1+1 + 2   ]}
{[1+1 + 2   ]}
3
{[
  1+

  1 + 2     
     ]}
{[
  1+
  
  1 + 2     
]}
  • In 1, both initial and trailing spaces are removed, while in 2, only initial spaces are removed
  • the outputs on1 and 3 also feel very inconsistent...

While this is not a huge problem (one can consistently adopt a non-spaced {[content]} layout), I think it would be good to let the user decide, as for instance {[content]}, {[ content |} and

{[
   very long content
]}

make sense to use.

Moreover, I would like to introduce the use of mdx to check that the examples given in a library compile, and this is generating a lot of diff.

@panglesd
Copy link
Collaborator Author

This can also interact with ocamlformat when parse-doctring is set to true!

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

No branches or pull requests

1 participant