diff --git a/hledger-web/templates/journal.hamlet b/hledger-web/templates/journal.hamlet
index d5bbcfe23..cf5114b1b 100644
--- a/hledger-web/templates/journal.hamlet
+++ b/hledger-web/templates/journal.hamlet
@@ -38,8 +38,9 @@ $if elem AddPermission perms
#{tagName}
-
- #{tagValue}
+ $if not $ T.null $ T.strip tagValue
+
+ #{tagValue}
$forall Posting { paccount = acc, pamount = amt, ptags = tags } <- tpostings torig
@@ -57,8 +58,9 @@ $if elem AddPermission perms
-
#{tagName}
-
- #{tagValue}
+ $if not $ T.null $ T.strip tagValue
+
+ #{tagValue}
$if elem AddPermission perms
^{addModal AddR j today}