1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-12 23:10:51 +00: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);
else
#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
#endif
render_html_document(cached, document, &buffer);

View File

@ -302,10 +302,16 @@ walk_tree(std::map<int, xmlpp::Element *> *mapa, struct string *buf, void *nod,
if (textNode) {
add_bytes_to_string(buf, textNode->get_content().c_str(), textNode->get_content().length());
} else {
auto element = dynamic_cast<xmlpp::Element*>(node);
const auto cDataNode = dynamic_cast<const xmlpp::CdataNode*>(node);
if (element) {
dump_element(mapa, buf, element);
if (cDataNode) {
add_bytes_to_string(buf, cDataNode->get_content().c_str(), cDataNode->get_content().length());
} else {
auto element = dynamic_cast<xmlpp::Element*>(node);
if (element) {
dump_element(mapa, buf, element);
}
}
}
}
@ -332,7 +338,7 @@ void
render_xhtml_document(struct cache_entry *cached, struct document *document, struct string *buffer)
{
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->cp,
&document->cp_status,