Skip to content

createJsonRenderTransform: the indent of a patch line leaks into the prose #422

Open

Description

@peter-cynomi

Version: @json-render/core 0.21.0

When a patch line is indented, the transform emits the leading whitespace as prose before it starts buffering at {. The prose then carries stray spaces where the patch line was.

Repro

Stream x\n {"op":"add","path":"/root","value":"report"}\ny:

  • Expected: prose x\ny and one patch.
  • Actual: prose x\n y and one patch.

Ask

Hold leading whitespace at the start of a line until the line is known not to be a patch.

Activity

  1. Jassi2004 commented on Oct 26, 2026

    @Jassi2004
    Contributor

    Opened #432 with a fix and regression coverage. Leading whitespace is held until the line is classified, so indented patch lines no longer add spaces to the prose; ordinary indentation and blank lines are preserved. Coverage includes chunk boundaries and stream closure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions