From 813debec5d342da9d05c1291187e494e6d01eb44 Mon Sep 17 00:00:00 2001 From: Pingu Date: Sat, 29 Oct 2022 11:57:43 +0200 Subject: [PATCH] Fixed issues in show for Info and better example --- app/Main.hs | 18 +++++++++--------- example text.org | 2 ++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/Main.hs b/app/Main.hs index 6655efb..6415fa2 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -27,15 +27,15 @@ data Info = instance Show Info where show :: Info -> String show info = case info of - Bread text -> text - List texts -> "[LIST]" ++ concatMap ((++) "[*] " . show) texts ++ "[/LIST]" - Header text -> "[TITLE]" ++ text ++ "[/TITLE]" - Subheader text -> "[SIZE=4]" ++ text ++ "[/SIZE]" - Subsubheader text -> "[SIZE=2]" ++ text ++ "[/SIZE]" - Image (URL url) -> "[IMG]" ++ url ++ "[/IMG]" - Video (URL url) -> "[VIDEO]" ++ url ++ "[/VIDEO]" - Link (URL url) inf -> "[URL=\"" ++ url ++ "\"]" ++ show inf ++ "[/IMG]" - Spoiler inf -> "[SPOILER]" ++ concatMap show inf ++ "[/SPOILER]" + Bread text -> text ++ "\n" + List texts -> "[LIST]" ++ concatMap ((++) "[*] " . show) texts ++ "[/LIST]\n" + Header text -> "[TITLE]" ++ text ++ "[/TITLE]\n" + Subheader text -> "[SIZE=4]" ++ text ++ "[/SIZE]\n" + Subsubheader text -> "[SIZE=2]" ++ text ++ "[/SIZE]\n" + Image (URL url) -> "[IMG]" ++ url ++ "[/IMG]\n" + Video (URL url) -> "[VIDEO]" ++ url ++ "[/VIDEO]\n" + Link (URL url) inf -> "[URL=\"" ++ url ++ "\"]" ++ show inf ++ "[/URL]\n" + Spoiler inf -> "[SPOILER]" ++ concatMap show inf ++ "[/SPOILER]\n" newtype Post = Post [Info] diff --git a/example text.org b/example text.org index 7cb2e50..f675dbe 100644 --- a/example text.org +++ b/example text.org @@ -3,7 +3,9 @@ * Hello there - Zeus has been scummy - Wisdom is just flopping around +So based on this we should just kill Ikka #+Begin [[https://media.discordapp.net/attachments/866979075360555033/1019126077542629436/Tumblr_l_204100096696723.jpg]] +sdas #+end