Skip to content

fix(graph-parser): preserve special content in imported quote blocks - #13031

Closed
megayu wants to merge 4 commits into
masterfrom
fix/imported-quote
Closed

megayu wants to merge 4 commits into
masterfrom
fix/imported-quote

Conversation

@megayu

@megayu megayu commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

fix logseq/db-test#1048

  • Preserve Markdown tables when importing quoted table blocks instead of dropping their content.
  • Preserve Quote-block type and original delimiters when importing quotes containing only displayed math or a source block.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes graph-parser import behavior so Quote-blocks preserve “special content” (tables, displayed math, and fenced code) instead of dropping table content or converting the whole quote into a different block type.

Changes:

  • Teach ast->text to render Table AST nodes into Markdown table text so quoted tables aren’t lost.
  • Prevent Quote-blocks from being re-typed as #Math / #Code when they contain only displayed math or a single code fence.
  • Add an integration test graph fixture + assertions covering quoted table/math/code, and update expected counts.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
deps/graph-parser/src/logseq/graph_parser/exporter.cljs Adds table extraction in ast->text and preserves Quote-block type when content is only displayed math / a single code fence.
deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs Adds an async integration test asserting preservation of quoted tables, displayed math, and fenced code; updates expected entity counts.
deps/graph-parser/test/resources/exporter-test-graph/journals/2025_09_14.md New test fixture journal containing quoted table, displayed math, and fenced code blocks.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 1203 to 1206
(and (vector? node) (= (first node) "Src"))
[(str "\n```" (when-let [lang (:language (second node))] lang))
(apply str "\n" (:lines (second node)))
"```"]

Copy link
Copy Markdown
Contributor

Closing as a duplicate of #13886, which covers the same bug more completely. Thanks!

@tiensonqin tiensonqin closed this Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Table Deleted During Import ("Ignored ast node")

3 participants