Repository navigation
fix(export): export a block embed as the embedded block - #13718
yuxi-liu-wired wants to merge 3 commits into
Conversation
7b28419 to
f38a587
Compare
|
Inlining a
Expand |
A block embed is a block linking to the embedded block (:block/link); the text export wrote the linking block's empty title, so the embed exported as an empty bullet.
…tions The Markdown mirror shares tree->file-content-aux and writes one line per block; the inlining is now turned on by :inline-block-embeds? in the text export's content config. The embedded block gets the export's open-blocks-only and include-properties options, the embedding block's own children are not written (the embed shows the embedded block's), and an embed cycle (a block embedding itself, or A embeds B embeds A) is written as the block itself.
24f49ac to
7074a0a
Compare
|
Combined with the other PRs that change the same files into #13784. |
Exporting blocks as text writes a block embed as an empty bullet: the embedded block and its children are missing from the export.
Cause
In a DB graph a block embed is a block whose
:block/linkis the embedded block; its own title is empty.tree->file-content-auxinlogseq.common.export.filewrites each block's own title, so it writes-for the embed. (The export only resolves embeds written as{{embed ((uuid))}}text.)Fix
In the text export, a block with
:block/linkis written as the embedded block and its children, at the embed's level, as the embed shows them::inline-block-embeds?in the text export's content config, so the Markdown mirror, which sharestree->file-content-auxand matches one rendered line to one block, writes one line per block as before;open-blocks-onlyandinclude-propertiesoptions (block->contentkeeps:open-blocks-only?in the options it passes down);Test
In
frontend.handler.export-test:export-blocks-as-markdown-block-embed(a block that embeds a block with one child exports as- embeddedand\t- embedded child; a block embedding itself exports as-) andexport-blocks-as-markdown-block-embed-cycle-and-options(A embeds B embeds A; an embed block with a child of its own; an embed of a collapsed block with open-blocks-only). They fail on master and pass with the fix; the other export tests and the Markdown mirror tests (includingpage-mirror-renders-embedded-node-content-and-tags-test) still pass.