File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ export class _Tokenizer {
156156 blockquote ( src : string ) : Tokens . Blockquote | undefined {
157157 const cap = this . rules . block . blockquote . exec ( src ) ;
158158 if ( cap ) {
159- const text = cap [ 0 ] . replace ( / ^ * > [ \t ] ? / gm, '' ) ;
159+ const text = rtrim ( cap [ 0 ] . replace ( / ^ * > [ \t ] ? / gm, '' ) , '\n ') ;
160160 const top = this . lexer . state . top ;
161161 this . lexer . state . top = true ;
162162 const tokens = this . lexer . blockTokens ( text ) ;
Original file line number Diff line number Diff line change @@ -382,6 +382,27 @@ a | b
382382 } ) ;
383383 } ) ;
384384
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+
385406 it ( 'paragraph token in list' , ( ) => {
386407 expectTokens ( {
387408 md : '- > blockquote' ,
You can’t perform that action at this time.
0 commit comments