Skip to content

fix(importer): keep inline content inside markdown table cells - #130

Merged
ompugao merged 1 commit into
masterfrom
hotfix/markdown_import_broken_table
Aug 20, 2026
Merged

fix(importer): keep inline content inside markdown table cells#130
ompugao merged 1 commit into
masterfrom
hotfix/markdown_import_broken_table

Conversation

@ompugao

@ompugao ompugao commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Links inside table cells lost their URL and leaked into the next line: Event::Text checked in_table before in_link, so the link title was written to the cell as plain text while link_contents stayed empty, and TagEnd::Link -- which never checked in_table -- appended the link node to pending_contents, flushed only at the next paragraph/list item. Bold and italic in cells were dropped for the same reason, and images in cells went straight to pending_contents.

Route every inline node through a single push_inline_content! macro that picks the active container in one consistent order (table cell, heading, paragraph), and let in_link win over in_table in Event::Text so link titles are collected before the node is routed.

Links inside table cells lost their URL and leaked into the next line:
Event::Text checked `in_table` before `in_link`, so the link title was
written to the cell as plain text while `link_contents` stayed empty, and
TagEnd::Link -- which never checked `in_table` -- appended the link node to
`pending_contents`, flushed only at the next paragraph/list item. Bold and
italic in cells were dropped for the same reason, and images in cells went
straight to `pending_contents`.

Route every inline node through a single `push_inline_content!` macro that
picks the active container in one consistent order (table cell, heading,
paragraph), and let `in_link` win over `in_table` in Event::Text so link
titles are collected before the node is routed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ompugao
ompugao merged commit 8e42356 into master Aug 20, 2026
10 checks passed
@ompugao
ompugao deleted the hotfix/markdown_import_broken_table branch August 20, 2026 12:39
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.

1 participant