File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ export class ParseContext {
135135 const noIndicatorAsIndent =
136136 parent . type === Type . SEQ_ITEM && parent . context . atLineStart
137137 if (
138+ src [ inEnd ] !== '#' &&
138139 ! Node . nextNodeIsIndented ( src [ inEnd ] , indentDiff , ! noIndicatorAsIndent )
139140 )
140141 break
Original file line number Diff line number Diff line change @@ -488,6 +488,20 @@ key1: &default
488488 # This key ...
489489 subkey1: value1
490490
491+ key2:
492+ <<: *default\n`
493+ expect ( YAML . parse ( src , { merge : true } ) ) . toMatchObject ( {
494+ key1 : { subkey1 : 'value1' } ,
495+ key2 : { subkey1 : 'value1' }
496+ } )
497+ } )
498+
499+ test ( 'reported 3' , ( ) => {
500+ const src = `
501+ key1: &default
502+ # This key ...
503+ subkey1: value1
504+
491505key2:
492506 <<: *default\n`
493507 expect ( YAML . parse ( src , { merge : true } ) ) . toMatchObject ( {
You can’t perform that action at this time.
0 commit comments