Repository navigation
fix(asciidoc): parse links and inline marks in block titles - #5144
PeterStaar-IBM merged 2 commits into
Conversation
Block titles skipped inline parsing, so a link like https://example.com[Docs] stayed raw text. Titles before paragraphs and lists now go through _flush_text_data as bold text with hyperlinks. Picture, table and code captions are a single text item, so they get the parsed text and keep the hyperlink only when it covers the whole caption. Signed-off-by: Shashank Yadav <[email protected]>
A block title before a paragraph or list kept the raw asterisks of bold marks in its text. Write the parsed text instead, as captions already do. Signed-off-by: Shashank Yadav <[email protected]>
|
✅ DCO Check Passed Thanks @shashank11yadav, all your commits are properly signed off. 🎉 |
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
AI triage (advisory)Checked commit The PR parses inline markup in AsciiDoc block titles. A title before a paragraph or list keeps links as hyperlinks and stays bold. Picture, table and listing captions get their inline marks removed and keep a hyperlink only when one link covers the whole caption. Topic labels added: CI safety: no concern found. A maintainer must still approve CI. 5 related pull request(s) in the same code
The |
There was a problem hiding this comment.
AI first review (advisory): no blocker found
This review covers the full diff at 2f0f0c8cf4. It read the code and did not run it.
AsciiDoc block titles before paragraphs, lists, pictures, tables, and code blocks parse inline marks and links correctly without regressions in plain block titles.
A maintainer makes the merge decision. This review never approves the pull request.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Keep the text and hyperlink from the block title parsing in docling-project#5144 and pass the parent as well, so a linked caption stays in the section of its item. Signed-off-by: SK Arin <[email protected]>
Block titles now go through the same inline parsing as paragraph text.
.Title ...) keeps links as hyperlinks and stays bold. Inline marks such as*x*are removed from the text, so.The *main* stepgives the bold textThe main step..See https://example.com[Docs]gives the captionSee Docs. The caption keeps a hyperlink only when the link covers the whole caption, so.https://example.com[Docs]givesDocswith the link. Splitting captions into runs would need a caption group; happy to do that if preferred.Behavior changes:
Tests (
tests/test_backend_asciidoc.py):test_links_in_block_titles_of_paragraphs_and_lists: a link in a title before a paragraph and before a list.test_links_in_block_titles_strip_inline_marks: a title with*main*gives the bold textThe main step.test_links_in_block_titles_of_pictures_tables_and_code: picture, table and listing captions, with two titles each.Overlapping open PRs: #5039, #5117 and #4878 change the same block-title code. Expect a small rebase on whichever lands second.
Issue resolved by this Pull Request:
Resolves #5142
Checklist:
Review evidence:
Before: on upstream/main, a link in a block title stays raw text (
https://example.com[Docs]), bold titles keep their asterisks, and picture, table and listing captions have no hyperlink. The new tests fail on upstream/main.After: the new tests pass. Commands run:
uv run pytest tests/test_backend_asciidoc.py: 77 passed.uv run ruff check --config=pyproject.toml docling tests docs/examples perfs: passed.uv run ruff format --check --config=pyproject.toml docling tests docs/examples perfs: passed.uv run --no-sync ty check: passed.Checks cover the document tree (labels, inline groups, bold, hyperlinks) and the Markdown export. No reference data changed.
Not run: the full test suite and
make check.