From 005dc7ce56a4a165fa9af239cc28a2589f7b169d Mon Sep 17 00:00:00 2001 From: willj-dev <94586033+willj-dev@users.noreply.github.com> Date: Thu, 18 Nov 2021 17:33:57 -0800 Subject: 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. --- test/Tests/Readers/RST.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') 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") -- cgit v1.2.3