Skip to content

Commit c4d47ec

Browse files
committed
Respect newlines in left-aligned mode
1 parent f535ae0 commit c4d47ec

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/mudbrick/text_block/output.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ defmodule Mudbrick.TextBlock.Output do
3737

3838
defp reduce_parts(output, %Line{parts: []}, _operator, nil) do
3939
output
40+
|> Output.add(%Apostrophe{font: output.font, text: ""})
4041
end
4142

4243
defp reduce_parts(output, %Line{parts: [part]}, _operator, nil) do

test/mudbrick/text_block_test.exs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ defmodule Mudbrick.TextBlockTest do
6161
"400 500 Td",
6262
"0 0 0 rg",
6363
"<014C010F0116011D01B700ED00D900F400C0> Tj",
64+
"() '",
6465
"<011600C000B500FC00F400BB01B700ED00D900F400C0> '",
66+
"() '",
6567
"ET"
6668
] =
6769
output(fn font, _, _ ->
@@ -73,6 +75,7 @@ defmodule Mudbrick.TextBlockTest do
7375
)
7476
|> TextBlock.write("""
7577
first line
78+
7679
second line
7780
""")
7881
end)

0 commit comments

Comments
 (0)