diff --git a/html/token_test.go b/html/token_test.go
index 3d20e8bce..e0b2bbb49 100644
--- a/html/token_test.go
+++ b/html/token_test.go
@@ -14,6 +14,24 @@ import (
"testing"
)
+// https://github.com/golang/go/issues/58246
+const issue58246 = ``
+const issue58246Rendered = ``
+
type tokenTest struct {
// A short description of the test case.
desc string
@@ -411,6 +429,78 @@ var tokenTests = []tokenTest{
"az",
"a$$z",
},
+ {
+ "comment23",
+ "az",
+ "a$$z",
+ },
+ {
+ "comment24",
+ "a",
+ },
+ {
+ "comment25",
+ "a",
+ },
+ {
+ "comment26",
+ "a",
+ },
+ {
+ "comment27",
+ "az",
+ "a$$z",
+ },
+ {
+ "comment28",
+ "az",
+ "a$$z",
+ },
+ {
+ "comment29",
+ "az",
+ "a$$z",
+ },
+ {
+ "comment30",
+ "az",
+ "a$$z",
+ },
+ // https://stackoverflow.design/email/base/mso/#targeting-specific-outlook-versions
+ // says "[For] Windows Outlook 2003 and above... conditional comments allow
+ // us to add bits of HTML that are only read by the Word-based versions of
+ // Outlook". TODO: these comments (with angle brackets) should pass through
+ // unchanged (by this Go package) when rendering.
+ //
+ // We should also still escape ">" as ">" when necessary.
+ // https://github.com/golang/go/issues/48237
+ //
+ // The "your code" example below comes from that stackoverflow.design link
+ // above but note that it can contain angle-bracket-rich XML.
+ // https://github.com/golang/go/issues/58246
+ {
+ "issue48237CommentWithAmpgtsemi1",
+ "az",
+ "a$$z",
+ },
+ {
+ "issue48237CommentWithAmpgtsemi2",
+ "az",
+ "a$$z",
+ },
+ {
+ "issue58246MicrosoftOutlookComment1",
+ "az",
+ "a$$z",
+ },
+ {
+ "issue58246MicrosoftOutlookComment2",
+ "a" + issue58246 + "z",
+ "a$" + issue58246Rendered + "$z",
+ },
// An attribute with a backslash.
{
"backslash",