-
Notifications
You must be signed in to change notification settings - Fork 21
fix: rendering of Markdown inline formatting and bullet lists (#1156) #1157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
fix: rendering of Markdown inline formatting and bullet lists (#1156) #1157
Conversation
✨ Highlights
🧾 Changes by Scope
🔝 Top Files
|
|
An automated preview of the documentation is available at https://1157.mrdocs.prtest2.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-02-10 11:40:34 UTC |
24dd8d2 to
4d78ef7
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1157 +/- ##
===========================================
+ Coverage 76.38% 76.47% +0.09%
===========================================
Files 311 311
Lines 29672 29751 +79
Branches 5863 5882 +19
===========================================
+ Hits 22664 22753 +89
+ Misses 4735 4728 -7
+ Partials 2273 2270 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Yes. In theory, we could just bypass clang and parse everything ourselves, and this would be somewhat equivalent to a hook. The biggest issue blocking this right now is human resources: the current plan is to address #1113 first (although we're opening this exception for capy issues). We'll have reasonable solutions for the parsing problem once we get it. 😊 |
|
Oh... Regarding your solution, it looks a little verbose (and potentially duplicated), to be honest. 😅 We already parse Markdown elsewhere in the finalize step; this is completely unrelated to the clang parser. The algorithm takes an array of text nodes and converts them inline into nodes with the proper tags (there are even unit tests for that). We just need to complete the plumbing so that the list items also work with this functionality. It shouldn't be much code. The impression I have is that whatever procedure you used to figure out what to change wasn't aware that the logic already exists in the codebase. And that's understandable, because this codebase has become extremely large and complex, and it's hard to understand the context in which each thing happens. 🙃 But we can come up with a reasonable solution to this problem. It's not that bad. Oh... and we also need tests, of course. 🙂 |
35bccff to
3eb6e00
Compare
…iance#1156) Markdown inline formatting (**bold**, `code`), bullet lists using "- " markers, and nested lists, were not rendered correctly.
3eb6e00 to
00d5d9a
Compare
This was a pre-existing bug that affected all content inside list items (not just our new Markdown lists, but also existing `@li` ones).
00d5d9a to
a7d97f9
Compare
Exercise empty-paragraph, admonition, and styled-continuation branches in Markdown list conversion to meet the 90% patch coverage target.
ee5bf2e to
e4a8e44
Compare
@alandefreitas: This patch covers the current Capy needs but, as I said on Slack, it is ad-hoc. The only long term solution is what Vinnie suggested: a Clang hook to take over comment processing entirely. A bit reluctantly, given the time I spent on it, I'd say we shouldn't merge it. We can extract the fix to inline.html.hbs from it, though, which is a genuine bug fix and doesn't depend on the Clang hook.
Markdown inline formatting (bold, italic,
code) and bullet lists using "- " markers were not rendered in the HTML output.Inline formatting:
Add
appendMarkdownInlines()to parse bold, italic, andcodespans in text nodes, producingStrongInline,EmphInline, andCodeInlinenodes respectively.Call it from
visitText()so all text nodes are processed.Add a markup/b.html.hbs partial to render
<strong>tags.Add doc/inline.html.hbs to dispatch text, strong, emph, and code inline kinds to their partials without emitting extraneous blank lines.
List detection and conversion:
Add list marker detection functions that recognize "- " at the start of text, after newlines, after ":" or "." punctuation, and at trailing positions within already-started lists.
Add
convertParagraphWithLists()to split a paragraph containing list markers into a prefix paragraph and aListBlock.Apply list detection in
visitParagraph(),@parblocks, and@liblocks so that Markdown lists are converted in all contexts.