Skip to content

fix: stop auto-brief extraction at headings#1187

Open
gennaroprota wants to merge 1 commit intocppalliance:developfrom
gennaroprota:fix/stop_auto_brief_extraction_at_headings
Open

fix: stop auto-brief extraction at headings#1187
gennaroprota wants to merge 1 commit intocppalliance:developfrom
gennaroprota:fix/stop_auto_brief_extraction_at_headings

Conversation

@gennaroprota
Copy link
Copy Markdown
Collaborator

@gennaroprota gennaroprota commented Apr 29, 2026

When a symbol's documentation begins with a @par Title block (with no front matter text before it), parsing emits a HeadingBlock for the title followed by a ParagraphBlock for the body. The auto-brief pass walked past the heading looking for the first paragraph, promoted the @par body to the brief, and left the title rendered as a section with no content.

The fix is to stop iterating at the first HeadingBlock: content under a heading is the body of that section, not the symbol's introductory prose. This is tightly scoped---HeadingBlock is only emitted from @par today---and preserves the existing behavior when a front matter is present.

The commit adds a regression test covering both shapes (no front matter, and explicit brief paragraph before the @par section).

Closes issue #1162.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

🚧 Danger.js checks for MrDocs are experimental; expect some rough edges while we tune the rules.

✨ Highlights

  • 🧪 Existing golden tests changed (behavior likely shifted)

🧾 Changes by Scope

Scope Lines Δ% Lines Δ Lines + Lines - Files Δ Files + Files ~ Files ↔ Files -
🥇 Golden Tests 96% 194 192 2 4 - 4 - -
🛠️ Source 4% 9 9 - 1 - 1 - -
Total 100% 203 201 2 5 - 5 - -

Legend: Files + (added), Files ~ (modified), Files ↔ (renamed), Files - (removed)

🔝 Top Files

  • test-files/golden-tests/javadoc/paragraph/par-1.xml (Golden Tests): 89 lines Δ (+89 / -0)
  • test-files/golden-tests/javadoc/paragraph/par-1.html (Golden Tests): 45 lines Δ (+44 / -1)
  • test-files/golden-tests/javadoc/paragraph/par-1.adoc (Golden Tests): 40 lines Δ (+40 / -0)

Generated by 🚫 dangerJS against 69eac32

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.20%. Comparing base (966e652) to head (69eac32).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1187   +/-   ##
========================================
  Coverage    79.20%   79.20%           
========================================
  Files          308      308           
  Lines        32332    32334    +2     
  Branches      6493     6494    +1     
========================================
+ Hits         25607    25609    +2     
  Misses        4355     4355           
  Partials      2370     2370           
Flag Coverage Δ
bootstrap 81.89% <ø> (ø)
cpp 78.92% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gennaroprota gennaroprota force-pushed the fix/stop_auto_brief_extraction_at_headings branch from 967840f to d008a97 Compare April 29, 2026 09:18
@cppalliance-bot
Copy link
Copy Markdown

cppalliance-bot commented Apr 29, 2026

An automated preview of the documentation is available at https://1187.mrdocs.prtest2.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2026-04-30 05:44:39 UTC

When a symbol's documentation begins with a `@par Title` block (with no
front matter text before it), parsing emits a `HeadingBlock` for the
title followed by a `ParagraphBlock` for the body. The auto-brief pass
walked past the heading looking for the first paragraph, promoted the
`@par` body to the brief, and left the title rendered as a section with
no content.

The fix is to stop iterating at the first HeadingBlock: content under a
heading is the body of that section, not the symbol's introductory
prose. This is tightly scoped---`HeadingBlock` is only emitted from
`@par` today---and preserves the existing behavior when a front matter
is present.

The commit adds a regression test covering both shapes (no front matter,
and explicit brief paragraph before the `@par` section).

Closes issue cppalliance#1162.
@gennaroprota gennaroprota force-pushed the fix/stop_auto_brief_extraction_at_headings branch from d008a97 to 69eac32 Compare April 30, 2026 05:35
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