File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ export class Directives {
143
143
return verbatim
144
144
}
145
145
146
- const [ , handle , suffix ] = source . match ( / ^ ( .* ! ) ( [ ^ ! ] * ) $ / ) as string [ ]
146
+ const [ , handle , suffix ] = source . match ( / ^ ( .* ! ) ( [ ^ ! ] * ) $ / s ) as string [ ]
147
147
if ( ! suffix ) onError ( `The ${ source } tag has no suffix` )
148
148
const prefix = this . tags [ handle ]
149
149
if ( prefix ) {
Original file line number Diff line number Diff line change @@ -112,6 +112,12 @@ describe('tags', () => {
112
112
expect ( doc . errors ) . toHaveLength ( 1 )
113
113
expect ( doc . errors [ 0 ] . message ) . toMatch ( 'URIError' )
114
114
} )
115
+
116
+ test ( 'CR in tag shorthand (eemeli/yaml#501' , ( ) => {
117
+ const doc = parseDocument ( ': | !\r!' )
118
+ const err = doc . errors . find ( err => err . code === 'TAG_RESOLVE_FAILED' )
119
+ expect ( err ) . not . toBeFalsy ( )
120
+ } )
115
121
} )
116
122
117
123
test ( 'eemeli/yaml#97' , ( ) => {
You can’t perform that action at this time.
0 commit comments