Skip to content

ENG-2326 Indent every line of a multi-line Roam block in Roam's markdown output - #1487

Open
maparent wants to merge 1 commit into
mainfrom
eng-2326-indent-every-line-of-a-multi-line-roam-block-to-its-list
Open

maparent wants to merge 1 commit into
mainfrom
eng-2326-indent-every-line-of-a-multi-line-roam-block-to-its-list

Conversation

@maparent

@maparent maparent commented Sep 27, 2026 •

Copy link
Copy Markdown
Collaborator

https://entire.io/gh/DiscourseGraphs/discourse-graph/trails/27

Verification

Unit tests.
Loom shows both the failure and correction.

Loom video

These Looms cover every runtime consumer of toMarkdown and pageToMarkdown. There are three: publishing the full variant (which the Roam and Obsidian imports read), the Markdown export, and the JSON-LD export. The PDF export also calls toMarkdown, but in a mode this change skips. Every export entry point (command palette, query results, discourse context export, share dialog) goes through the same export callbacks.

Core case: publish, then import through the database. Shows both the failure and the fix.
https://www.loom.com/share/df5bf844af784dfe8986596d1cb39027
(first loom, as is.)

Discourse Graphs Markdown export, imported back with Roam's own Markdown import. Roam's import doesn't handle the YAML frontmatter the export adds, which is unrelated to this change. There is no file-based Discourse Graphs import to test instead: the "Import Discourse Graph" dialog (ImportDialog.tsx) is not opened from anywhere, and it only reads the JSON export, which does not call toMarkdown.
https://www.loom.com/share/c9b58b3329db402b841aa7617d475471

JSON-LD export: node content now uses CommonMark list indentation. Its only consumer today is Matt's AI tooling, which should handle CommonMark.
https://www.loom.com/share/31bb53bdc4214da2bc9d5ff297132584

PDF export: fails with a connection error, on main as well, so fixing it is out of scope here. It renders in document view with flatten, which this change leaves alone. The unit tests "leaves continuation lines alone when flattening" and "…in the document view type" cover that.
https://www.loom.com/share/3307b5d977614cdfbef373d7d4819e5b

Scope check

  • Ran $scope-check against the ENG ticket and final diff.
  • Scope beyond Done When: None

Standards check

  • Ran $dg-pr-adherence-check against the final diff and PR metadata.

Nit: I renamed the linear task to be more terse after the branch got its name.

Local delegated full review

  • Ran a comprehensive review of the entire final diff in a subagent with a fresh context. Use $dg-delegated-full-review when no other full-review workflow is available.

What passed

  • PR title: it matches the Linear ticket title exactly.
  • Size: 25 lines of production code across 2 files, well under the targets.
  • Code: the new helper indentContinuationLines has an explicit return type and takes named parameters, following the style guide. The comment explains a CommonMark rule a maintainer would otherwise miss. There are no leftover imports or debug logging.
  • Tests: they cover a nested multi-line block with a code block, the flatten case and the document case, which are the tests the ticket asks for. There's also a numbered-list case. They run under the existing test:unit script, and I ran them locally at this head: 5 of 5 pass.
  • CI: all checks are green on this head, including validate, which runs ci:validate.
  • PR body: it keeps the template headings and drops the optional Reviewer brief. It includes a Loom link, and the Scope check and Local delegated full review are both ticked.
  • Scope: the change covers every Done When item and matches the ticket's Solution, including skipping flatten and the document view type.

https://linear.app/discourse-graphs/issue/ENG-2326/indent-every-line-of-a-multi-line-roam-block-in-roams-markdown-output


Devin Review

@vercel

vercel Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
discourse-graph Skipped Skipped Sep 29, 2026 11:17am UTC

Request Review

@linear-code

linear-code Bot commented Sep 27, 2026

Copy link
Copy Markdown

ENG-2326

@supabase

supabase Bot commented Sep 27, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project zytfjzqyijgagqxrzbmz because there are no changes detected in packages/database/supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@devin-ai-integration devin-ai-integration Bot 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.

🔍 Devin Review: 2 flags

Not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

@maparent
maparent force-pushed the eng-2326-indent-every-line-of-a-multi-line-roam-block-to-its-list branch from f682c5a to 613583b Compare September 28, 2026 02:26

@mdroidian mdroidian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could you please add a loom video testing other consumers of pageToMarkdown to make sure that this change does not add regressions, eg: Markdown export, PDF Export, Publishing/Importing Roam to Roam.

Copy link
Copy Markdown
Collaborator Author

Makes sense. Will work on that tomorrow. Is that an exhaustive list?

Copy link
Copy Markdown
Member

I don't believe so

@maparent
maparent force-pushed the eng-2326-indent-every-line-of-a-multi-line-roam-block-to-its-list branch from 613583b to dcd71b7 Compare September 29, 2026 11:17
@maparent
maparent requested a review from mdroidian September 29, 2026 15:32

This branch was previously deployed

1 inactive deployment
Preview — dcd71b74 Deployed Sep 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants