DokuWiki reader: parse <code> and <file> as block-level code.

Previously we treated them as inline code in some contexts,
but that is not how DokuWiki works.

Closes #9154.
This commit is contained in:
John MacFarlane
2023-10-22 10:59:07 -07:00
parent ad1a745f72
commit fbf9194e34
2 changed files with 13 additions and 20 deletions
+4 -3
View File
@@ -71,10 +71,11 @@ tests = [ testGroup "inlines"
para (strikeout "deleted")
, "Inline code" =:
"foo <code java>public static void main</code> bar" =?>
para (text "foo " <> codeWith ("", ["java"], []) "public static void main" <> text " bar")
para (text "foo") <> codeBlockWith ("", ["java"], []) "public static void main"
<> para (text "bar")
, "Inline file" =:
"foo <file></code></file> bar" =?>
para (text "foo " <> code "</code>" <> text " bar")
para (text "foo") <> codeBlock "</code>" <> para (text "bar")
, "Inline HTML" =:
"<html>\nThis is some <span style=\"color:red;font-size:150%;\">inline HTML</span>\n</html>" =?>
para (rawInline "html" "\nThis is some <span style=\"color:red;font-size:150%;\">inline HTML</span>\n")
@@ -245,7 +246,7 @@ tests = [ testGroup "inlines"
] =?>
orderedList [ plain "first item"
, plain ("second item with linebreak" <> linebreak <> " second line")
, plain ("third item with code: " <> code "some code\ncomes here\n")
, plain "third item with code: " <> codeBlock "some code\ncomes here\n"
, plain "fourth item"
]
]