Skip to content

reword BlockQuoteKind -> AdmonitionKind, render as div#1069

Open
orangecms wants to merge 2 commits intopulldown-cmark:mainfrom
orangecms:admonition-semantics
Open

reword BlockQuoteKind -> AdmonitionKind, render as div#1069
orangecms wants to merge 2 commits intopulldown-cmark:mainfrom
orangecms:admonition-semantics

Conversation

@orangecms
Copy link

The extended GFM reuses blocks that are usually for quote also for admonitions, so while the notation is ambiguous, we can distinguish the semantics. This is an API breakage for library users.

The rendering as a <div role="note"> is semantically more adequate and more suitable for assistive tooling. There is no semantic HTML element for this purpose at this point. For reference, see

via #1068

@Martin1887
Copy link
Collaborator

Please check the formatting errors.

Also, I miss documentation about this in the mdBook (although it currently does not exist): https://github.com/pulldown-cmark/pulldown-cmark/blob/main/guide/prepare-specs.rs.

Thanks!

The extended GFM reuses blocks that are usually for quote also for
admonitions, so while the notation is ambiguous, we can distinguish
the semantics. This is an API breakage for library users.

The rendering as a `<div role="note">` is semantically more adequate
and more suitable for assistive tooling. There is no semantic HTML
element for this purpose at this point. For reference, see
- <https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/note_role>
- <https://www.w3.org/TR/WCAG21/#name-role-value>

Signed-off-by: Daniel Maslowski <info@orangecms.org>
@orangecms orangecms force-pushed the admonition-semantics branch from a6da33e to 2e2531f Compare February 10, 2026 12:42
@orangecms
Copy link
Author

whoops, yup, formatting fixed 😅

What do you mean by "documentation about this in the mdBook"?
The specs are in the specs/ directory, I just adjusted them and regenerated the test suite.

What am I missing? 🥺

@orangecms
Copy link
Author

Admonition support in the guide (I think that's what you mean by "the mdBook"?) is currently mentioned in index.md:

In addition to the base CommonMark language, it supports tables, task lists, strikethrough, footnotes, admonitions, and LaTeX-style math from GFM.

@orangecms
Copy link
Author

Would you like me to add to dev/block-parsing.md?

Signed-off-by: Daniel Maslowski <info@orangecms.org>
@Martin1887
Copy link
Collaborator

Yes, I meant specs/blockquotes_tags.txt. It should work but it is not in https://pulldown-cmark.github.io/pulldown-cmark, probably it just have to be deployed.

@Martin1887
Copy link
Collaborator

I have checked the output of the job and the admonitions spec is not generated, probably an error in the script that generates the Markdown files.

@orangecms
Copy link
Author

That would be for another PR then, though?

@Martin1887
Copy link
Collaborator

Yes, a different pull request, but it should be fixed before launching 0.14 release 🙂.

A long time has passed since the last release, so this is a good moment for a breaking new release.

Everything is fine on my side, but I would like the approval of @notriddle. Also, before the 0.14 release we should consider to take into account #1013 pull request.

Thanks!

@orangecms
Copy link
Author

Oh I see, #1013 also renders as divs - I would happily rebase, should that one go first. It's bigger, so not as much effort for me. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants