From 285dd6b7f3f0345559bacef8749e22b9a7c1072f Mon Sep 17 00:00:00 2001 From: Artyom Kazak Date: Sun, 11 Aug 2019 17:06:02 +0300 Subject: [PATCH] Don't use 'show' on Markdown (#368) --- back/src/Guide/Database/Types.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/back/src/Guide/Database/Types.hs b/back/src/Guide/Database/Types.hs index 6c7c748..0624ab1 100644 --- a/back/src/Guide/Database/Types.hs +++ b/back/src/Guide/Database/Types.hs @@ -32,7 +32,7 @@ import Imports import Named -import Guide.Markdown (toMarkdownBlock, toMarkdownTree, toMarkdownInline) +import Guide.Markdown (toMarkdownBlock, toMarkdownTree, toMarkdownInline, markdownBlockSource, markdownTreeSource, markdownInlineSource) import Guide.Types.Core (Category (..), CategoryStatus, Item (..), ItemSection, Trait (..), TraitType) import Guide.Utils (Uid (..), makeClassWithLenses, fields) @@ -142,7 +142,7 @@ categoryToRowCategory $(fields 'Category) = CategoryRow , categoryRowCreated = categoryCreated , categoryRowGroup = categoryGroup , categoryRowStatus = categoryStatus - , categoryRowNotes = toText $ show categoryNotes -- TODO fix! + , categoryRowNotes = markdownBlockSource categoryNotes , categoryRowEnabledSections = categoryEnabledSections , categoryRowItemsOrder = map itemUid categoryItems } @@ -193,9 +193,9 @@ itemToRowItem catId (arg #deleted -> deleted) $(fields 'Item) = ItemRow , itemRowCreated = itemCreated , itemRowLink = itemLink , itemRowHackage = itemHackage - , itemRowSummary = toText $ show itemSummary -- TODO fix - , itemRowEcosystem = toText $ show itemEcosystem -- TODO fix - , itemRowNotes = toText $ show itemNotes -- TODO fix + , itemRowSummary = markdownBlockSource itemSummary + , itemRowEcosystem = markdownBlockSource itemEcosystem + , itemRowNotes = markdownTreeSource itemNotes , itemRowDeleted = deleted , itemRowCategoryUid = catId , itemRowProsOrder = map traitUid itemPros @@ -222,7 +222,7 @@ traitToTraitRow traitToTraitRow itemId (arg #deleted -> deleted) traitType $(fields 'Trait) = TraitRow { traitRowUid = traitUid - , traitRowContent = toText $ show traitContent -- TODO fix + , traitRowContent = markdownInlineSource traitContent , traitRowDeleted = deleted , traitRowType = traitType , traitRowItemUid = itemId