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

Highlighting breaks on escaped double-quote #303

Open
francislavoie opened this issue Jul 23, 2024 · 0 comments
Open

Highlighting breaks on escaped double-quote #303

francislavoie opened this issue Jul 23, 2024 · 0 comments
Labels
🐛 type/bug Describes or resolves a bug (unintended behavior or problem)

Comments

@francislavoie
Copy link
Member

francislavoie commented Jul 23, 2024

This file breaks at the \""" part on line 20

https://github.com/caddyserver/caddy/blob/3afa02ba4e5bee5628ee9334a64a0002a102a60b/caddytest/integration/caddyfile_adapt/map_and_vars_with_raw_types.caddyfiletest#L20

I realize this is kinda weird, but I think what ends up happening with this syntax is that the escaped doublequote \" gets read in as token value, then the next character being a plain " turns on the "we're in a quoted token now" and doesn't write it to the value, and finally the last " closes the "we're in a quoted token now" flag and since nothing came in between it's just an empty value. Arguably it shouldn't be allowed for a non-escaped " to follow an escaped " at the start, but that is now it behaves right now.

Also a simple \" (without the 2 extra double-quotes) also breaks highlighting, so at minimum escaped double-quotes aren't handled totally correctly.

Ultimately a very minor issue, no rush on fixing this 😅

@francislavoie francislavoie added the 🐛 type/bug Describes or resolves a bug (unintended behavior or problem) label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 type/bug Describes or resolves a bug (unintended behavior or problem)
Projects
None yet
Development

No branches or pull requests

1 participant