DB: text export expands a deprecated {{embed [[page]]}} macro into the page's content

Abierto
#1,445 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
clojure
Área
frontend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Sin datos de lenguaje
Estrellas
29
Forks
2
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de logseq/db-test

Todos los issues de logseq/db-test

Issues similares

Más issues de Web Dev

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.