diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2015-05-20 18:01:03 +0200 |
---|---|---|
committer | Albert Krewinkel <albert@zeitkraut.de> | 2015-05-23 14:06:32 +0200 |
commit | d8e4a8bc10bfd97d81ec0166fd786742fe3a2370 (patch) | |
tree | 780064d4a76b47172af8b07d45cd5437de36734a /tests | |
parent | d5f367d04b9b7830ead3e3298aafe3987e55c697 (diff) | |
download | pandoc-d8e4a8bc10bfd97d81ec0166fd786742fe3a2370.tar.gz |
Org reader: put header tags into empty spans
Org mode allows headers to be tagged:
``` org-mode
* Headline :TAG1:TAG2:
```
Instead of being interpreted as part of the headline, the tags are now
put into the attributes of empty spans. Spans without textual content
won't be visible by default, but they are detectable by filters. They
can also be styled using CSS when written as HTML.
This fixes #2160.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Tests/Readers/Org.hs | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs index 4cec54a68..7b6773bf5 100644 --- a/tests/Tests/Readers/Org.hs +++ b/tests/Tests/Readers/Org.hs @@ -497,6 +497,21 @@ tests = , header 2 ("walk" <> space <> "dog") ] + , "Tagged headers" =: + unlines [ "* Personal :PERSONAL:" + , "** Call Mom :@PHONE:" + , "** Call John :@PHONE:JOHN: " + ] =?> + let tagSpan t = spanWith ("", ["tag"], [("data-tag-name", t)]) mempty + in mconcat [ header 1 ("Personal" <> tagSpan "PERSONAL") + , header 2 ("Call Mom" <> tagSpan "@PHONE") + , header 2 ("Call John" <> tagSpan "@PHONE" <> tagSpan "JOHN") + ] + + , "Untagged header containing colons" =: + "* This: is not: tagged" =?> + header 1 "This: is not: tagged" + , "Comment Trees" =: unlines [ "* COMMENT A comment tree" , " Not much going on here" @@ -1164,19 +1179,19 @@ tests = [ test orgSmart "quote before ellipses" ("'...hi'" =?> para (singleQuoted "…hi")) - + , test orgSmart "apostrophe before emph" ("D'oh! A l'/aide/!" =?> para ("D’oh! A l’" <> emph "aide" <> "!")) - + , test orgSmart "apostrophe in French" ("À l'arrivée de la guerre, le thème de l'«impossibilité du socialisme»" =?> para "À l’arrivée de la guerre, le thème de l’«impossibilité du socialisme»") - + , test orgSmart "Quotes cannot occur at the end of emphasized text" ("/say \"yes\"/" =?> para ("/say" <> space <> doubleQuoted "yes" <> "/")) - + , test orgSmart "Dashes are allowed at the borders of emphasis'" ("/foo---/" =?> para (emph "foo—")) |