Skip to content

Fix GH-157: Note elements generate semantic HTML using div instead of blockquote#244

Open
lacatoire wants to merge 1 commit intophp:masterfrom
lacatoire:fix/GH-157-note-semantic-html
Open

Fix GH-157: Note elements generate semantic HTML using div instead of blockquote#244
lacatoire wants to merge 1 commit intophp:masterfrom
lacatoire:fix/GH-157-note-semantic-html

Conversation

@lacatoire
Copy link
Contributor

Summary

  • Replace <blockquote><p> with <div> in format_note(), aligning with format_admonition() used by other admonitions (<caution>, <warning>, <tip>, <important>)
  • Change note title from <strong> to <h5 class="title">
  • Remove 'note' => 'span' override for simpara, allowing proper <p> rendering inside notes
  • Remove 'note' => 'span' override for info, using default format_div
  • <sidebar> (which reuses format_note) benefits automatically

Before:

<blockquote class="note"><p><strong class="note">Note</strong>:
  <strong>Custom Title</strong><br />
  <span class="simpara">Content here</span>
</p></blockquote>

After:

<div class="note"><strong class="note">Note</strong>
 <h5 class="title">Custom Title</h5>
 <p class="simpara">Content here</p>
</div>

Test plan

  • New test tests/package/generic/note_rendering_001.phpt covering note with and without title
  • Full test suite passes (no regressions)

Fixes #157

… of blockquote

- Replace <blockquote><p> with <div> in format_note(), aligning with
  format_admonition() used by other admonitions (caution, warning, tip)
- Change note title from <strong> to <h5 class="title">
- Remove 'note' => 'span' override for simpara, allowing <p> rendering
- Remove 'note' => 'span' override for info, using default format_div
- Add test for note rendering
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.

Notes and friends generate semantic HTML garbage

1 participant