| Description: |
When a plain (unquoted) scalar spans multiple lines and a continuation
line begins with `*` (after indentation whitespace), yaml2dict treats
the `*` as a YAML alias indicator rather than literal text. This
violates YAML spec §7.3.3, which restricts alias indicators to
positions where a node is expected — not inside an already-open plain
scalar.
Minimal reproduction:
package require yaml
::yaml::yaml2dict {
items:
- key: some long text
*bold text*
other: val
}
Result:
line(5): Could not find the anchor-name(current-version,
"after refering" is not supported)
Expected: parse succeeds; key = "some long text *bold text*"
The same `*` is correctly treated as literal text when it appears:
- mid-line in a plain scalar (e.g. key: text ending *bold*)
- inside a block scalar (| or >)
- inside a quoted string (' or ")
The bug is in the _parseValue / _parseBlockLine dispatch (yaml.tcl
around line 405): upon reading a new line within a plain scalar, the
parser re-enters the top-level character switch and matches `*` as an
alias node, instead of continuing to accumulate the plain scalar value.
Python's PyYAML and Go's go-yaml parse the same input correctly.
tcllib version: 2.0 (as shipped with Debian/Ubuntu tcllib package)
Tcl version: 8.6
|