diff options
author | Daniel Bergey <bergey@alum.mit.edu> | 2014-12-11 18:50:24 +0000 |
---|---|---|
committer | Daniel Bergey <bergey@alum.mit.edu> | 2014-12-12 14:45:45 +0000 |
commit | 689fb112bf925ce5394f88b48066be8abdc7fc34 (patch) | |
tree | dc8a04e12269d7057e8ad7a940a7ceb5bc9551bb /tests | |
parent | 4e040160e0fce94a07e7ab5b4c5aebcf627ff1f6 (diff) | |
download | pandoc-689fb112bf925ce5394f88b48066be8abdc7fc34.tar.gz |
RST Reader: compute Attrs when role is defined
Move recursive role lookup from renderRole to addNewRole. The Attr value
will be the same for every occurance of this role, so there's no reason
to compute it every time. This allows simplifying the
stateRstCustomRoles map considerably.
We could go even further, and remove the fmt and attr arguments to
renderRole, which are null except for custom roles.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Tests/Readers/RST.hs | 2 | ||||
-rw-r--r-- | tests/rst-reader.native | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/Tests/Readers/RST.hs b/tests/Tests/Readers/RST.hs index 9d5a8425b..1aaf4897f 100644 --- a/tests/Tests/Readers/RST.hs +++ b/tests/Tests/Readers/RST.hs @@ -99,7 +99,7 @@ tests = [ "line block with blank line" =: =?> para (codeWith ("", ["codeLike", "sourceCode"], []) "a") , "custom code role with language field" =: ".. role:: lhs(code)\n :language: haskell\n\n:lhs:`a`" - =?> para (codeWith ("", ["sourceCode", "haskell", "lhs"], []) "a") + =?> para (codeWith ("", ["lhs", "haskell","sourceCode"], []) "a") , "custom role with unspecified parent role" =: ".. role:: classy\n\n:classy:`text`" =?> para (spanWith ("", ["classy"], []) "text") diff --git a/tests/rst-reader.native b/tests/rst-reader.native index 5d0c4faac..1f402f835 100644 --- a/tests/rst-reader.native +++ b/tests/rst-reader.native @@ -322,12 +322,12 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa ,Null ,Para [Str "And",Space,Str "now",Space,Str "with",Space,RawInline (Format "html") "<b>inline</b> <span id=\"test\">HTML</span>",Str "."] ,Null -,Para [Str "And",Space,Str "some",Space,Str "inline",Space,Str "haskell",Space,Code ("",["sourceCode","haskell"],[]) "fmap id [1,2..10]",Str "."] +,Para [Str "And",Space,Str "some",Space,Str "inline",Space,Str "haskell",Space,Code ("",["haskell","sourceCode"],[]) "fmap id [1,2..10]",Str "."] ,Null ,Null -,Para [Str "Indirect",Space,Str "python",Space,Str "role",Space,Code ("",["sourceCode","python","indirect"],[]) "[x*x for x in [1,2,3,4,5]]",Str "."] +,Para [Str "Indirect",Space,Str "python",Space,Str "role",Space,Code ("",["python","indirect","sourceCode"],[]) "[x*x for x in [1,2,3,4,5]]",Str "."] ,Null ,Null -,Para [Str "Different",Space,Str "indirect",Space,Str "C",Space,Code ("",["sourceCode","c","different-indirect"],[]) "int x = 15;",Str "."] +,Para [Str "Different",Space,Str "indirect",Space,Str "C",Space,Code ("",["c","different-indirect","sourceCode"],[]) "int x = 15;",Str "."] ,Header 2 ("literal-symbols",[],[]) [Str "Literal",Space,Str "symbols"] ,Para [Str "2*2",Space,Str "=",Space,Str "4*1"]] |