Skip to content

[pull] master from nodeca:master - #28

Merged
pull[bot] merged 4 commits into
threatcode:masterfrom
nodeca:master
Aug 1, 2026
Merged

[pull] master from nodeca:master#28
pull[bot] merged 4 commits into
threatcode:masterfrom
nodeca:master

Conversation

@pull

@pull pull Bot commented Aug 1, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

gaoflow and others added 4 commits August 1, 2026 07:53
…ted (#780)

YAML 1.2.2 8.1.3 defines a more-indented ("spaced text") line by production
[175] s-nb-spaced-text, whose leading [33] s-white is a space *or a tab*; the
breaks around such a line are preserved verbatim ([177] b-l-spaced) rather than
folded. getBlockValue() in the parser already tests for both (0x20 or 0x09),
but the presenter tested only for a space, at four sites in foldBlockScalar()
and foldLine(). It therefore doubled breaks the parser keeps literally, adding
one \n per adjacency:

  parseEvents/eventsToAst/present of

    k: >
      <TAB>
      detected

  emitted a blank line before "detected", so the value went from
  "\t\ndetected\n" to "\t\n\ndetected\n". A tab line between two folded lines
  cost two extra \n.

Extract the predicate as isMoreIndented() and use it for the prevMoreIndented
seed, the per-line test and the foldLine guard; the fold-point regexp becomes
/ [^ \t]/ so a break is never placed before a tab either (breaking at the space
in "aaa... \tzzz" moved the tab to the start of the next line).

Enumerating every two-line block-scalar body over a 7-line alphabet in both
block styles gave 84 parseable sources: 12 changed value through
present(), all folded style, all involving a tab; literal style was clean
(0/42). All 12 were confirmed against PyYAML 6.0.3 and ruamel.yaml 0.19.1
reading the emitted bytes, and all 12 round-trip after this change. The public
dump() API never enters this path (it quotes tab-containing strings), so it was
unaffected before and after.
@pull pull Bot locked and limited conversation to collaborators Aug 1, 2026
@pull pull Bot added the ⤵️ pull label Aug 1, 2026
@pull
pull Bot merged commit 6740445 into threatcode:master Aug 1, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants