Skip to content

fix(corpus): preserve exact Trusov projection line endings at template EOF #436

Closed

Description

@andy-zen-dev

Reproducible correctness gap

scriptorium.robinson_trusov_projection.project_page currently sets ending = "\r\n" if line.endswith("\r\n") else "\n". A standalone {{heading|4|...}} or {{nop}} at the end of a Page with no terminal newline, or with a lone CR, therefore gains a synthetic LF. This alters source-free projected hashes/character counts; it must be distinguished from the explicitly documented one-LF between Pages.

Acceptance

  • Preserve the original per-line terminator verbatim for LF, CRLF, lone CR and absent terminal newline; never silently invent an end-of-Page LF.
  • Add positive and negative regressions for standalone heading/nop, ordinary prose/unsupported inline templates, and the fail-closed empty projected Page case.
  • Maintain the original exact-source preflight and VAR diagnostic behavior and the existing no-prose-publication boundary. Do not claim a verified historical render, book body, >=300k count or FantLab parity.
  • Run focused tests and applicable hosted checks; merge only after later independent exact-head acceptance.

Activity

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