Skip to content

Partial CRLF newlines are still considered newlines #17

Description

@jonstoler

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.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions