1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-02 08:57:19 -04:00

[xml] Some fixes related to scripts

This commit is contained in:
Witold Filipczyk 2022-11-10 16:01:32 +01:00
parent c34a7d6658
commit ada4ebd842
2 changed files with 11 additions and 5 deletions

View File

@ -294,7 +294,7 @@ render_encoded_document(struct cache_entry *cached, struct document *document)
render_gemini_document(cached, document, &buffer); render_gemini_document(cached, document, &buffer);
else else
#if defined(CONFIG_XML) && defined(CONFIG_ECMASCRIPT) #if defined(CONFIG_XML) && defined(CONFIG_ECMASCRIPT)
if (true) render_xhtml_document(cached, document, NULL); if (get_opt_bool("ecmascript.enable", NULL)) render_xhtml_document(cached, document, NULL);
else else
#endif #endif
render_html_document(cached, document, &buffer); render_html_document(cached, document, &buffer);

View File

@ -301,6 +301,11 @@ walk_tree(std::map<int, xmlpp::Element *> *mapa, struct string *buf, void *nod,
if (textNode) { if (textNode) {
add_bytes_to_string(buf, textNode->get_content().c_str(), textNode->get_content().length()); add_bytes_to_string(buf, textNode->get_content().c_str(), textNode->get_content().length());
} else {
const auto cDataNode = dynamic_cast<const xmlpp::CdataNode*>(node);
if (cDataNode) {
add_bytes_to_string(buf, cDataNode->get_content().c_str(), cDataNode->get_content().length());
} else { } else {
auto element = dynamic_cast<xmlpp::Element*>(node); auto element = dynamic_cast<xmlpp::Element*>(node);
@ -309,6 +314,7 @@ walk_tree(std::map<int, xmlpp::Element *> *mapa, struct string *buf, void *nod,
} }
} }
} }
}
auto childs = node->get_children(); auto childs = node->get_children();
auto it = childs.begin(); auto it = childs.begin();
@ -332,7 +338,7 @@ void
render_xhtml_document(struct cache_entry *cached, struct document *document, struct string *buffer) render_xhtml_document(struct cache_entry *cached, struct document *document, struct string *buffer)
{ {
if (!document->dom) { if (!document->dom) {
(void)get_convert_table(cached->head, document->options.cp, (void)get_convert_table(cached->head ?: "", document->options.cp,
document->options.assume_cp, document->options.assume_cp,
&document->cp, &document->cp,
&document->cp_status, &document->cp_status,