DB: two forms of quote break export/paste round-trip (quote block vs. text starting with "> ")

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

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Activo
Stack tecnológico
markdown
Área
backend

Línea de trabajo

Start with wrap-parse-block in frontend.handler.db-based.editor, which decides whether a leading > stays plain text, and with quote-content in logseq.common.export.file, which writes quote blocks. First settle which of the two forms is intended, since the fix depends on that choice. Done means an export/paste round-trip returns identical blocks for both forms, with a test covering each.

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

Descripción

Exporting blocks as text and pasting that text back should give the same blocks. With quotes it cannot: a DB graph has two different kinds of block that both display as a quote, the text export writes both the same way (> some text), so pasting the export back has to turn one into the other. Whatever paste does, one of the two does not come back as itself.

The two forms

  1. A quote block: made with the quote command. It has :logseq.property.node/display-type :quote, the tag #Quote (:logseq.class/Quote-block), and its text is stored without >.
  2. A plain block whose text starts with > : typing > some text in a block and leaving it keeps the text as is (wrap-parse-block does not convert it), with no display type and no tag. It still renders as a quote: the block's text is parsed as - <title>, and mldoc reads - > some text as an empty title followed by a Quote.

They look the same but are different blocks: only the first has the #Quote tag and the display type (what a query on the tag, or anything checking the display type, sees).

By contrast, typing # some text in a block is converted on save: the # is removed and :logseq.property/heading 1 is set. So a heading has one form, and export/paste round-trips it; a quote has two, and export/paste cannot.

Which is intended?

  • If > at the start of a block should make a quote block (like # makes a heading), saving should convert it; the two forms become one, and export/paste round-trips quotes.
  • If > some text is meant to stay text that renders as a quote, the two are different blocks, and the export has to write them differently. logseq/logseq#13721 does this by writing the plain form as \> some text (mldoc reads the backslash as an escape).

Checked on master: saving > quote keeps the title > quote with no display type (frontend.handler.db-based.editor/wrap-parse-block); quote-content in logseq.common.export.file writes a quote block as > lines; mldoc parses - > quote as an empty heading and a Quote.

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 Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.