Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All comments are syntax errors #33

Open
LJNeon opened this issue Jun 30, 2020 · 0 comments
Open

All comments are syntax errors #33

LJNeon opened this issue Jun 30, 2020 · 0 comments
Assignees
Labels

Comments

@LJNeon
Copy link

LJNeon commented Jun 30, 2020

New lines at the end of any comment cause an immediate error due to false flagging as control characters. This makes use of any comments impossible. This problem doesn't occur in v2.2.5, only in v3.0.0.

TomlError: Control characters (codes < 0x1f and 0x7f) are not allowed in comment
s, use \u000d instead at row 3, col 5, pos 22:
2: yea = 2
3> # ye
       ^
@iarna iarna self-assigned this Jul 5, 2020
@iarna iarna added the bug label Jul 5, 2020
petebacondarwin added a commit to petebacondarwin/wrangler2 that referenced this issue May 9, 2022
The TOML parser that Wrangler uses crashes if there is a Windows line-ending in a comment.
See iarna/iarna-toml#33.

According to the TOML spec, we should be able to normalize line-endings as we see fit.
See https://toml.io/en/v1.0.0#:~:text=normalize%20newline%20to%20whatever%20makes%20sense.

This change normalizes line-endings of TOML strings before parsing to avoid hitting this bug.

Fixes cloudflare#915
threepointone pushed a commit to cloudflare/workers-sdk that referenced this issue May 9, 2022
The TOML parser that Wrangler uses crashes if there is a Windows line-ending in a comment.
See iarna/iarna-toml#33.

According to the TOML spec, we should be able to normalize line-endings as we see fit.
See https://toml.io/en/v1.0.0#:~:text=normalize%20newline%20to%20whatever%20makes%20sense.

This change normalizes line-endings of TOML strings before parsing to avoid hitting this bug.

Fixes #915
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants