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

Add syntax aware line joiner #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add syntax aware line joiner #55

wants to merge 1 commit into from

Conversation

sidju
Copy link

@sidju sidju commented Nov 10, 2023

  • Avoids touching block quotes, as they would need recursive parsing.
  • Currently has a quirk of adding a trailing newline to the output.

@sidju
Copy link
Author

sidju commented Nov 11, 2023

I've realized that the current handling for lists isn't correct. To add another line of text in a list entry the text should be indented (syntax says 4 spaces or tab, convention says 2 spaces). As such I'll add another commit that handles that (and preserves the indentation while joining).

@sidju sidju marked this pull request as draft November 11, 2023 09:31
@sidju sidju force-pushed the main branch 2 times, most recently from 2ab62c0 to cef52d8 Compare November 11, 2023 16:23
@sidju
Copy link
Author

sidju commented Nov 11, 2023

Should be complete now. Looks a bit bad though, so you might be better of doing a rewrite based on it than using it as is.

@sidju sidju marked this pull request as ready for review November 11, 2023 16:25
@sidju sidju marked this pull request as draft November 11, 2023 16:29
@sidju
Copy link
Author

sidju commented Nov 11, 2023

Has a panic causing bug. Gonna find and fix that real quick

- Uses recursive parsing to handle list entries and block quotes, the contents
  of which should be treated as markdown.
- Currently has a quirk of adding a trailing newline to the output.
@sidju sidju marked this pull request as ready for review November 11, 2023 16:41
@Canop
Copy link
Owner

Canop commented Nov 11, 2023

Just a note: I'll definitely have a look at this PR, but it may take a while, I have a huge backlog of issues to solve.

@sidju
Copy link
Author

sidju commented Nov 11, 2023

No worries. I have my workaround set up and working, it just feels stupid to write this bloody syntax aware line joiner and not share it where others would need it.

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.

2 participants