Exclude already wrapped paragraphs from <p> wrapping
- Allows `paragraph \n header \n paragraph` - Allows `paragraph \n list \n paragraph`
This commit is contained in:
+1
-1
@@ -16,7 +16,7 @@ fill_template_pretemplated = fn template -> &fill_template.(template, &1) end
|
|||||||
wrapInParagraphs = fn content -> content
|
wrapInParagraphs = fn content -> content
|
||||||
|> String.split("\\n")
|
|> String.split("\\n")
|
||||||
|> Enum.reject(fn(x) -> x == "" end)
|
|> Enum.reject(fn(x) -> x == "" end)
|
||||||
|> Enum.map(fn paragraph -> "<p>" <> paragraph <> "</p>" end)
|
|> Enum.map(fn paragraph -> if String.starts_with?(paragraph, "<") do paragraph else "<p>" <> paragraph <> "</p>" end end)
|
||||||
|> Enum.join("")
|
|> Enum.join("")
|
||||||
end
|
end
|
||||||
post_contents_custom = File.ls!("./posts_custom")
|
post_contents_custom = File.ls!("./posts_custom")
|
||||||
|
|||||||
Reference in New Issue
Block a user