diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2014-10-13 16:16:28 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2014-12-03 12:25:51 +0100 |
commit | 5cb1a29be4993d72cf6ab2af128135e2b7e40dd2 (patch) | |
tree | 30c513041af51dafd7d859664bd28922150053b3 /source/html/css-parse.c | |
parent | 9d1482bc78d72ba330c2130170b49b4e18702623 (diff) | |
download | mupdf-5cb1a29be4993d72cf6ab2af128135e2b7e40dd2.tar.xz |
html: Parse inline style attributes.
Diffstat (limited to 'source/html/css-parse.c')
-rw-r--r-- | source/html/css-parse.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/html/css-parse.c b/source/html/css-parse.c index 5f7fd254..4ceb10b5 100644 --- a/source/html/css-parse.c +++ b/source/html/css-parse.c @@ -448,14 +448,14 @@ static struct property *parse_declaration_list(struct lexbuf *buf) { struct property *p, *pp; - if (buf->lookahead == '}') + if (buf->lookahead == '}' || buf->lookahead == EOF) return NULL; pp = parse_declaration(buf); while (accept(buf, ';')) { - if (buf->lookahead != '}' && buf->lookahead != ';') + if (buf->lookahead != '}' && buf->lookahead != ';' && buf->lookahead != EOF) { p = parse_declaration(buf); p->next = pp; @@ -725,6 +725,14 @@ static struct rule *parse_stylesheet(struct lexbuf *buf, struct rule *chain) return chain; } +struct property *fz_parse_css_properties(fz_context *ctx, const char *source) +{ + struct lexbuf buf; + css_lex_init(ctx, &buf, source); + next(&buf); + return parse_declaration_list(&buf); +} + struct rule *fz_parse_css(fz_context *ctx, struct rule *chain, const char *source) { struct lexbuf buf; |