NUglify
NUglify copied to clipboard
HtmlToText results in empty string
Describe the bug This html results in an empty string. Am I missing something? (.Net 7)
var html = """<h1><font face="Arial">Hello this is a page.</font></h1><p><font face="Arial" size="4"><br></font></p><h1><font face="Arial" size="4">Cím</font></h1><p><font face="Arial" size="4"><br></font></p><p><font face="Arial" size="4">Bekezdés</font></p>""";
var result = Uglify.HtmlToText(html, HtmlToTextOptions.None, null).Code;
Assert.Equal("", result); // this is true, should be false in my opinion
result.Errors is empty.
Excepted output code
Something like Hello this is a page. Cím Bekezdés
The html is generated by a user via a WYSIWYG editor.
This needs some investigation
Current workaround is to add <body></body> around your html fragment
+1 for same issue:
Uglify.HtmlToText("<h1>test</h1>")
returns empty Code
Pull requests welcome