File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
main/kotlin/org/jetbrains/kotlinx/dataframe/io
test/kotlin/org/jetbrains/kotlinx/dataframe/rendering Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -261,7 +261,7 @@ internal fun String.escapeHTML(): String {
261
261
val str = this
262
262
return buildString {
263
263
for (c in str) {
264
- if (c.code > 127 || c == ' "' || c == ' \' ' || c == ' <' || c == ' >' || c == ' &' ) {
264
+ if (c.code > 127 || c == ' "' || c == ' \' ' || c == ' <' || c == ' >' || c == ' &' || c == ' \\ ' ) {
265
265
append(" &#" )
266
266
append(c.code)
267
267
append(' ;' )
Original file line number Diff line number Diff line change @@ -56,6 +56,13 @@ class RenderingTests {
56
56
html shouldContain " <Air France>"
57
57
}
58
58
59
+ @Test
60
+ fun unicodeEscapeSequencesAreEscaped () {
61
+ val df = dataFrameOf(" content" )(""" Hello\nfrom \x and \y""" )
62
+ val html = df.toHTML().toString()
63
+ html shouldContain " Hello\nfrom \x and \y"
64
+ }
65
+
59
66
@Test
60
67
fun `long text is trimmed without escaping` () {
61
68
val df = dataFrameOf(" text" )(" asdfkjasdlkjfhasljkddasdasdasdasdasdasdhf" )
You can’t perform that action at this time.
0 commit comments