Skip to content

Commit 46de2f9

Browse files
Automated commit of generated code
1 parent b013aa6 commit 46de2f9

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

core/generated-sources/src/test/kotlin/org/jetbrains/kotlinx/dataframe/explainer/PluginCallbackProxy.kt

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -314,29 +314,29 @@ private fun convertToDescription(dataframeLike: Any): String =
314314
else -> throw IllegalArgumentException("Unsupported type: ${dataframeLike::class}")
315315
}.escapeHtmlForIFrame()
316316

317-
internal fun String.escapeHtmlForIFrame(): String {
318-
val str = this
319-
return buildString {
320-
for (c in str) {
321-
when {
322-
c.code > 127 || c == '\'' || c == '\\' -> {
323-
append("&#")
324-
append(c.code)
325-
append(';')
326-
}
317+
internal fun String.escapeHtmlForIFrame(): String =
318+
buildString {
319+
for (c in this@escapeHtmlForIFrame) {
320+
when (c) {
321+
'<' -> append("&lt;")
322+
323+
'>' -> append("&gt;")
327324

328-
c == '"' -> append("&quot;")
325+
'&' -> append("&amp;")
329326

330-
c == '<' -> append("&amp;lt;")
327+
'"' -> append("&quot;")
331328

332-
c == '>' -> append("&amp;gt;")
329+
'\'' -> append("&#39;")
333330

334-
c == '&' -> append("&amp;")
331+
'\\' -> append("&#92;")
335332

336333
else -> {
337-
append(c)
334+
if (c.code > 127) {
335+
append("&#${c.code};")
336+
} else {
337+
append(c)
338+
}
338339
}
339340
}
340341
}
341342
}
342-
}

0 commit comments

Comments
 (0)