Skip to content

Commit

Permalink
Join with newlines instead of nothing
Browse files Browse the repository at this point in the history
Because, yes, line length matters 😬
  • Loading branch information
buob committed Jan 23, 2020
1 parent 5c00a3f commit fd83069
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/draft.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ defmodule Draft do
|> Map.get("blocks")
|> Enum.reduce([], &group_list_items/2)
|> Enum.map(&process_block(&1, entity_map, context))
|> Enum.join("")
|> Enum.join("\n")
end

@doc """
Expand Down
4 changes: 2 additions & 2 deletions lib/draft/block.ex
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ defmodule Draft.Block do
entity_map,
context
) do
"<ul>#{Enum.map(children, &process_block(&1, entity_map, context)) |> Enum.join("")}</ul>"
"<ul>#{Enum.map(children, &process_block(&1, entity_map, context)) |> Enum.join("\n")}</ul>"
end

def process_block(
%{"type" => "ordered-list", "data" => %{"children" => children}},
entity_map,
context
) do
"<ol>#{Enum.map(children, &process_block(&1, entity_map, context)) |> Enum.join("")}</ol>"
"<ol>#{Enum.map(children, &process_block(&1, entity_map, context)) |> Enum.join("\n")}</ol>"
end

def process_block(
Expand Down

0 comments on commit fd83069

Please sign in to comment.