File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -545,6 +545,7 @@ Lexer.prototype = {
545545 interpolated : true ,
546546 startingLine : this . lineno ,
547547 startingColumn : this . colno ,
548+ plugins : this . plugins ,
548549 } ) ;
549550 var interpolated ;
550551 try {
Original file line number Diff line number Diff line change 1+ const pug = require ( '../' ) ;
2+
3+ test ( '#3295 - lexer plugins should be used in tag interpolation' , ( ) => {
4+ const lex = {
5+ advance ( lexer ) {
6+ if ( '~' === lexer . input . charAt ( 0 ) ) {
7+ lexer . tokens . push ( lexer . tok ( 'text' , 'twiddle-dee-dee' ) ) ;
8+ lexer . consume ( 1 ) ;
9+ lexer . incrementColumn ( 1 ) ;
10+ return true ;
11+ }
12+ } ,
13+ } ;
14+ const input = 'p Look at #[~]' ;
15+ const expected = '<p>Look at twiddle-dee-dee</p>' ;
16+ const output = pug . render ( input , { plugins : [ { lex} ] } ) ;
17+ expect ( output ) . toEqual ( expected ) ;
18+ } ) ;
You can’t perform that action at this time.
0 commit comments