Skip to content

fix(parser): accept CRLF line endings in ||| text blocks - #898

Open
vulragrag-star wants to merge 1 commit into
google:masterfrom
vulragrag-star:fix/786-text-block-crlf
Open

vulragrag-star wants to merge 1 commit into
google:masterfrom
vulragrag-star:fix/786-text-block-crlf

Conversation

@vulragrag-star

Copy link
Copy Markdown

Summary

Text blocks (|||…|||) failed to parse when the input used CRLF line endings: a blank line inside the block left a leading \r that broke the indent check and surfaced as Text block not terminated with |||. That matches the Windows / grafonnet report in #786 (also reproducible on Linux with CRLF input).

Treat \r\n as a single line terminator in the text-block lexer path and normalize recorded newlines to \n, so LF and CRLF inputs produce the same string value.

Test plan

Fixes #786

Blank-line detection in text blocks only looked for '\n', so a CRLF
blank line left a leading '\r' that failed the indent check and
reported "Text block not terminated with |||". Treat '\r\n' as a
single line terminator and normalize recorded newlines to '\n'.

Fixes google#786.
@google-cla

google-cla Bot commented Sep 18, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@vulragrag-star

Copy link
Copy Markdown
Author

I signed the CLA.

This branch has not been deployed

No deployments
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.

go-jsonnet windows version is not compatible with grafonnet

1 participant