Add support for more blockquote kinds - #1012
Conversation
|
Thanks, but some tests for the new kind are required before merging 🙂. |
|
I am not very used to this process, what do I need to do ? 😅 |
|
You have to add more examples in |
|
I have added tests as recommended, here is the test output: |
[!INFO] blockquote kind|
Blockquote kinds added in the PR:
|
|
Uhm... nice addition, but I'm not sure if some of them are out of the scope of this project, since it aims to only support standard (or semi-standard) features. |
|
Thanks for the feedback! Would it make sense to make support for these blockquote kinds optional via a feature flag? That way, the core parser remains focused on standard features while still allowing users who need these kinds to enable them. |
|
The thing is blockquote tags are already under a feature flag, so nested or complementary flags may be cumbersome. This change is very small, so it may be included, let's see what the rest of maintainers think about this. |
|
I would really prefer to add support for custom blockquote kinds that the host application can postprocess with a callback function (like the Unknown link callback we have now). It would fix #919, work better for i18n, and allow supporting even more complex directives like DocFx videos and MDN callouts. |
|
It sounds much better, I agree. |
|
This clearly sounds like a better approach indeed |
|
The Unknown approach seems good, but there's a problem: pub enum BlockQuoteKind<'a> {
// ...
Unknown(CowStr<'a>),
}implies Something like: pub enum BlockQuoteKind {
Note,
Tip,
Important,
Warning,
Caution,
Unknown,
}
pub enum FullBlockQuoteKind<'a> {
Standard(BlockQuoteKind),
Unknown(CowStr<'a>),
}But then what would |
Another commonly used blockquote kind, I feel like we could even add support for all of them, as listed on obsidian's documentation: https://help.obsidian.md/Editing+and+formatting/Callouts#Supported+types