1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[source] Show source files after libxml++ parsing.

This commit is contained in:
Witold Filipczyk 2021-06-13 16:41:54 +02:00
parent 9328fa261e
commit 8be72ca243
5 changed files with 19 additions and 6 deletions

View File

@ -100,9 +100,6 @@
/* Define if you want: zlib support */ /* Define if you want: zlib support */
#mesondefine CONFIG_GZIP #mesondefine CONFIG_GZIP
/* Define if you want: htmlcxx support */
#mesondefine CONFIG_HTMLCXX
/* Define if you want: HTML highlighting support */ /* Define if you want: HTML highlighting support */
#mesondefine CONFIG_HTML_HIGHLIGHT #mesondefine CONFIG_HTML_HIGHLIGHT
@ -245,6 +242,9 @@
/* Define if you want: XBEL bookmarks support */ /* Define if you want: XBEL bookmarks support */
#mesondefine CONFIG_XBEL_BOOKMARKS #mesondefine CONFIG_XBEL_BOOKMARKS
/* Define if you want: libxml++ support */
#mesondefine CONFIG_XML
/* Define if you want: XmlTo support */ /* Define if you want: XmlTo support */
#mesondefine CONFIG_XMLTO #mesondefine CONFIG_XMLTO

View File

@ -6,4 +6,7 @@ if conf_data.get('CONFIG_DOM')
endif endif
subdir('html') subdir('html')
subdir('plain') subdir('plain')
if conf_data.get('CONFIG_XML')
subdir('xml')
endif
srcs += files('docdata.c', 'document.c', 'format.c', 'forms.c', 'options.c', 'refresh.c', 'renderer.c') srcs += files('docdata.c', 'document.c', 'format.c', 'forms.c', 'options.c', 'refresh.c', 'renderer.c')

View File

@ -19,6 +19,9 @@
#include "document/html/frames.h" #include "document/html/frames.h"
#include "document/html/renderer.h" #include "document/html/renderer.h"
#include "document/plain/renderer.h" #include "document/plain/renderer.h"
#ifdef CONFIG_XML
#include "document/xml/renderer.h"
#endif
#include "document/renderer.h" #include "document/renderer.h"
#include "document/view.h" #include "document/view.h"
#include "ecmascript/ecmascript.h" #include "ecmascript/ecmascript.h"
@ -247,7 +250,14 @@ render_encoded_document(struct cache_entry *cached, struct document *document)
} }
} }
} }
#ifdef CONFIG_XML
if (document->options.plain && cached->content_type
&& (!c_strcasecmp("text/html", cached->content_type)
|| !c_strcasecmp("application/xhtml+xml", cached->content_type))) {
render_source_document_cxx(cached, document, &buffer);
}
else
#endif
if (document->options.plain) { if (document->options.plain) {
#ifdef CONFIG_DOM #ifdef CONFIG_DOM
if (cached->content_type if (cached->content_type

View File

@ -60,7 +60,6 @@ static xmlpp::Document emptyDoc;
static JSObject *getDoctype(JSContext *ctx, void *node); static JSObject *getDoctype(JSContext *ctx, void *node);
static bool document_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp); static bool document_get_property(JSContext *ctx, JS::HandleObject hobj, JS::HandleId hid, JS::MutableHandleValue hvp);
static void *document_parse(struct document *document);
JSClassOps document_ops = { JSClassOps document_ops = {
JS_PropertyStub, nullptr, JS_PropertyStub, nullptr,
@ -1263,7 +1262,7 @@ document_replace(JSContext *ctx, unsigned int argc, JS::Value *vp)
return(true); return(true);
} }
static void * void *
document_parse(struct document *document) document_parse(struct document *document)
{ {
struct cache_entry *cached = document->cached; struct cache_entry *cached = document->cached;

View File

@ -7,5 +7,6 @@
extern JSClass document_class; extern JSClass document_class;
extern const spidermonkeyFunctionSpec document_funcs[]; extern const spidermonkeyFunctionSpec document_funcs[];
extern JSPropertySpec document_props[]; extern JSPropertySpec document_props[];
void *document_parse(struct document *document);
#endif #endif