@@ -28,6 +28,10 @@ simpleTable' :: Int
29simpleTable' n = table "" (replicate n (AlignDefault, 0.0))
29simpleTable' n = table "" (replicate n (AlignDefault, 0.0))
31+-- | Create a span for the given tag.
32+tagSpan :: String -> Inlines
33+tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) . smallcaps $ str t
31tests :: [TestTree]
35tests :: [TestTree]
33 [ testGroup "Inlines" $
37 [ testGroup "Inlines" $
@@ -729,18 +733,17 @@ tests =
729 , "* old :ARCHIVE:"
733 , "* old :ARCHIVE:"
730 , " boring"
734 , " boring"
732− let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty
733− in mconcat [ headerWith ("old", [], mempty) 1 ("old" <> tagSpan "ARCHIVE")
736+ mconcat [ headerWith ("old", [], mempty) 1
737+ ("old" <> space <> tagSpan "ARCHIVE")
734− , para "boring"
738+ , para "boring"
737 , "include archive tree header only" =:
741 , "include archive tree header only" =:
738 unlines [ "#+OPTIONS: arch:headline"
742 unlines [ "#+OPTIONS: arch:headline"
739 , "* old :ARCHIVE:"
743 , "* old :ARCHIVE:"
740 , " boring"
744 , " boring"
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")
745 , "limit headline depth" =:
748 , "limit headline depth" =:
746 unlines [ "#+OPTIONS: H:2"
749 unlines [ "#+OPTIONS: H:2"
@@ -898,17 +901,16 @@ tests =
898 , "** Call Mom :@PHONE:"
901 , "** Call Mom :@PHONE:"
899 , "** Call John :@PHONE:JOHN: "
902 , "** Call John :@PHONE:JOHN: "
901− let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty
902− in mconcat [ headerWith ("personal", [], [])
904+ mconcat [ headerWith ("personal", [], [])
904− ("Personal" <> tagSpan "PERSONAL")
906+ ("Personal " <> tagSpan "PERSONAL")
905− , headerWith ("call-mom", [], [])
907+ , headerWith ("call-mom", [], [])
907− ("Call Mom" <> tagSpan "@PHONE")
909+ ("Call Mom " <> tagSpan "@PHONE")
908− , headerWith ("call-john", [], [])
910+ , headerWith ("call-john", [], [])
910− ("Call John" <> tagSpan "@PHONE" <> tagSpan "JOHN")
912+ ("Call John " <> tagSpan "@PHONE" <> "\160" <> tagSpan "JOHN")
913 , "Untagged header containing colons" =:
915 , "Untagged header containing colons" =:
914 "* This: is not: tagged" =?>
916 "* This: is not: tagged" =?>