File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -127,11 +127,15 @@ impl MathRow {
127
127
TIGHT_LEADING . scaled ( ctx)
128
128
} ;
129
129
130
- let rows: Vec < _ > = fragments
130
+ let mut rows: Vec < _ > = fragments
131
131
. split ( |frag| matches ! ( frag, MathFragment :: Linebreak ) )
132
132
. map ( |slice| Self ( slice. to_vec ( ) ) )
133
133
. collect ( ) ;
134
134
135
+ if matches ! ( rows. last( ) , Some ( row) if row. 0 . is_empty( ) ) {
136
+ rows. pop ( ) ;
137
+ }
138
+
135
139
let width = rows. iter ( ) . map ( |row| row. width ( ) ) . max ( ) . unwrap_or_default ( ) ;
136
140
let points = alignments ( & rows) ;
137
141
let mut frame = Frame :: new ( Size :: zero ( ) ) ;
Original file line number Diff line number Diff line change @@ -33,3 +33,24 @@ $ "abc" &= c \
33
33
---
34
34
// Test multiline subscript.
35
35
$ sum_(n in NN \ n <= 5) n = (5(5+1))/2 = 15 $
36
+
37
+ ---
38
+ // Test no trailing line break.
39
+ $
40
+ "abc" & = c
41
+ $
42
+ No trailing line break.
43
+
44
+ ---
45
+ // Test single trailing line break.
46
+ $
47
+ "abc" & = c \
48
+ $
49
+ One trailing line break.
50
+
51
+ ---
52
+ // Test multiple trailing line breaks.
53
+ $
54
+ "abc" & = c \ \ \
55
+ $
56
+ Multiple trailing line breaks.
You can’t perform that action at this time.
0 commit comments