-
Notifications
You must be signed in to change notification settings - Fork 106
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
Fix markdown "break on newline" configurability #236
Fix markdown "break on newline" configurability #236
Conversation
Previously, `"break-on-newline": True` was part of the default markdown options. The user could override the configuration value, thus turning it into `"break-on-newline": False`, but unfortunately the markdown2 library ignores the value of the option, and always sets it to `True` if the key is passed in. The `break-on-newline` extra is deprecated, there is a new option since 2.4.11: `breaks` https://github.com/trentm/python-markdown2/wiki/breaks Unfortunately, markdown2 overrides the `breaks.on_newline` configuration if `break-on-newline` is present in the extras, meaning that this doesn't work for disabling "break on newline" either. This means that right now there is _no_ way for the users of jsfh to disable line breaks on newlines. To fix this, remove `break-on-newline` from the default markdown options. If (and only if) the `breaks` config is _not_ set by the user, a `breaks` config is added to the defaults that inserts line breaks on newlines by default.
(As a sidenote, the |
I'd love to see this get it so that we can disable break on newline. Is there more work to be done here @dblanchette ? |
@threema-danilo I think it would also be good to update the |
@estan thanks for the update! I don't currently have the free capacity to work on this issue, but feel free to push changes to my branch in order for it to conform to your project standards 🙂 |
## [1.3.1](v1.3.0...v1.3.1) (2024-11-29) ### Bug Fixes * Fix markdown "break on newline" configurability ([#236](#236)) ([c0c9d09](c0c9d09))
🎉 This PR is included in version 1.3.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Previously,
"break-on-newline": True
was part of the default markdown options. The user could override the configuration value, thus turning it into"break-on-newline": False
, but unfortunately the markdown2 library ignores the value of the option, and always sets it toTrue
if the key is passed in.The
break-on-newline
extra is deprecated, there is a new option since 2.4.11:breaks
https://github.com/trentm/python-markdown2/wiki/breaks Unfortunately, markdown2 overrides thebreaks.on_newline
configuration ifbreak-on-newline
is present in the extras, meaning that this doesn't work for disabling "break on newline" either.This means that right now there is no way for the users of jsfh to disable line breaks on newlines. To fix this, remove
break-on-newline
from the default markdown options. If (and only if) thebreaks
config is not set by the user, abreaks
config is added to the defaults that inserts line breaks on newlines by default.