Skip to content

[HTML] Exclude prototypes from attribute value starts #2910

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

Conversation

deathaxe
Copy link
Collaborator

@deathaxe deathaxe commented Jul 22, 2021

This commit adds some meta_include_prototype: false rules to attribute value contexts, which may contain unquoted values.

Without this rule any ordinary prototype context can be injected between assignment operator and beginning of an unquoted value. As a result the unquoted value starts after this injected context is popped or doesn't match anything anymore.

What we want is to first push into unquoted-value context and than let inherited syntaxes apply normal string interpolation to maintain proper value boundaries.

Note: It's hard to test without a inheriting syntax at hand.

It is discussed at https://discord.com/channels/280102180189634562/280157067396775936/867802732482920458

Created a Gist with an example at https://gist.github.com/deathaxe/dabcd7575951174d08882b46842dd44a

If contexts in HTML BUGFIX section are commented out highlighting fails in combination with ST 4113.

This commit adds some `meta_include_prototype: false` rules to attribute
value contexts, which may contain unquoted values.

Without this rule any ordinary `prototype` context can be injected between assignment operator and beginning of an unquoted value. As a result the unquoted value starts after this injected context is popped or doesn't match anything anymore.

What we want is to first push into unquoted-value context and than let
inherited syntaxes apply normal string interpolation to maintain proper
value boundaries.

Note: It's hard to test without a inheriting syntax at hand.
@deathaxe deathaxe merged commit fe582c5 into sublimehq:master Aug 19, 2021
@deathaxe deathaxe deleted the pr/html/fix-unquoted-attrib-value-interpolation branch August 19, 2021 08:05
mitranim pushed a commit to mitranim/Packages that referenced this pull request Mar 25, 2022
This commit adds some `meta_include_prototype: false` rules to attribute
value contexts, which may contain unquoted values.

Without this rule any ordinary `prototype` context can be injected between
assignment operator and beginning of an unquoted value. As a result the
unquoted value starts after this injected context is popped or doesn't
match anything anymore.

What we want is to first push into unquoted-value context and than let
inherited syntaxes apply normal string interpolation to maintain proper
value boundaries.

Note: It's hard to test without a inheriting syntax at hand.
skyronic pushed a commit to vuejs/vue-syntax-highlight that referenced this pull request Feb 1, 2023
This commit fixes sublimehq/Packages#2910 for
all ST builds before 4114.
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

Successfully merging this pull request may close these issues.

3 participants