Skip to content

Conversation

@KyleKing
Copy link
Owner

@KyleKing KyleKing commented Nov 22, 2025

Implements post-processing suggestion to render callouts within semantic <div> tags instead of <blockquote> for improved accessibility. The > syntax is being repurposed for callouts rather than quotations.

Implementation details:

  • Override blockquote_open/close HTML renderers to detect callouts
  • Use div tags when blockquote contains obsidian_callout
  • Preserve markdown tokens as blockquote for mdformat compatibility
  • Extract render functions to module level (ruff C901 compliance)
  • Add complete type annotations (RendererHTML, OptionsDict, EnvType)

Changes:

  • Updated all HTML test fixtures from <blockquote> to <div>
  • Nested callouts now use div wrappers throughout
  • mdformat still processes callouts correctly (tokens unchanged)

Tests: All 20 tests passing
Ref: https://github.com/orgs/community/discussions/16925#discussioncomment-8729846

Implements post-processing suggestion to render callouts within semantic
<div> tags instead of <blockquote> for improved accessibility. The '>'
syntax is being repurposed for callouts rather than quotations.

Implementation details:
- Override blockquote_open/close HTML renderers to detect callouts
- Use div tags when blockquote contains obsidian_callout
- Preserve markdown tokens as blockquote for mdformat compatibility
- Extract render functions to module level (ruff C901 compliance)
- Add complete type annotations (RendererHTML, OptionsDict, EnvType)

Changes:
- Updated all HTML test fixtures from <blockquote> to <div>
- Nested callouts now use div wrappers throughout
- mdformat still processes callouts correctly (tokens unchanged)

Tests: All 20 tests passing
Ref: https://github.com/orgs/community/discussions/16925#discussioncomment-8729846
Test Improvements:
- Added 8 new formatter test cases (now 18 total, up from 10)
  - Callouts with code blocks
  - Callouts with lists
  - Callouts with multiple paragraphs
  - Empty callout content
  - All standard callout types (13 types tested)
- Added 5 new HTML render test cases (now 8 total, up from 3)
  - Code blocks, lists, and empty callouts
- Removed "TODO:" prefix from unsupported LaTeX math test

Documentation Improvements (README):
- Added comprehensive Features section with nested details
- Updated HTML rendering example to show <div> output (not <blockquote>)
- Added Accessibility Note explaining div vs blockquote choice
- Added Caveats section documenting:
  - LaTeX math limitations
  - HTML-only rendering features
  - GitHub compatibility notes
- Improved tone to be professional yet approachable
- Added code examples and links throughout

Tests: 28 passing (up from 20) - 40% increase in coverage
Ruff: All checks passing
@KyleKing KyleKing merged commit 184e0b6 into main Nov 24, 2025
6 of 7 checks passed
@KyleKing KyleKing deleted the claude/expand-tests-and-features-01GRGgpEbtLuHdbNMHUkJj3H branch November 24, 2025 02:21
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.

3 participants