mirror of
https://github.com/rkd77/elinks.git
synced 2024-09-06 23:44:43 -04:00
[xml] Some fixes related to scripts
This commit is contained in:
parent
c34a7d6658
commit
ada4ebd842
@ -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);
|
||||||
|
@ -302,10 +302,16 @@ 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 {
|
} else {
|
||||||
auto element = dynamic_cast<xmlpp::Element*>(node);
|
const auto cDataNode = dynamic_cast<const xmlpp::CdataNode*>(node);
|
||||||
|
|
||||||
if (element) {
|
if (cDataNode) {
|
||||||
dump_element(mapa, buf, element);
|
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)
|
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,
|
||||||
|
Loading…
Reference in New Issue
Block a user