Skip to content

Highlighting breaks on escaped double-quote #303

Open
@francislavoie

Description

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 😅

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    🐛 type/bugDescribes or resolves a bug (unintended behavior or problem)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions