Skip to content

Instantly share code, notes, and snippets.

@lexborisov
Created October 19, 2020 20:03
Show Gist options
  • Save lexborisov/fbc6260565adb6d176b9007bdf86c73d to your computer and use it in GitHub Desktop.
Save lexborisov/fbc6260565adb6d176b9007bdf86c73d to your computer and use it in GitHub Desktop.
lxb_inline lxb_status_t
serializer_callback(const lxb_char_t *data, size_t len, void *ctx)
{
printf("%.*s", (int) len, (const char *) data);
return LXB_STATUS_OK;
}
lxb_inline void
serialize_node(lxb_dom_node_t *node)
{
lxb_status_t status;
status = lxb_html_serialize_pretty_cb(node, LXB_HTML_SERIALIZE_OPT_UNDEF,
0, serializer_callback, NULL);
if (status != LXB_STATUS_OK) {
FAILED("Failed to serialization HTML tree");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment