Tcl Library Source Code

View Ticket
Login
Ticket UUID: a23348be0bf07e4ad10cea592d7ff64c56fe319d
Title: ::yaml::_parsePlainScalarInBlock only parses the first 5 lines of a plain scalar
Type: Bug Version:
Submitter: apnadkarni Created on: 2026-05-22 10:22:06
Subsystem: yaml Assigned To: nobody
Priority: 5 Medium Severity: Important
Status: Open Last Modified: 2026-05-22 10:22:06
Resolution: None Closed By: nobody
    Closed on:
Description:
(Moved from the Tcl repository [31cdc84bd2](https://core.tcl-lang.org/tcl/tktview/31cdc84bd2).

This commit appears to have inadvertently added a debug break that causes ::yaml::_parsePlainScalarInBlock to stop after the fifth line of a plain multi-line scalar:
https://core.tcl-lang.org/tcllib/info/fc59390525aeda7e

The bad code:
proc ::yaml::_parsePlainScalarInBlock {base {loop 0}} {
    if {$loop == 5} { return }

The code appears to still be present in the current git:
https://core.tcl-lang.org/tcllib/blame?filename=modules/yaml/yaml.tcl&checkin=5be206c63f7681c9

I think the tests may have strings short enough not to expose the bug.

Example testcase:
% set str {my_thing:
  one
  two
  three
  four
  five
  six}
% puts [::yaml::yaml2dict $str]
my_thing {one two three four five}