;journal: in generated-transaction:/posting: tags, add a space before the value

This commit is contained in:
Simon Michael 2019-10-01 20:30:31 -10:00
parent 40c089dcfc
commit 6dcddadd9f
7 changed files with 98 additions and 96 deletions

View File

@ -372,6 +372,7 @@ commentJoin c1 c2
| otherwise = c1 <> ", " <> c2
-- | Add a tag to a comment, comma-separated from any prior content.
-- A space is inserted following the colon, before the value.
commentAddTag :: Text -> Tag -> Text
commentAddTag c (t,v)
| T.null c' = tag
@ -381,6 +382,7 @@ commentAddTag c (t,v)
tag = t <> ": " <> v
-- | Add a tag on its own line to a comment, preserving any prior content.
-- A space is inserted following the colon, before the value.
commentAddTagNextLine :: Text -> Tag -> Text
commentAddTagNextLine cmt (t,v) =
cmt <> if "\n" `T.isSuffixOf` cmt then "" else "\n" <> t <> ": " <> v