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 leading spaces after linebreak #214

Merged

Conversation

mikeando
Copy link
Contributor

There are three independent commits

The initial commit just tidies up parse_inline a little by:

  • assigning directly to new_inlas the return value from the match rather than inside each branch.
  • moving some if c=='X' && something() {...} conditions inside the default match arm into their own arms.

The second commit change the way hard linebreaks were rendered in the CM output from '␣␣\n' to '\\n' to allow
for round-tripping when the LineBreak was on an otherwise empty line.

The final commit just left-trims the content in parse_inline if the last node was a LineBreak.
This removes the extra space character that was found in #213.

I'm not 100% sure this is the right way to fix it, but all the cargo test tests pass, and the spec tests all parse.

@kivikakk
Copy link
Owner

Code changes are good, tested it out a bit locally, looks great — thanks!

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.

None yet

2 participants