fix(importer): keep inline content inside markdown table cells - #130
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Links inside table cells lost their URL and leaked into the next line: Event::Text checked
in_tablebeforein_link, so the link title was written to the cell as plain text whilelink_contentsstayed empty, and TagEnd::Link -- which never checkedin_table-- appended the link node topending_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 topending_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 letin_linkwin overin_tablein Event::Text so link titles are collected before the node is routed.