4
// FIXME: kill this ugliness when we have a proper CSS parser
6
// Functions as per 4.3.4 of CSS 2.1
7
// http://www.w3.org/TR/CSS21/syndata.html#uri
8
gchar *extract_uri( gchar const *s, gchar const** endptr )
15
if ( strlen(sb) < 4 || strncmp(sb, "url", 3) != 0 ) {
25
// This first whitespace technically is not allowed.
26
// Just left in for now for legacy behavior.
27
while ( ( *sb == ' ' ) ||
35
while ( ( *sb == ' ' ) ||
42
if ( (*sb == '\'' || *sb == '"') ) {
46
gchar const* se = sb + 1;
47
while ( *se && (*se != delim) ) {
51
// we found the delimiter
58
// back up for any trailing whitespace
60
while ( ( se[-1] == ' ' ) ||
66
result = g_strndup(sb, se - sb + 1);
68
gchar const* tail = se + 1;
69
while ( ( *tail == ' ' ) ||
78
result = g_strndup(sb, se - sb);
90
c-file-style:"stroustrup"
91
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
96
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :