From 28afdecec58f181cdf74d5760816368093c5d9b5 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Sat, 27 Dec 2025 16:06:13 +0900 Subject: [PATCH] improvement --- example.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example.c b/example.c index 57d3802..a009555 100644 --- a/example.c +++ b/example.c @@ -21,7 +21,7 @@ void recursive(xl_node_t* node, int indent) { a = a->next; } - printf("%s>\n", node->type == XL_NODE_PROCESS ? "?" : ""); + printf("%s%s>\n", node->type == XL_NODE_PROCESS ? "?" : "", (node->first_child == NULL && node->text == NULL) ? " /" : ""); if(node->text != NULL) { for(i = 0; i < indent + INDENT; i++) printf(" "); printf("%s\n", node->text); @@ -36,7 +36,7 @@ void recursive(xl_node_t* node, int indent) { n = n->next; } - if(node->name != NULL && node->type == XL_NODE_NODE) { + if(node->name != NULL && node->type == XL_NODE_NODE && !(node->first_child == NULL && node->text == NULL)) { for(i = 0; i < indent; i++) printf(" "); printf("\n", node->name); }