commit 9269534: [Minor] Ignore virtual tags

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Jul 1 13:14:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-07-01 14:06:50 +0100
URL: https://github.com/rspamd/rspamd/commit/9269534f198b690a36bece5d429b4ea84e873de1 (HEAD -> master)

[Minor] Ignore virtual tags

---
 src/libserver/html/html.cxx | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/libserver/html/html.cxx b/src/libserver/html/html.cxx
index d5b58a7d4..6cd5aa246 100644
--- a/src/libserver/html/html.cxx
+++ b/src/libserver/html/html.cxx
@@ -1786,10 +1786,14 @@ html_debug_structure(const html_content &hc) -> std::string
 	if (hc.root_tag) {
 		auto rec_functor = [&](const html_tag *t, int level, auto rec_functor) -> void {
 			std::string pluses(level, '+');
-			output += fmt::format("{}{};", pluses,
-					html_tags_defs.name_by_id_safe(t->id));
+
+			if (!(t->flags & (FL_VIRTUAL|FL_IGNORE))) {
+				output += fmt::format("{}{};", pluses,
+						html_tags_defs.name_by_id_safe(t->id));
+				level ++;
+			}
 			for (const auto *cld : t->children) {
-				rec_functor(cld, level + 1, rec_functor);
+				rec_functor(cld, level, rec_functor);
 			}
 		};
 


More information about the Commits mailing list