unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Simen Heggestøyl" <simenheg@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 20859@debbugs.gnu.org
Subject: bug#20859: 25.0.50; css-mode: Comments within URIs
Date: Sat, 22 Aug 2015 10:19:12 +0200	[thread overview]
Message-ID: <1440231552.15556.0@smtp.gmail.com> (raw)
In-Reply-To: <jwvoai02coj.fsf-monnier+emacsbugs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 804 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1112 bytes --]

  reply	other threads:[~2015-08-22  8:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-20 15:04 bug#20859: 25.0.50; css-mode: Comments within URIs Simen Heggestøyl
2015-06-21 17:38 ` Simen Heggestøyl
2015-06-22 15:54   ` Stefan Monnier
2015-06-22  1:13 ` Stefan Monnier
2015-08-21 21:08   ` Simen Heggestøyl
2015-08-22  4:04     ` Stefan Monnier
2015-08-22  8:19       ` Simen Heggestøyl [this message]
2015-08-22 14:47         ` Stefan Monnier
2015-08-22 17:21           ` Simen Heggestøyl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440231552.15556.0@smtp.gmail.com \
    --to=simenheg@gmail.com \
    --cc=20859@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).