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

Partial CRLF newlines are still considered newlines #17

Open
jonstoler opened this issue Dec 9, 2017 · 0 comments
Open

Partial CRLF newlines are still considered newlines #17

jonstoler opened this issue Dec 9, 2017 · 0 comments

Comments

@jonstoler
Copy link
Owner

Due to the fact that lua-toml uses pattern-matching to find newlines, multi-character newlines can be split up and still match.

The official TOML definition of a newline is either 0x0A or 0x0D0A. Put into a pattern, this becomes [\10\13\10]. This means lua-toml will match either \10 (0x0A) or \13 (0x0D) - the second \10 is redundant.

In other words, lua-toml currently matches on \13 rather than \13\10 when looking for newlines. To fix this would require moving away from pattern matching.

I've added a new test for this behavior, which lua-toml currently fails.

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

No branches or pull requests

1 participant