mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
[libdom] scan_http_equiv in libdom renderer. Refs #249
This commit is contained in:
parent
450eda0283
commit
4ef70a1cfa
@ -13,6 +13,7 @@
|
||||
#include "cache/cache.h"
|
||||
#include "document/document.h"
|
||||
#include "document/renderer.h"
|
||||
#include "document/html/parser/parse.h"
|
||||
#include "document/html/renderer.h"
|
||||
#include "document/libdom/corestrings.h"
|
||||
#include "document/libdom/doc.h"
|
||||
@ -247,13 +248,22 @@ render_xhtml_document(struct cache_entry *cached, struct document *document, str
|
||||
initialised = 1;
|
||||
}
|
||||
|
||||
if (!document->dom && !cached->head && buffer && buffer->source) {
|
||||
struct string head;
|
||||
|
||||
if (init_string(&head)) {
|
||||
scan_http_equiv(buffer->source, buffer->source + buffer->length, &head, NULL, document->cp);
|
||||
mem_free_set(&cached->head, head.source);
|
||||
}
|
||||
}
|
||||
|
||||
if (!document->dom) {
|
||||
(void)get_convert_table(cached->head ?: (char *)"", document->options.cp,
|
||||
(void)get_convert_table(cached->head ?: (char *)"", document->options.cp,
|
||||
document->options.assume_cp,
|
||||
&document->cp,
|
||||
&document->cp_status,
|
||||
document->options.hard_assume);
|
||||
|
||||
memset(buffer, 0, sizeof(*buffer));
|
||||
document->dom = document_parse(document);
|
||||
}
|
||||
|
||||
|
@ -298,8 +298,6 @@ render_encoded_document(struct cache_entry *cached, struct document *document)
|
||||
if (encoding != ENCODING_NONE) {
|
||||
done_string(&buffer);
|
||||
encoding = ENCODING_NONE;
|
||||
} else {
|
||||
memset(&buffer, 0, sizeof(buffer));
|
||||
}
|
||||
render_xhtml_document(cached, document, &buffer);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user