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 {
127127 TIGHT_LEADING . scaled ( ctx)
128128 } ;
129129
130- let rows: Vec < _ > = fragments
130+ let mut rows: Vec < _ > = fragments
131131 . split ( |frag| matches ! ( frag, MathFragment :: Linebreak ) )
132132 . map ( |slice| Self ( slice. to_vec ( ) ) )
133133 . collect ( ) ;
134134
135+ if matches ! ( rows. last( ) , Some ( row) if row. 0 . is_empty( ) ) {
136+ rows. pop ( ) ;
137+ }
138+
135139 let width = rows. iter ( ) . map ( |row| row. width ( ) ) . max ( ) . unwrap_or_default ( ) ;
136140 let points = alignments ( & rows) ;
137141 let mut frame = Frame :: new ( Size :: zero ( ) ) ;
Original file line number Diff line number Diff line change @@ -33,3 +33,24 @@ $ "abc" &= c \
3333---
3434// Test multiline subscript.
3535$ 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