From 8673eb079bc389f340bafd4c191c642afc7e1603 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 8 Jan 2019 11:36:33 -0800 Subject: Removed superfluous sourceCode class on code blocks. * These were added by the RST reader and, for literate Haskell, by the Markdown and LaTeX readers. There is no point to this class, and it is not applied consistently by all readers. See #5047. * Reverse order of `literate` and `haskell` classes on code blocks when parsing literate Haskell. Better if `haskell` comes first. --- test/Tests/Readers/Markdown.hs | 4 ++-- test/Tests/Readers/RST.hs | 12 ++++++------ test/command/4811.md | 2 +- test/lhs-test-markdown.native | 2 +- test/lhs-test.html | 2 +- test/lhs-test.html+lhs | 2 +- test/lhs-test.markdown | 2 +- test/lhs-test.native | 2 +- test/rst-reader.native | 8 ++++---- 9 files changed, 18 insertions(+), 18 deletions(-) (limited to 'test') diff --git a/test/Tests/Readers/Markdown.hs b/test/Tests/Readers/Markdown.hs index be89e708e..75401fb91 100644 --- a/test/Tests/Readers/Markdown.hs +++ b/test/Tests/Readers/Markdown.hs @@ -319,9 +319,9 @@ tests = [ testGroup "inline code" Ext_literate_haskell pandocExtensions }) "inverse bird tracks and html" $ "> a\n\n< b\n\n
\n" - =?> codeBlockWith ("",["sourceCode","literate","haskell"],[]) "a" + =?> codeBlockWith ("",["haskell","literate"],[]) "a" <> - codeBlockWith ("",["sourceCode","haskell"],[]) "b" + codeBlockWith ("",["haskell"],[]) "b" <> rawBlock "html" "
\n\n" ] diff --git a/test/Tests/Readers/RST.hs b/test/Tests/Readers/RST.hs index 963e7530d..d69440843 100644 --- a/test/Tests/Readers/RST.hs +++ b/test/Tests/Readers/RST.hs @@ -106,7 +106,7 @@ tests = [ "line block with blank line" =: ] =?> doc (codeBlockWith ( "" - , ["sourceCode", "python", "numberLines", "class1", "class2", "class3"] + , ["python", "numberLines", "class1", "class2", "class3"] , [ ("startFrom", "34") ] ) "def func(x):\n return y") @@ -119,7 +119,7 @@ tests = [ "line block with blank line" =: ] =?> doc (codeBlockWith ( "" - , ["sourceCode", "python", "numberLines"] + , ["python", "numberLines"] , [ ("startFrom", "") ] ) "def func(x):\n return y") @@ -164,18 +164,18 @@ tests = [ "line block with blank line" =: [ "literal role prefix" =: ":literal:`a`" =?> para (code "a") , "literal role postfix" =: "`a`:literal:" =?> para (code "a") , "literal text" =: "``text``" =?> para (code "text") - , "code role" =: ":code:`a`" =?> para (codeWith ("", ["sourceCode"], []) "a") + , "code role" =: ":code:`a`" =?> para (codeWith ("", [], []) "a") , "inherited code role" =: ".. role:: codeLike(code)\n\n:codeLike:`a`" - =?> para (codeWith ("", ["codeLike", "sourceCode"], []) "a") + =?> para (codeWith ("", ["codeLike"], []) "a") , "custom code role with language field" =: ".. role:: lhs(code)\n :language: haskell\n\n:lhs:`a`" - =?> para (codeWith ("", ["lhs", "haskell","sourceCode"], []) "a") + =?> para (codeWith ("", ["lhs", "haskell"], []) "a") , "custom role with unspecified parent role" =: ".. role:: classy\n\n:classy:`text`" =?> para (spanWith ("", ["classy"], []) "text") , "role with recursive inheritance" =: ".. role:: haskell(code)\n.. role:: lhs(haskell)\n\n:lhs:`text`" - =?> para (codeWith ("", ["lhs", "haskell", "sourceCode"], []) "text") + =?> para (codeWith ("", ["lhs", "haskell"], []) "text") , "unknown role" =: ":unknown:`text`" =?> para (codeWith ("",["interpreted-text"],[("role","unknown")]) "text") ] diff --git a/test/command/4811.md b/test/command/4811.md index 9c8bea7ce..81a60d78d 100644 --- a/test/command/4811.md +++ b/test/command/4811.md @@ -19,7 +19,7 @@ Backslash escape behaves properly in interpreted roles: `hi\ there`:code: ^D [Para [Superscript [Str "hithere"]] -,Para [Code ("",["sourceCode"],[]) "hi\\ there"]] +,Para [Code ("",[],[]) "hi\\ there"]] ``` Backtick followed by alphanumeric doesn't end the span: diff --git a/test/lhs-test-markdown.native b/test/lhs-test-markdown.native index b6d908339..7a423b1ab 100644 --- a/test/lhs-test-markdown.native +++ b/test/lhs-test-markdown.native @@ -1,6 +1,6 @@ [Header 1 ("lhs-test",[],[]) [Str "lhs",Space,Str "test"] ,Para [Code ("",[],[]) "unsplit",Space,Str "is",Space,Str "an",Space,Str "arrow",Space,Str "that",Space,Str "takes",Space,Str "a",Space,Str "pair",Space,Str "of",Space,Str "values",Space,Str "and",Space,Str "combines",Space,Str "them",Space,Str "to",SoftBreak,Str "return",Space,Str "a",Space,Str "single",Space,Str "value:"] -,CodeBlock ("",["sourceCode","literate","haskell"],[]) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" +,CodeBlock ("",["haskell","literate"],[]) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" ,Para [Code ("",[],[]) "(***)",Space,Str "combines",Space,Str "two",Space,Str "arrows",Space,Str "into",Space,Str "a",Space,Str "new",Space,Str "arrow",Space,Str "by",Space,Str "running",Space,Str "the",Space,Str "two",Space,Str "arrows",Space,Str "on",Space,Str "a",SoftBreak,Str "pair",Space,Str "of",Space,Str "values",Space,Str "(one",Space,Str "arrow",Space,Str "on",Space,Str "the",Space,Str "first",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair",Space,Str "and",Space,Str "one",Space,Str "arrow",Space,Str "on",Space,Str "the",SoftBreak,Str "second",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair)."] ,CodeBlock ("",[],[]) "f *** g = first f >>> second g" ,Para [Str "Block",Space,Str "quote:"] diff --git a/test/lhs-test.html b/test/lhs-test.html index efe9d8e29..03dd347ff 100644 --- a/test/lhs-test.html +++ b/test/lhs-test.html @@ -82,7 +82,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni

