-
Notifications
You must be signed in to change notification settings - Fork 1
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
Formatting Issues with mdformat-mkdocs #45
Comments
Thank you for submitting such a detailed issue and you have a nice blog! I'll try to review and release fixes when I have time over the next few weeks |
The wrap logic in mdformat-mkdocs/mdformat_mkdocs/_postprocess_inline.py Lines 9 to 10 in 1a744f6
Formatting Jinja is challenging and outside of the scope of this plugin. A standalone
There is an existing issue reported on |
The alternative syntax using backticks appears to work with mdformat today and would be my recommendation: #48 (comment) In the future, someone could build a plugin that will format the LaTeX directly similar to how |
I've fixed the issues with |
🤔 Can't you do something to prevent the wrapping for Attribute Lists as formatter do for link syntax |
Good point. I thought URLs worked because they lack internal whitespace, but the alt-text variation is preserved. Testing I'm working on a fix to recognize attribute lists now, which should probably be done by early next week when I find time |
I learned about
mdformat-mkdocs
from the@astral-sh/ruff
repository.When I tried using
mdformat-mkdocs
on my repository, I encountered some formatting issues that seem to stem from how the plugin handles specificmkdocs
scenarios. I’m opening this issue to highlight these problems. If I’ve made any mistakes in my usage, please feel free to correct me.⚙️ Configuration Used to Format My Repo
Initially, I used the formatter directly with
pre-commit
, as recommended. However, this formats all files in one go, making it difficult to identify specific issues.To test individual files, I installed
mdformat
andmdformat-mkdocs
usinguvx
:uvx --from mdformat --with "mdformat-mkdocs[recommended]" mdformat docs/index.md
.mdformat.toml
As the
[plugin.mkdocs]
does work from.mdformat.toml
so I have used this command to make it into effect.uvx --from mdformat --with "mdformat-mkdocs[recommended]" mdformat --align-semantic-breaks-in-lists docs/index.md
Bug: Configuration Not Recognized
The configurations specified under the
[plugin.mkdocs]
section in.mdformat.toml
are not recognized by themdformat
CLI. Other configurations work as expected. Please investigate and resolve this inconsistency.Scenarios to Address
--wrap
causesmdformat
to split{:.class1 .class2}
into a new line if it exceeds the wrapping limit. This breaks rendering since the attribute list is no longer correctly applied.
Replacement: The formatter replaces
with a Unicode character. Is there a way to disable this behavior?--no-validate
bypasses this issue, but a proper fix would be appreciated.The text was updated successfully, but these errors were encountered: