File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -237,15 +237,23 @@ impl<'a> fmt::Display for WhereClause<'a> {
237237 clause. push ( ',' ) ;
238238 }
239239 }
240+
241+ if end_newline {
242+ //add a space so stripping <br> tags and breaking spaces still renders properly
243+ if f. alternate ( ) {
244+ clause. push ( ' ' ) ;
245+ } else {
246+ clause. push_str ( " " ) ;
247+ }
248+ }
249+
240250 if !f. alternate ( ) {
241251 clause. push_str ( "</span>" ) ;
242252 let padding = repeat ( " " ) . take ( indent + 4 ) . collect :: < String > ( ) ;
243253 clause = clause. replace ( "<br>" , & format ! ( "<br>{}" , padding) ) ;
244254 clause. insert_str ( 0 , & repeat ( " " ) . take ( indent. saturating_sub ( 1 ) )
245255 . collect :: < String > ( ) ) ;
246- if end_newline {
247- clause. push ( ' ' ) ;
248- } else {
256+ if !end_newline {
249257 clause. insert_str ( 0 , "<br>" ) ;
250258 }
251259 }
You can’t perform that action at this time.
0 commit comments