@@ -28,6 +28,10 @@ simpleTable' :: Int
2828 -> Blocks
2929simpleTable' n = table "" (replicate n (AlignDefault, 0.0))
3030
31+-- | Create a span for the given tag.
32+tagSpan :: String -> Inlines
33+tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) . smallcaps $ str t
34+
3135tests :: [TestTree]
3236tests =
3337 [ testGroup "Inlines" $
@@ -729,18 +733,17 @@ tests =
729733 , "* old :ARCHIVE:"
730734 , " boring"
731735 ] =?>
732− let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty
733− in mconcat [ headerWith ("old", [], mempty) 1 ("old" <> tagSpan "ARCHIVE")
734− , para "boring"
735− ]
736+ mconcat [ headerWith ("old", [], mempty) 1
737+ ("old" <> space <> tagSpan "ARCHIVE")
738+ , para "boring"
739+ ]
736740
737741 , "include archive tree header only" =:
738742 unlines [ "#+OPTIONS: arch:headline"
739743 , "* old :ARCHIVE:"
740744 , " boring"
741745 ] =?>
742− let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty
743− in headerWith ("old", [], mempty) 1 ("old" <> tagSpan "ARCHIVE")
746+ headerWith ("old", [], mempty) 1 ("old" <> space <> tagSpan "ARCHIVE")
744747
745748 , "limit headline depth" =:
746749 unlines [ "#+OPTIONS: H:2"
@@ -898,17 +901,16 @@ tests =
898901 , "** Call Mom :@PHONE:"
899902 , "** Call John :@PHONE:JOHN: "
900903 ] =?>
901− let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty
902− in mconcat [ headerWith ("personal", [], [])
903− 1
904− ("Personal" <> tagSpan "PERSONAL")
905− , headerWith ("call-mom", [], [])
906− 2
907− ("Call Mom" <> tagSpan "@PHONE")
908− , headerWith ("call-john", [], [])
909− 2
910− ("Call John" <> tagSpan "@PHONE" <> tagSpan "JOHN")
911− ]
904+ mconcat [ headerWith ("personal", [], [])
905+ 1
906+ ("Personal " <> tagSpan "PERSONAL")
907+ , headerWith ("call-mom", [], [])
908+ 2
909+ ("Call Mom " <> tagSpan "@PHONE")
910+ , headerWith ("call-john", [], [])
911+ 2
912+ ("Call John " <> tagSpan "@PHONE" <> "\160" <> tagSpan "JOHN")
913+ ]
912914
913915 , "Untagged header containing colons" =:
914916 "* This: is not: tagged" =?>