aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorwillj-dev <94586033+willj-dev@users.noreply.github.com>2021-11-18 17:33:57 -0800
committerGitHub <noreply@github.com>2021-11-18 17:33:57 -0800
commit005dc7ce56a4a165fa9af239cc28a2589f7b169d (patch)
tree08c83231128127f1b6729519d2d35d99ded89940 /test
parent3e5af46471477cc7b006a8ef1cbcd9b182f6fa43 (diff)
downloadpandoc-005dc7ce56a4a165fa9af239cc28a2589f7b169d.tar.gz
RST reader: handle class attribute for for custom roles (#7700)
Previously the class attribute was ignored, and the name of the role used as the class. Closes #7699.
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Readers/RST.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Tests/Readers/RST.hs b/test/Tests/Readers/RST.hs
index a12b59fc2..e9ab8cc11 100644
--- a/test/Tests/Readers/RST.hs
+++ b/test/Tests/Readers/RST.hs
@@ -179,6 +179,15 @@ tests = [ "line block with blank line" =:
, "custom code role with language field"
=: ".. role:: lhs(code)\n :language: haskell\n\n:lhs:`a`"
=?> para (codeWith ("", ["lhs", "haskell"], []) "a")
+ , "custom role with class field"
+ =: ".. role:: classy\n :class: myclass\n\n:classy:`a`"
+ =?> para (spanWith ("", ["myclass"], []) "a")
+ , "custom role with class field containing multiple whitespace-separated classes"
+ =: ".. role:: classy\n :class: myclass1 myclass2\n myclass3\n\n:classy:`a`"
+ =?> para (spanWith ("", ["myclass1", "myclass2", "myclass3"], []) "a")
+ , "custom role with inherited class field"
+ =: ".. role:: classy\n :class: myclass1\n.. role:: classier(classy)\n :class: myclass2\n\n:classier:`a`"
+ =?> para (spanWith ("", ["myclass2", "myclass1"], []) "a")
, "custom role with unspecified parent role"
=: ".. role:: classy\n\n:classy:`text`"
=?> para (spanWith ("", ["classy"], []) "text")