Repository navigation
Fix callout title option rendered as HTML title attribute - #15051
Merged
Merged
Conversation
A callout written with title="..." rendered that text as an HTML title attribute: on the .callout div in HTML output and on the wrapper div in revealjs and EPUB. Browsers show it as a tooltip over the whole callout, repeating the heading. The callout parser read the title option without removing it from the div attributes, unlike appearance, collapse and icon next to it, so it was copied with the other leftover attributes. This dates back to when the title attribute was first supported (v1.3). The title is now removed once read. As a side effect, a revealjs or EPUB callout with only an id and a title no longer gets a wrapper div, since no leftover attributes remain. Other attributes such as data-* are still passed through.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While working on #15041, I noticed that a callout's
titleoption also ends up as an HTMLtitleattribute: on the.calloutdiv in html, and on the wrapper div in revealjs and epub. Browsers show it as a tooltip over the whole callout, repeating the heading already displayed.Root cause
The callout parser in
src/resources/filters/customnodes/callout.luareadstitlebut does not remove it from the div attributes, unlikeappearance,collapseandiconnext to it. So it gets copied with the other leftover attributes. This is there since thetitleattribute was first supported in 1.3.Fix
titleis now removed once read. Other leftover attributes likedata-*still pass through.In revealjs and epub, a callout with an id and a title no longer gets a wrapper div, as no leftover attributes remain. It renders as a single div, like an untitled callout with an id since #15041.
Checklist
I have (if applicable):
AI-assisted PR
Note: autonomous AI agents submitting PRs without human oversight are not permitted — see the Code of Conduct.