From 389ce178148b53a1ce5cf90f5e9ea1f4c58424bd Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Fri, 6 Mar 2015 18:36:01 +0100 Subject: [PATCH] add attr to dbg_show_node --- src/tidylib.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/tidylib.c b/src/tidylib.c index 4b15a43..d369362 100755 --- a/src/tidylib.c +++ b/src/tidylib.c @@ -1564,6 +1564,7 @@ const char *dbg_get_element_name( void *vp ) void dbg_show_node( TidyDocImpl* doc, Node *node, int caller, int indent ) { + AttVal* av; ctmbstr call = ""; ctmbstr name = dbg_get_element_name(node); ctmbstr type = dbg_get_lexer_type(node); @@ -1577,9 +1578,19 @@ void dbg_show_node( TidyDocImpl* doc, Node *node, int caller, int indent ) while (indent--) SPRTF(" "); if (strcmp(type,name)) - SPRTF("%s %s %s %s\n", type, name, impl, call ); + SPRTF("%s %s %s %s", type, name, impl, call ); else - SPRTF("%s %s %s\n", name, impl, call ); + SPRTF("%s %s %s", name, impl, call ); + for (av = node->attributes; av; av = av->next) { + name = av->attribute; + if (name) { + SPRTF(" %s",name); + if (av->value) { + SPRTF("=\"%s\"", av->value); + } + } + } + SPRTF("\n"); } void dbg_show_all_nodes( TidyDocImpl* doc, Node *node, int indent )