summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-02-05 12:04:15 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-02-08 13:22:51 +0100
commit4e30159ad7ffd59c0a15f421c3b49842badeb74d (patch)
tree51ec078fc696214ac84009fc4c4ecc8e37fc57d2
parent01751d3db388139bd77f67144203cf61ad9f04b6 (diff)
downloadmupdf-4e30159ad7ffd59c0a15f421c3b49842badeb74d.tar.xz
Add FZ_DEBUG_HTML option to EPUB parser.
-rw-r--r--source/fitz/xml.c3
-rw-r--r--source/html/html-layout.c5
2 files changed, 6 insertions, 2 deletions
diff --git a/source/fitz/xml.c b/source/fitz/xml.c
index cac3692e..b7c89cf4 100644
--- a/source/fitz/xml.c
+++ b/source/fitz/xml.c
@@ -2,6 +2,7 @@
#include <string.h>
#include <stdlib.h>
+#include <stdio.h>
static const struct { const char *ent; int ucs; } html_entities[] = {
{"nbsp",160}, {"iexcl",161}, {"cent",162}, {"pound",163},
@@ -95,7 +96,6 @@ struct fz_xml_s
fz_xml *up, *down, *tail, *prev, *next;
};
-#if 0
static void xml_indent(int n)
{
while (n--) {
@@ -152,7 +152,6 @@ void fz_debug_xml(fz_xml *item, int level)
printf(")%s\n", item->name);
}
}
-#endif
fz_xml *fz_xml_prev(fz_xml *item)
{
diff --git a/source/html/html-layout.c b/source/html/html-layout.c
index d6f63975..802b8288 100644
--- a/source/html/html-layout.c
+++ b/source/html/html-layout.c
@@ -2700,6 +2700,11 @@ fz_parse_html(fz_context *ctx, fz_html_font_set *set, fz_archive *zip, const cha
fz_rethrow(ctx);
}
+#ifndef NDEBUG
+ if (fz_atoi(getenv("FZ_DEBUG_XML")))
+ fz_debug_xml(root, 0);
+#endif
+
fz_try(ctx)
{
if (fz_xml_find(root, "FictionBook"))