File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1418,7 +1418,11 @@ export class PugPrinter {
14181418 }
14191419
14201420 private slash ( token : SlashToken ) : string {
1421- return '/' ;
1421+ let result : string = '/' ;
1422+ if ( this . nextToken ?. type === 'text' ) {
1423+ result += ' ' ;
1424+ }
1425+ return result ;
14221426 }
14231427
14241428 //#endregion
Original file line number Diff line number Diff line change 1+ span Text
2+ br/ more text
3+
4+ div
5+ span Text
6+ br/ more text with very long text text text text text text text text text text
7+ br/ and even more text text text text text text text text text text text text
8+
9+ span Lorem ipsum dolor sit amet, consectetur adipisicing elit.
10+ | Laudantium laborum quod harum fuga ipsum est voluptates assumenda commodi,
11+ br/ nihil dolores recusandae nobis labore
12+ | minus nostrum cumque eum sit similique!
13+ br/
14+ br/ Molestiae! Lorem ipsum dolor sit amet, consectetur adipisicing elit.
15+ br/
16+ | Laudantium laborum quod harum fuga ipsum.
Original file line number Diff line number Diff line change 1+ import { readFileSync } from 'fs' ;
2+ import { resolve } from 'path' ;
3+ import { format } from 'prettier' ;
4+ import { plugin } from './../../../src/index' ;
5+
6+ describe ( 'Issues' , ( ) => {
7+ test ( 'should handle autocloseable tag with trailing text correctly' , ( ) => {
8+ const expected : string = readFileSync ( resolve ( __dirname , 'formatted.pug' ) , 'utf8' ) ;
9+ const code : string = readFileSync ( resolve ( __dirname , 'unformatted.pug' ) , 'utf8' ) ;
10+ const actual : string = format ( code , { parser : 'pug' , plugins : [ plugin ] } ) ;
11+
12+ expect ( actual ) . toBe ( expected ) ;
13+ } ) ;
14+ } ) ;
Original file line number Diff line number Diff line change 1+ span Text
2+ br/ more text
3+
4+ div
5+ span Text
6+ br/ more text with very long text text text text text text text text text text
7+ br/ and even more text text text text text text text text text text text text
8+
9+ span Lorem ipsum dolor sit amet, consectetur adipisicing elit.
10+ | Laudantium laborum quod harum fuga ipsum est voluptates assumenda commodi,
11+ br/ nihil dolores recusandae nobis labore
12+ | minus nostrum cumque eum sit similique!
13+ br/
14+ br/ Molestiae! Lorem ipsum dolor sit amet, consectetur adipisicing elit.
15+ br/
16+ | Laudantium laborum quod harum fuga ipsum.
You can’t perform that action at this time.
0 commit comments