DB: text export expands a deprecated {{embed [[page]]}} macro into the page's content
还没有人认领这个 Issue。
评估
调研方向
The expansion happens in replace-block&page-embeds in frontend.handler.export.common-impl, and the three assertions to revisit are in frontend.handler.export-test (export-blocks-as-markdown-without-properties, export-blocks-as-markdown-newline-after-block, export-blocks-as-markdown-level<N>). Before changing code, a maintainer needs to decide whether DB graphs should keep expansion (B) or write the macro as text (A); the issue has no decision yet. If A is chosen, done means export and paste round-trip a block with an embed macro unchanged.
由索引模型根据 Issue 内容生成。
描述
In a DB graph, a block whose text contains the file-graph embed macro, e.g.
Groceries {{embed [[Shopping]]}}
is shown as "Groceries" and the deprecated-macro warning (frontend.components.block, :block.macro/embed-deprecated); the Shopping page's blocks are not shown. DB embeds are :block/link blocks made with the embed command.
Exporting that block as text (Copy as / Export as Markdown) writes the Shopping page's blocks in place of the macro:
- Groceries
- milk
- eggs
So the export contains content the block does not show, and pasting the export back gives three blocks instead of the one block. If the embedded page is empty, the macro disappears from the export without a trace (- Groceries).
The expansion is done by replace-block&page-embeds in frontend.handler.export.common-impl (code from file graphs, where the macro did show the page). Three tests in frontend.handler.export-test assert it for the text export: export-blocks-as-markdown-without-properties, export-blocks-as-markdown-newline-after-block, export-blocks-as-markdown-level<N.
Which is intended for DB graphs?
- A. The text export writes the macro as text (
- Groceries {{embed [[Shopping]]}}), the way the block shows it; export and paste give back the same block. Those three tests change. - B. The text export keeps expanding the macro, as now.
Found by fuzzing export as text → paste. Happy to send the PR for A with tests.
- 主要语言
- 没有语言数据
- 星标
- 29
- 派生
- 2
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
logseq/db-test 的其他 Issue
-
Web build on a phone: the fold arrow of an h1/h2 block lies on its bullet, so tapping the bullet folds instead of zooming in可能已有人在做 @tiensonqin 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 87/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 85/100
-
Page titles with `$$`, `$&`, `` $` `` or `$'` change when block refs are resolved可能已有人在做 @RaphaelFakhri 于 19 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
-
`#Asset` label is not displayed on asset nodes when `Hide from Node` is disabled可能已有人在做 @tiensonqin 于 21 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 65/100
相似的 Issue
-
code-quality good-first-issue
难度 2/5 1-3 小时 新手友好度 72/100
OpenRailAssociation/netzgrafik-editor-frontend#1481 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
seek4science/seek#2784 ·
维护者通常 2 天内回复
-
area-clientside-dartpad
难度 2/5 1-3 小时 新手友好度 66/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
SACGF/variantgrid#2737 · 1 条评论 ·
维护者通常 1 天内回复
-
bug frontend ui
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复