Skip to content

fix(asciidoc): keep a block title separate from the paragraph it titles - #4391

Merged
PeterStaar-IBM merged 1 commit into
docling-project:mainfrom
r0h1tb:fix/asciidoc-block-title-paragraph
Oct 26, 2026
Merged

PeterStaar-IBM merged 1 commit into
docling-project:mainfrom
r0h1tb:fix/asciidoc-block-title-paragraph

Conversation

@r0h1tb

@r0h1tb r0h1tb commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem

#4431 stopped a block title in front of a paragraph from dropping the rest of the document, but the paragraph is still appended to the title, so the whole paragraph becomes one bold "caption":

src = b"Intro.\n\n.Procedure\nDo the thing.\n\nAfter.\n"
doc.export_to_markdown()  # 'Intro.\n\n**Procedure Do the thing.**\n\nAfter.'

Fix

A block title is a single line, so the line after it starts the paragraph it titles. That branch now flushes pending text, emits the title as a bold paragraph (as _flush_caption_as_paragraph already does for targets with no caption slot) and starts an ordinary paragraph with the line.

Tests

Rebased onto current main. New test_block_title_is_not_merged_into_the_paragraph_it_titles checks texts and formatting for a two-line titled paragraph. test_text_before_block_title_is_not_merged_with_text_after from #4431 expected "Caption text2"; it now expects "Caption", "text2". Both fail without the fix. tests/test_backend_asciidoc.py: 57 passed on main, 58 with this change. Ruff clean, ty reports the same 3 existing warnings as main.

Checklist:

  • Documentation has been updated, if necessary.
  • Examples have been added, if necessary.
  • Tests have been added, if necessary.

@github-actions

Copy link
Copy Markdown
Contributor

✅ DCO Check Passed

Thanks @r0h1tb, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🟢 Merge protection satisfied — ready to merge.

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

A block title is a single line, but the lines after it were appended to
the title, so ".Procedure" followed by "Do the thing." became one bold
paragraph "Procedure Do the thing.". The title is now emitted as a bold
paragraph and the following lines form an ordinary paragraph.

Signed-off-by: Rohit Behera <126186063+r0h1tb@users.noreply.github.com>
@r0h1tb
r0h1tb force-pushed the fix/asciidoc-block-title-paragraph branch from 42a9dd6 to 70eb5c4 Compare October 25, 2026 04:23
@r0h1tb r0h1tb changed the title fix(asciidoc): keep a titled paragraph and the text after it fix(asciidoc): keep a block title separate from the paragraph it titles Oct 25, 2026
@github-actions github-actions Bot added ai:ci-safe AI triage found no CI-safety concern (advisory) asciidoc issue related to asciidoc backend bug Something isn't working labels Oct 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

AI triage (advisory)

Checked commit 70eb5c4b64. The analysis read the diff only. It did not run code from this pull request.

The PR changes the AsciiDoc backend so a block title is a single line. The next line now starts a normal paragraph, and the title is emitted as a bold paragraph before it. This stops text loss after a block title.

Topic labels added: bug, asciidoc.

CI safety: no concern found. A maintainer must still approve CI.

The ai:* labels are advisory. They do not approve CI and they do not add tests:full. A new push runs this check again.

@PeterStaar-IBM PeterStaar-IBM left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@PeterStaar-IBM
PeterStaar-IBM merged commit 821526e into docling-project:main Oct 26, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai:ci-safe AI triage found no CI-safety concern (advisory) asciidoc issue related to asciidoc backend bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants