Skip to content

Commit

Permalink
Respect newlines in left-aligned mode
Browse files Browse the repository at this point in the history
  • Loading branch information
camelpunch committed Oct 28, 2024
1 parent f535ae0 commit c4d47ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/mudbrick/text_block/output.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ defmodule Mudbrick.TextBlock.Output do

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

defp reduce_parts(output, %Line{parts: [part]}, _operator, nil) do
Expand Down
3 changes: 3 additions & 0 deletions test/mudbrick/text_block_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ defmodule Mudbrick.TextBlockTest do
"400 500 Td",
"0 0 0 rg",
"<014C010F0116011D01B700ED00D900F400C0> Tj",
"() '",
"<011600C000B500FC00F400BB01B700ED00D900F400C0> '",
"() '",
"ET"
] =
output(fn font, _, _ ->
Expand All @@ -73,6 +75,7 @@ defmodule Mudbrick.TextBlockTest do
)
|> TextBlock.write("""
first line
second line
""")
end)
Expand Down

0 comments on commit c4d47ec

Please sign in to comment.