mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 17:26:22 +03:00
[GH-ISSUE #207] Support for Admonition syntax (non-standard) #2026
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#2026
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @berot3 on GitHub (Jul 17, 2019).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/207
Please add support for Admonitions!
https://python-markdown.github.io/extensions/admonition/
Since I am a mkdocs-material user, it would be really great to have this.
Even in a previewer in vscode admonitions are displayed.
@DavidAnson commented on GitHub (Jul 17, 2019):
It looks like Admonitions are supported by this
markdown-itplug-in: https://www.npmjs.com/package/markdown-it-admonitionYou can specify that via the
markdownItPluginsoption like so: https://github.com/DavidAnson/markdownlint/blob/master/README.md#optionsmarkdownitpluginsDoing so will provide basic parsing support and should make the existing
markdownlintrules work a little better with this syntax.Is that what you are looking for?
@berot3 commented on GitHub (Jul 19, 2019):
ah cool thanks, will try!
so since admonitions are non-stadard does this mean that markdownlint will never support it by default?
@DavidAnson commented on GitHub (Jul 19, 2019):
“Never“ is a long time, but I do try to keep external dependencies to a minimum, so I would prefer her not to bake this in if you’re able to use that extensibility point happily.
@Stanzilla commented on GitHub (Dec 11, 2019):
@DavidAnson Is there a way to enable those plugins from a
markdownlintrcfile? I tried"markdownItPlugins": ["markdown-it-admonition"]but got nothing.@DavidAnson commented on GitHub (Dec 11, 2019):
The CLI does not currently support markdown-it plugins.
@Stanzilla commented on GitHub (Dec 11, 2019):
Oh. :(
@miffels commented on GitHub (Jan 24, 2020):
@berot3 @Stanzilla did any of you have luck with what David proposed? I just tried hacking the plugin into the
markdownlint-clioptions passed tomarkdownlint, but it doesn't seem to do anything -markdownlintstill interprets paragraphs in admonition as indented code blocks:@DavidAnson just to confirm - below is what you have been proposing, right?
If we can get this to work, I'd consider making a PR to have this supported in
markdownlint-cli.@Stanzilla commented on GitHub (Jan 24, 2020):
Sadly not, kinda gave up on it for now, sorry 🙁
@DavidAnson commented on GitHub (Jan 24, 2020):
@miffels, yes, that’s my proposal. I’d suggest trying this directly with the
markdownlintlibrary first. It might help to examine themarkdown-ittoken stream before/after adding the plugin. Also, have a look at the last 4 test cases here which exercise this feature: https://github.com/DavidAnson/markdownlint/blob/master/test/markdownlint-test.js@miffels commented on GitHub (Mar 24, 2020):
@DavidAnson Just took a quick look - thanks for pointing out the tests, a lot better than my recent meddling with your code base :P
The issue currently seems to be that
Currently looks like the only way forward would be to publish a new plugin that would address the issue. I am hesitant to do that due to corporate guidelines.
@g13013 commented on GitHub (Mar 24, 2020):
why is this issue closed ?
@DavidAnson commented on GitHub (Mar 25, 2020):
You can scroll up to see the issue history. It was closed by the opener on July 22, 2019. There is some context just above that.
@g13013 commented on GitHub (Mar 25, 2020):
Yeah i've read the history and i don't think there is viable solution for this. can we reopen ?
@DavidAnson commented on GitHub (Mar 25, 2020):
Because Admonitions are not part of the CommonMark specification and they are supported by a markdown-it plug-in and plug-ins are supported by this library, there aren’t any changes to this library that I am planning to make in the near term.
You could re-open this issue for tracking, but it’s not my plan to add library support for everybody’s favorite custom extensions to the Markdown language. There are too many and they can conflict with each other.