bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20859: 25.0.50; css-mode: Comments within URIs


From: Simen Heggestøyl
Subject: bug#20859: 25.0.50; css-mode: Comments within URIs
Date: Sat, 22 Aug 2015 10:19:12 +0200

On Sat, Aug 22, 2015 at 6:04 AM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
The question was not whether the regexp works, but what does the CSS language want us to do. I.e. is "url(foo)bar)" equivalent to "url('foo)bar')" or to "url('foo')bar)"?

Ah, good that you asked, because the CSS spec states the following:

  Some characters appearing in an unquoted URI, such as parentheses,
  white space characters, single quotes (') and double quotes ("),
  must be escaped with a backslash so that the resulting URI value is
  a URI token: '\(', '\)'.

So in "url(foo)bar)", the URI ends at the first ")", while in
"url(foo\)bar)", it ends at the last ")".

The following regexp seems to handle this:

"url\\((\\)[[:space:]]*\\(?:\\\\.\\|[^()[:space:]\n'\"]\\)+[[:space:]]*\\()\\)"

-- Simen

reply via email to

[Prev in Thread] Current Thread [Next in Thread]