From e0d99257fed25a35d7351355fba251d5d838f188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Burak=20Kaan=20K=C3=B6se?= Date: Thu, 19 Sep 2024 01:16:42 +0200 Subject: [PATCH] Skipping unknown tags in mime visitor. --- Wino.Core/Mime/HtmlPreviewVisitor.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Wino.Core/Mime/HtmlPreviewVisitor.cs b/Wino.Core/Mime/HtmlPreviewVisitor.cs index 7c1e9029..b7763cab 100644 --- a/Wino.Core/Mime/HtmlPreviewVisitor.cs +++ b/Wino.Core/Mime/HtmlPreviewVisitor.cs @@ -185,8 +185,15 @@ namespace Wino.Core.Mime } else { - // pass the tag through to the output - ctx.WriteTag(htmlWriter, true); + if (ctx.TagId == HtmlTagId.Unknown) + { + ctx.DeleteTag = true; + ctx.DeleteEndTag = true; + } + else + { + ctx.WriteTag(htmlWriter, true); + } } }