-
Notifications
You must be signed in to change notification settings - Fork 47
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 option to disable lowercasing of Reference links #273
Comments
Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗 |
Thanks for the issue! I'm not sure I want this as link labels are case insensitive. Lower casing makes this obvious and the link labels consistent. What would be your expected formatting for the following Markdown? [unreleased]
[Unreleased]
[Unreleased]: https://github.com |
In the case of running mdformat with the default settings, I would expect to lowercase them and keep the current behavior. In the case of disabling case sensitivity, the formatter won't touch the casing, instead leaving it the same.
I know with this setting, the formatter wouldn't be as opinionated; however, from a user perspective I would prefer the default behavior to be strongly opinionated, with the ability to disable certain rules. However, if this goes against the design philosophy of the library, I understand, and instead I can try to fix the offending scripts 😄 |
Yeah, I do think it's probably better if you fix the offending scripts. If lowercasing link labels breaks your scripts, then I assume the mixed case example also does so, no matter how we format it. Fixing your scripts should be the more resilient solution. |
Understandable, my perspective is coming from adhering to specifications that define (perhaps improperly) how the file should be formatted. For example, my usecase was from https://keepachangelog.com/en/1.0.0, where the |
I see your point. But I don't currently feel like this is a strong enough case to justify adding configuration. I don't want to maintain a configurable formatter, but if you or anyone else wants to make a fork adding all sorts of switches, I think that'd actually be pretty great. |
Describe the problem
Some scripts that operate on MD files directly depend on the capitalization of the file contents. Right now, mdformat automatically lowercases reference link definitions, for example:
mdformat would change to:
It would be nice to have an option to disable this lowercasing, so that doing text find/replaces within the file don't have to worry about capitalization.
Link to your repository or website
No response
Steps to reproduce
somefile.MD
run mdformat to get:
The version of Python you're using
No response
Your operating system
No response
Versions of your packages
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: