kotlin-playground-wp-plugin
kotlin-playground-wp-plugin copied to clipboard
Line if (index < binaryToSignal.size) { deactivates WP plugin
Hi, I am playing with the WP plugin at the moment and I stumbled upon the following problem:
I paste this into WP:
object HandshakeCalculator {
fun calculateHandshake(number: Int): List<Signal> {
val binaryToSignal = Signal.values().asList()
val binaryString = number.toString(2)
var result = mutableListOf<Signal>()
binaryString.reversed().forEachIndexed { index, item ->
if (item == '1') {
if (index < binaryToSignal.size) {
result.add(binaryToSignal[index])
}
}
}
return if (binaryString.reversed().getOrNull(4) == '1') result.reversed() else result
}
}
and it does not open the playground editor on the corresponding WP site. but just shows the code as regular WP-text.
If you remove the line
if (index < binaryToSignal.size) {
everything works as intended
It is actually the < sign. you can test it using:
[kotlin]![/kotlin] // works
[kotlin]<[/kotlin] // breaks the editor