1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00

[xml] dump_document_structure in header file

This commit is contained in:
Witold Filipczyk 2021-07-15 15:42:40 +02:00
parent f1d89f7340
commit 33fc1beefd
3 changed files with 15 additions and 2 deletions

View File

@ -218,9 +218,11 @@ element:
#define HTML_MAX_DOM_STRUCTURE_DEPTH 1024 #define HTML_MAX_DOM_STRUCTURE_DEPTH 1024
static bool bool
dump_dom_structure(struct source_renderer *renderer, xmlpp::Node *node, int depth) dump_dom_structure(struct source_renderer *renderer, void *nod, int depth)
{ {
xmlpp::Node *node = nod;
if (depth >= HTML_MAX_DOM_STRUCTURE_DEPTH) { if (depth >= HTML_MAX_DOM_STRUCTURE_DEPTH) {
return false; return false;
} }

View File

@ -9,6 +9,7 @@ struct cache_entry;
struct document; struct document;
struct string; struct string;
bool dump_dom_structure(struct source_renderer *renderer, void *nod, int depth);
void render_xhtml_document(struct cache_entry *cached, struct document *document, struct string *buffer); void render_xhtml_document(struct cache_entry *cached, struct document *document, struct string *buffer);

View File

@ -27,6 +27,7 @@
#include "document/html/renderer.h" #include "document/html/renderer.h"
#include "document/html/tables.h" #include "document/html/tables.h"
#include "document/options.h" #include "document/options.h"
#include "document/xml/renderer2.h"
#include "document/xml/tables.h" #include "document/xml/tables.h"
#include "document/xml/tags.h" #include "document/xml/tags.h"
#include "globhist/globhist.h" #include "globhist/globhist.h"
@ -826,6 +827,15 @@ static void
tags_draw_table_bad_html(struct source_renderer *renderer, struct table *table) tags_draw_table_bad_html(struct source_renderer *renderer, struct table *table)
{ {
struct html_context *html_context = renderer->html_context; struct html_context *html_context = renderer->html_context;
int i;
for (i = 0; i < table->bad_html_size; i++) {
struct html_start_end *html = &table->bad_html[i];
void *start_node = html->start_node;
void *end_node = html->end_node;
dump_dom_structure(renderer, start_node, 0);
}
} }
void void