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

Multiline data URIs break CSS highlighting pretty badly #134642

Closed
LeaVerou opened this issue Oct 8, 2021 · 3 comments
Closed

Multiline data URIs break CSS highlighting pretty badly #134642

LeaVerou opened this issue Oct 8, 2021 · 3 comments
Assignees
Labels
grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@LeaVerou
Copy link

LeaVerou commented Oct 8, 2021

Steps to Reproduce:

  1. Open a new tab and set language to CSS
  2. Paste the code below:
select {
	padding-right: 1.5rem;
	background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 50">\
	<path d="m 20 10 L 50 40 L 80 10" fill="none" stroke="black" stroke-opacity=".4" stroke-width="13" stroke-linejoin="round" stroke-linecap="round" /></svg>');
	background-position: calc(100% + 1rem) 55%;
	background-size: auto .4rem;
	background-repeat: no-repeat;
	background-origin: content-box;
}

Result in VS Code:
image

Everything after the data URI is highlighted incorrectly, even subsequent rules.

Oddly enough, if I use the SCSS language definition for the same code, it works fine:
image

Result in Atom:
image

@alexr00
Copy link
Member

alexr00 commented Oct 28, 2021

Upstream issue: atom/language-css#181

@alexr00 alexr00 closed this as completed Oct 28, 2021
@alexr00 alexr00 added grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream labels Oct 28, 2021
@LeaVerou
Copy link
Author

LeaVerou commented Oct 28, 2021

Thanks for triaging! I don't understand how it can be a problem with Atom given that multiline strings work (on my end at least!) in Atom?

@alexr00
Copy link
Member

alexr00 commented Oct 28, 2021

My understanding is that Atom doesn't use textmate grammars anymore, so even though that's an atom repo they are not using the same syntax highlighting mechanism.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

3 participants