File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,4 +18,8 @@ defmodule Mudbrick.TextBlock.Line do
1818 def wrap ( text , opts ) do
1919 % __MODULE__ { parts: [ Part . wrap ( text , opts ) ] }
2020 end
21+
22+ def text ( line ) do
23+ Enum . map_join ( line . parts , "" , & & 1 . text )
24+ end
2125end
Original file line number Diff line number Diff line change @@ -58,23 +58,19 @@ defmodule Mudbrick.TextBlock.Output do
5858
5959 alias Mudbrick.TextBlock.Output
6060
61- defp text ( line ) do
62- Enum . map_join ( line . parts , "" , & & 1 . text )
63- end
64-
6561 def reduce_lines ( output , [ line ] , measure ) do
6662 output
6763 |> Output . end_block ( )
6864 |> reduce_parts ( line )
69- |> measure . ( text ( line ) , 1 )
65+ |> measure . ( Line . text ( line ) , 1 )
7066 |> Output . start_block ( )
7167 end
7268
7369 def reduce_lines ( output , [ line | lines ] , measure ) do
7470 output
7571 |> Output . end_block ( )
7672 |> reduce_parts ( line )
77- |> measure . ( text ( line ) , length ( lines ) + 1 )
73+ |> measure . ( Line . text ( line ) , length ( lines ) + 1 )
7874 |> Output . start_block ( )
7975 |> reduce_lines ( lines , measure )
8076 end
You can’t perform that action at this time.
0 commit comments