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

Lua: Incorrect extra escaping of special characters #1271

Open
mjf opened this issue Feb 28, 2025 · 0 comments
Open

Lua: Incorrect extra escaping of special characters #1271

mjf opened this issue Feb 28, 2025 · 0 comments

Comments

@mjf
Copy link

mjf commented Feb 28, 2025

This does not parse on edge build (but works in Lua 5.4+ command line):

```space-lua
function paragraphCount(text)
  return #(string.gmatch(text, '[\r\n][\r\n]+')) + 1
end
```

But this does parse - needs double backslashes to be satisfied (which means that it cannot work if parsed that way):

```space-lua
function paragraphCount(text)
  return #(string.gmatch(text, '[\\r\\n][\\r\\n]+')) + 1
end
```

The same holds for double quoted strings.

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