File tree 2 files changed +22
-1
lines changed
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ export class _Tokenizer {
156
156
blockquote ( src : string ) : Tokens . Blockquote | undefined {
157
157
const cap = this . rules . block . blockquote . exec ( src ) ;
158
158
if ( cap ) {
159
- const text = cap [ 0 ] . replace ( / ^ * > [ \t ] ? / gm, '' ) ;
159
+ const text = rtrim ( cap [ 0 ] . replace ( / ^ * > [ \t ] ? / gm, '' ) , '\n ') ;
160
160
const top = this . lexer . state . top ;
161
161
this . lexer . state . top = true ;
162
162
const tokens = this . lexer . blockTokens ( text ) ;
Original file line number Diff line number Diff line change @@ -382,6 +382,27 @@ a | b
382
382
} ) ;
383
383
} ) ;
384
384
385
+ it ( 'trim newline in text' , ( ) => {
386
+ expectTokens ( {
387
+ md : '> blockquote\n' ,
388
+ tokens : [
389
+ {
390
+ type : 'blockquote' ,
391
+ raw : '> blockquote\n' ,
392
+ text : 'blockquote' ,
393
+ tokens : [ {
394
+ type : 'paragraph' ,
395
+ raw : 'blockquote' ,
396
+ text : 'blockquote' ,
397
+ tokens : [
398
+ { type : 'text' , raw : 'blockquote' , text : 'blockquote' }
399
+ ]
400
+ } ]
401
+ }
402
+ ]
403
+ } ) ;
404
+ } ) ;
405
+
385
406
it ( 'paragraph token in list' , ( ) => {
386
407
expectTokens ( {
387
408
md : '- > blockquote' ,
You can’t perform that action at this time.
0 commit comments