mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Improve (or rather fix) how document types are matched in the DOM renderer
This commit is contained in:
parent
9e7d920663
commit
6e24450bdf
@ -687,11 +687,21 @@ render_dom_document(struct cache_entry *cached, struct document *document,
|
||||
|
||||
document->bgcolor = document->options.default_bg;
|
||||
|
||||
if (cached->content_type
|
||||
&& !strlcasecmp("application/rss+xml", 19, cached->content_type, -1))
|
||||
if (!strcasecmp("application/rss+xml", cached->content_type)) {
|
||||
doctype = SGML_DOCTYPE_RSS;
|
||||
else
|
||||
|
||||
} else if (!strcasecmp("application/xbel+xml", cached->content_type)
|
||||
|| !strcasecmp("application/x-xbel", cached->content_type)
|
||||
|| !strcasecmp("application/xbel", cached->content_type)) {
|
||||
doctype = SGML_DOCTYPE_XBEL;
|
||||
|
||||
} else {
|
||||
assertm(!strcasecmp("text/html", cached->content_type)
|
||||
|| !strcasecmp("application/xhtml+xml", cached->content_type),
|
||||
"Couldn't resolve doctype '%s'", cached->content_type);
|
||||
|
||||
doctype = SGML_DOCTYPE_HTML;
|
||||
}
|
||||
|
||||
parser = init_sgml_parser(SGML_PARSER_STREAM, doctype, &uri);
|
||||
if (!parser) return;
|
||||
|
Loading…
Reference in New Issue
Block a user