Skip to content
This repository has been archived by the owner on Aug 4, 2022. It is now read-only.

Don't require whitespace on blank lines #3

Open
sourcefrog opened this issue Aug 5, 2015 · 4 comments
Open

Don't require whitespace on blank lines #3

sourcefrog opened this issue Aug 5, 2015 · 4 comments

Comments

@sourcefrog
Copy link

cram sometimes requires trailing whitespace, which causes unfortunate conflicts with trees or editors set up to strip them.

The main case I notice is blank spaces occurring in the middle of output blocks. cram wants them to have ^ $ so that they're indented to the same point. It seems like that could be ignored without much loss of sensitivity.

@sourcefrog
Copy link
Author

I could probably send you a patch for this if it's acceptable in principle.

@pnathan
Copy link

pnathan commented Oct 27, 2015

👍

@roman-neuhauser
Copy link

wouldn't that create an ambiguity?

@sourcefrog
Copy link
Author

I think not, but there might be some difficult cases.

This command prints _n_ blank lines:

  $ print_blank_lines 4





Pretty neat!

I think you could potentially fix that by saying the document is composed of paragraphs separated by single blank lines, and each paragraph is an example if the nonblank lines all have >=2 spaces. Then, the middle paragraph of this example contains 4 blank lines at the end.

I tried a patch for this years ago but found the parser code hard to change.

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

No branches or pull requests

4 participants