Discussion:
domain_props and hyphens
Bastien Dejean
2011-11-08 21:28:12 UTC
Permalink
Hi,

I have a certain number of custom CSS triggered by the domain_props
mechanisms and all of them except one work.

I just realized that the one who fails is the only one to contain an
hyphen...

So, how can I properly match 'www.foo-bar.com'?

Greetings,
--
Bastien
l***@rottenrei.be
2011-11-09 11:13:46 UTC
Permalink
Hi Bastien,
Post by Bastien Dejean
Hi,
I have a certain number of custom CSS triggered by the domain_props
mechanisms and all of them except one work.
I just realized that the one who fails is the only one to contain an
hyphen...
So, how can I properly match 'www.foo-bar.com'?
Lua regular expressions treat `-` specially, see:
http://lua-users.org/wiki/PatternsTutorial
To escape it, use `%-` instead.

Cheers!
Post by Bastien Dejean
Greetings,
--
Bastien
_______________________________________________
luakit-dev mailing list
http://lists.luakit.org/mailman/listinfo/luakit-dev
--
Start using GPG! (http://www.gnupg.org/)
Bastien Dejean
2011-11-09 13:04:55 UTC
Permalink
Post by l***@rottenrei.be
Post by Bastien Dejean
So, how can I properly match 'www.foo-bar.com'?
http://lua-users.org/wiki/PatternsTutorial
To escape it, use `%-` instead.
Unfortunately, it doesn't work.
--
Bastien
l***@rottenrei.be
2011-11-09 13:25:03 UTC
Permalink
Post by Bastien Dejean
Post by l***@rottenrei.be
Post by Bastien Dejean
So, how can I properly match 'www.foo-bar.com'?
http://lua-users.org/wiki/PatternsTutorial
To escape it, use `%-` instead.
Unfortunately, it doesn't work.
Unfortunately, I can't debug your problem if you don't describe it...
Post by Bastien Dejean
--
Bastien
--
Start using GPG! (http://www.gnupg.org/)
Bastien Dejean
2011-11-09 15:01:49 UTC
Permalink
Post by l***@rottenrei.be
Post by Bastien Dejean
Post by l***@rottenrei.be
Post by Bastien Dejean
So, how can I properly match 'www.foo-bar.com'?
http://lua-users.org/wiki/PatternsTutorial
To escape it, use `%-` instead.
Unfortunately, it doesn't work.
Unfortunately, I can't debug your problem if you don't describe it...
Steps to reproduce:

In globals.lua:

domain_props = {
["haw%-lin.com"] = {
user_stylesheet_uri = "file://" .. luakit.data_dir .. "/styles/hawlin.css",
},
}

And hawlin.css is just:

* {
display: none;
}

Navigate to:

http://haw-lin.com/

The CSS isn't applied.
--
Bastien
l***@rottenrei.be
2011-11-09 16:31:21 UTC
Permalink
Hi Bastien,
Post by Bastien Dejean
Post by l***@rottenrei.be
Post by Bastien Dejean
Post by l***@rottenrei.be
Post by Bastien Dejean
So, how can I properly match 'www.foo-bar.com'?
http://lua-users.org/wiki/PatternsTutorial
To escape it, use `%-` instead.
Unfortunately, it doesn't work.
Unfortunately, I can't debug your problem if you don't describe it...
domain_props = {
["haw%-lin.com"] = {
user_stylesheet_uri = "file://" .. luakit.data_dir .. "/styles/hawlin.css",
},
}
So I looked at the code and it seems it's not a regular expression after
all. It's just part of the hostname.

What works for me is simply

domain_props = {
["haw-lin.com"] = {
user_stylesheet_uri = "file://" .. luakit.data_dir .. "/styles/hawlin.css",
},
}


So the problem must be with your CSS file or maybe some typo.

Cheers!
Post by Bastien Dejean
* {
display: none;
}
http://haw-lin.com/
The CSS isn't applied.
--
Bastien
--
Start using GPG! (http://www.gnupg.org/)
Bastien Dejean
2011-11-09 17:09:51 UTC
Permalink
Post by l***@rottenrei.be
So the problem must be with your CSS file or maybe some typo.
I found the problem: I was using 'www.foo-bar.com' and the 'www' segment
is obviously not part of the domain name... silly me.

Thanks,
--
Bastien
Loading...