File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -532,8 +532,9 @@ function readSingleQuotedScalar(state, nodeIndent) {
532
532
ch = state . input . charCodeAt ( ++ state . position ) ;
533
533
534
534
if ( ch === 0x27 /* ' */ ) {
535
- captureStart = captureEnd = state . position ;
535
+ captureStart = state . position ;
536
536
state . position ++ ;
537
+ captureEnd = state . position ;
537
538
} else {
538
539
return true ;
539
540
}
Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ var assert = require ( 'assert' ) ;
4
+ var yaml = require ( '../../' ) ;
5
+
6
+ test ( 'Loader should not strip quotes before newlines' , function ( ) {
7
+ var with_space = yaml . load ( "'''foo'' '" ) ;
8
+ var with_newline = yaml . load ( "'''foo''\n'" ) ;
9
+ assert . strictEqual ( with_space , "'foo' " ) ;
10
+ assert . strictEqual ( with_newline , "'foo' " ) ;
11
+ } ) ;
You can’t perform that action at this time.
0 commit comments