Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e626ccd

Browse files
committed
[ html ] Support syntax errors
1 parent 1aa31a1 commit e626ccd

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/rs/pest/livePreview/html.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,14 @@ private fun PRE.render(highlights: Array<Pair<Color?, String>?>, chars: CharArra
5252
if (highlight == null) +chars[i].toString()
5353
else {
5454
val color = highlight.first
55-
if (color == null) {
56-
TODO("highlight parse failures")
57-
} else font(color) { +chars[i].toString() }
55+
if (color == null) a {
56+
attributes["title"] = highlight.second
57+
attributes["style"] = "text-decoration: underline; text-decoration-color: red"
58+
+chars[i].toString()
59+
} else font(color) {
60+
attributes["title"] = highlight.second
61+
+chars[i].toString()
62+
}
5863
}
5964
}
6065
}

0 commit comments

Comments
 (0)