Skip to content

fix: stop auto-brief extraction at headings#1179

Open
gennaroprota wants to merge 1 commit intocppalliance:developfrom
gennaroprota:develop
Open

fix: stop auto-brief extraction at headings#1179
gennaroprota wants to merge 1 commit intocppalliance:developfrom
gennaroprota:develop

Conversation

@gennaroprota
Copy link
Copy Markdown
Collaborator

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.

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.
@github-actions
Copy link
Copy Markdown

🚧 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 ca8a688

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.09%. Comparing base (0246935) to head (ca8a688).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1179      +/-   ##
===========================================
+ Coverage    78.85%   79.09%   +0.23%     
===========================================
  Files          308      309       +1     
  Lines        32157    46239   +14082     
  Branches      6456     6457       +1     
===========================================
+ Hits         25359    36574   +11215     
- Misses        4436     7301    +2865     
- Partials      2362     2364       +2     
Flag Coverage Δ
bootstrap 81.89% <ø> (ø)
cpp 78.90% <100.00%> (+0.35%) ⬆️

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.

@cppalliance-bot
Copy link
Copy Markdown

An automated preview of the documentation is available at https://1179.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-22 09:24:23 UTC

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