lhs test

unsplit is an arrow that takes a pair of values and combines them to return a single value:

-
unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d
+
 

(***) combines two arrows into a new arrow by running the two arrows on a diff --git a/test/lhs-test.html+lhs b/test/lhs-test.html+lhs index 88f7b8834..ee0d8a299 100644 --- a/test/lhs-test.html+lhs +++ b/test/lhs-test.html+lhs @@ -82,7 +82,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni

lhs test

unsplit is an arrow that takes a pair of values and combines them to return a single value:

-
> unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d
+
 

(***) combines two arrows into a new arrow by running the two arrows on a diff --git a/test/lhs-test.markdown b/test/lhs-test.markdown index 20949b75c..0ddf24a98 100644 --- a/test/lhs-test.markdown +++ b/test/lhs-test.markdown @@ -4,7 +4,7 @@ lhs test `unsplit` is an arrow that takes a pair of values and combines them to return a single value: -``` {.sourceCode .literate .haskell} +``` {.haskell .literate} unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d unsplit = arr . uncurry -- arr (\op (x,y) -> x `op` y) diff --git a/test/lhs-test.native b/test/lhs-test.native index b6d908339..7a423b1ab 100644 --- a/test/lhs-test.native +++ b/test/lhs-test.native @@ -1,6 +1,6 @@ [Header 1 ("lhs-test",[],[]) [Str "lhs",Space,Str "test"] ,Para [Code ("",[],[]) "unsplit",Space,Str "is",Space,Str "an",Space,Str "arrow",Space,Str "that",Space,Str "takes",Space,Str "a",Space,Str "pair",Space,Str "of",Space,Str "values",Space,Str "and",Space,Str "combines",Space,Str "them",Space,Str "to",SoftBreak,Str "return",Space,Str "a",Space,Str "single",Space,Str "value:"] -,CodeBlock ("",["sourceCode","literate","haskell"],[]) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" +,CodeBlock ("",["haskell","literate"],[]) "unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d\nunsplit = arr . uncurry\n -- arr (\\op (x,y) -> x `op` y)" ,Para [Code ("",[],[]) "(***)",Space,Str "combines",Space,Str "two",Space,Str "arrows",Space,Str "into",Space,Str "a",Space,Str "new",Space,Str "arrow",Space,Str "by",Space,Str "running",Space,Str "the",Space,Str "two",Space,Str "arrows",Space,Str "on",Space,Str "a",SoftBreak,Str "pair",Space,Str "of",Space,Str "values",Space,Str "(one",Space,Str "arrow",Space,Str "on",Space,Str "the",Space,Str "first",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair",Space,Str "and",Space,Str "one",Space,Str "arrow",Space,Str "on",Space,Str "the",SoftBreak,Str "second",Space,Str "item",Space,Str "of",Space,Str "the",Space,Str "pair)."] ,CodeBlock ("",[],[]) "f *** g = first f >>> second g" ,Para [Str "Block",Space,Str "quote:"] diff --git a/test/rst-reader.native b/test/rst-reader.native index 89dde7396..cd1437ac8 100644 --- a/test/rst-reader.native +++ b/test/rst-reader.native @@ -38,7 +38,7 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa ,Para [Str "And:"] ,CodeBlock ("",[],[]) "this block is indented by two tabs\n\nThese should not be escaped: \\$ \\\\ \\> \\[ \\{" ,Para [Str "And:"] -,CodeBlock ("",["sourceCode","python"],[]) "def my_function(x):\n return x + 1" +,CodeBlock ("",["python"],[]) "def my_function(x):\n return x + 1" ,Header 1 ("lists",[],[]) [Str "Lists"] ,Header 2 ("unordered",[],[]) [Str "Unordered"] ,Para [Str "Asterisks",Space,Str "tight:"] @@ -328,8 +328,8 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa ,Para [Str "Reset",Space,Str "default-role",Space,Str "to",Space,Str "the",Space,Str "default",Space,Str "default."] ,Para [Str "And",Space,Str "now",Space,Span ("",["title-ref"],[]) [Str "some-invalid-string-3231231"],Space,Str "is",Space,Str "nonsense."] ,Para [Str "And",Space,Str "now",Space,Str "with",Space,RawInline (Format "html") "inline HTML",Str "."] -,Para [Str "And",Space,Str "some",Space,Str "inline",Space,Str "haskell",Space,Code ("",["haskell","sourceCode"],[]) "fmap id [1,2..10]",Str "."] -,Para [Str "Indirect",Space,Str "python",Space,Str "role",Space,Code ("",["py","python","indirect","sourceCode"],[]) "[x*x for x in [1,2,3,4,5]]",Str "."] -,Para [Str "Different",Space,Str "indirect",Space,Str "C",Space,Code ("",["c","different-indirect","sourceCode"],[]) "int x = 15;",Str "."] +,Para [Str "And",Space,Str "some",Space,Str "inline",Space,Str "haskell",Space,Code ("",["haskell"],[]) "fmap id [1,2..10]",Str "."] +,Para [Str "Indirect",Space,Str "python",Space,Str "role",Space,Code ("",["py","python","indirect"],[]) "[x*x for x in [1,2,3,4,5]]",Str "."] +,Para [Str "Different",Space,Str "indirect",Space,Str "C",Space,Code ("",["c","different-indirect"],[]) "int x = 15;",Str "."] ,Header 2 ("literal-symbols",[],[]) [Str "Literal",Space,Str "symbols"] ,Para [Str "2*2",Space,Str "=",Space,Str "4*1"]] -- cgit v1.2.3