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

feat(markdown-renderer): option to normalize spacing after the list marker #202

Merged

Conversation

pbodnar
Copy link
Collaborator

@pbodnar pbodnar commented Dec 2, 2023

This follows #197 and adds the possibility to switch ON the original renderer behavior when the space after list marker (called leader in mistletoe) collapsed just to 1 space.

@pbodnar pbodnar added this to the 1.3.0 milestone Dec 2, 2023
@pbodnar pbodnar self-assigned this Dec 2, 2023
@coveralls
Copy link

coveralls commented Dec 2, 2023

Coverage Status

coverage: 94.153% (+0.003%) from 94.15%
when pulling b518edf on feature/option-to-normalize-space-after-list-leader
into 13d1c11 on master.

@pbodnar
Copy link
Collaborator Author

pbodnar commented Dec 2, 2023

@allets, @anderskaplan, this PR follows the discussions from #197, provided you would like to give feedback. If no one protests in a few days, I would merge this to the master. :)

@anderskaplan
Copy link
Contributor

lgtm!
just one thought about the naming of the flag, which is now very specfic. I believe that there are basically two modes you might want to run the Markdown renderer in: either you want it to stay as faithful to the original as possible, or you want the generated Markdown to be as regular (normalized) as possible. I can imagine that other options like this one will come, and maybe it's better to bundle them together with a single "normalize whitespace" option.

@pbodnar
Copy link
Collaborator Author

pbodnar commented Dec 3, 2023

@anderskaplan, thanks for your feedback. So I would rename the flag to normalize_whitespace, with an outlook that we can gradually take this flag into account in more places of the renderer, right? I haven't studied the renderer thoroughly... :P

@anderskaplan
Copy link
Contributor

@anderskaplan, thanks for your feedback. So I would rename the flag to normalize_whitespace, with an outlook that we can gradually take this flag into account in more places of the renderer, right? I haven't studied the renderer thoroughly... :P

yes exactly!

This follows #197 and adds the possibility to switch ON the
original renderer behavior when the space after list marker (called
leader in mistletoe) collapsed just to 1 space.

The same option can be used to control other types of "whitespace
normalization" in the future.
@pbodnar pbodnar force-pushed the feature/option-to-normalize-space-after-list-leader branch from dd67145 to b518edf Compare December 4, 2023 20:04
@pbodnar
Copy link
Collaborator Author

pbodnar commented Dec 4, 2023

yes exactly!

OK, so I've generalized the newly introduced option. Hopefully fine now? :)

@allets
Copy link
Contributor

allets commented Dec 6, 2023

@pbodnar, good!
Thanks for your commit that fixed my omission.
I like the idea of the generalization.
It works fine.

@pbodnar pbodnar merged commit 3607e94 into master Dec 6, 2023
9 checks passed
@pbodnar pbodnar deleted the feature/option-to-normalize-space-after-list-leader branch December 21, 2023 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants