Skip to content

Dedent list items when quoting them into fields - #65

Merged
peterbjohnson merged 2 commits into
devfrom
wb/t36
Sep 20, 2026
Merged

peterbjohnson merged 2 commits into
devfrom
wb/t36

Conversation

@peterbjohnson

Copy link
Copy Markdown
Member

Running the agent on a real sheet (PHYS40002 PS9) shows a field quoted from a list-item block keeps the markdown's continuation indent: q1.text is "A person walks ... from the centre\n to the edge of a horizontal ...". The spec's strip pattern removes the "1. " marker from the first line only. Four leading spaces after a blank line render as a code block in Lambda Feedback, and every line of the field carries whitespace the author never wrote.

When a field is quoted from the source - by spec run, question add, part add or question solution - the block's own indentation should come off every line uniformly: the list marker's width from the first line and the same number of spaces from the continuation lines, as commonmark itself reads a list item. The provenance ranges stay the source lines; only the value is dedented. Done when the spec and draft fixtures whose sources hold list items have dedented expected values, and a field quoted from a nested list dedents by its own depth.


Workbench ticket t36.

@peterbjohnson
peterbjohnson merged commit 500facc into dev Sep 20, 2026
2 of 6 checks passed
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.

1 participant