private fun scanPlainSpaces(): String? { var length = 0 while (reader.peek(length) === ' ' || reader.peek(length) === '\t') { length++ } val whitespaces: String = reader.prefixForward(length) val lineBreak: String = scanLineBreak() if (lineBreak.length != 0) { this.allowSimpleKey = true var prefix: String = reader.prefix(3) if ("---" == prefix || "..." == prefix && Constant.NULL_BL_T_LINEBR.has(reader.peek(3))) { return "" } val breaks = StringBuilder() while (true) { if (reader.peek() === ' ') { reader.forward() } else { val lb: String = scanLineBreak() if (lb.length != 0) { breaks.append(lb) prefix = reader.prefix(3) if ("---" == prefix || "..." == prefix && Constant.NULL_BL_T_LINEBR.has( reader.peek(3) ) ) { return "" } } else { break } } } if ("\n" != lineBreak) { return lineBreak + breaks } else if (breaks.length == 0) { return " " } return breaks.toString() } return whitespaces }
See the specification for details . SnakeYAML and libyaml allow tabs inside plain scalar