Jira reader: resolve parsing issues of blockquote, color

Parsing problems occurring with block quotes and colored text have been
resolved.

Fixes: #6233
Fixes: #6235
This commit is contained in:
Albert Krewinkel 2020-04-03 13:18:40 +02:00
parent 792f1a6b57
commit d867cac8ca
No known key found for this signature in database
GPG key ID: 388DC0B21F631124
3 changed files with 22 additions and 3 deletions

View file

@ -412,7 +412,7 @@ library
blaze-html >= 0.9 && < 0.10,
blaze-markup >= 0.8 && < 0.9,
vector >= 0.10 && < 0.13,
jira-wiki-markup >= 1.2.0 && < 1.3,
jira-wiki-markup >= 1.2.1 && < 1.3,
hslua >= 1.0.1 && < 1.2,
hslua-module-system >= 0.2 && < 0.3,
hslua-module-text >= 0.2 && < 0.3,

View file

@ -14,8 +14,8 @@ Tests for the RST reader.
-}
module Tests.Readers.Jira (tests) where
import Prelude
import Data.Text (Text)
import Prelude hiding (unlines)
import Data.Text (Text, unlines)
import Test.Tasty (TestTree, testGroup)
import Tests.Helpers (ToString, purely, test, (=?>))
import Text.Pandoc (def)
@ -57,6 +57,16 @@ tests =
[ "simple block quote" =:
"bq. _Don't_ quote me on this." =?>
blockQuote (para $ emph "Don't" <> space <> "quote me on this.")
, "block quote between paragraphs" =:
unlines [ "Regular text."
, "bq.This is a blockquote"
, "More text."
] =?>
mconcat [ para "Regular text."
, blockQuote (para "This is a blockquote")
, para "More text."
]
]
, testGroup "table"
@ -105,6 +115,10 @@ tests =
"This is {color:red}red{color}." =?>
para ("This is " <> spanWith ("", [], [("color", "red")]) "red" <> ".")
, "hexcolor" =:
"{color:#00875A}green{color}" =?>
para (spanWith ("", [], [("color", "#00875A")]) "green")
, "linebreak" =:
"first\nsecond" =?>
para ("first" <> linebreak <> "second")

View file

@ -23,5 +23,10 @@ tests =
spanWith ("ignored", ["ignored", "underline"], [("foo", "bar")])
"underlined text" =?>
"+underlined text+"
, "image with attributes" =:
imageWith ("", [], [("align", "right"), ("height", "50")])
"image.png" "" mempty =?>
"!image.png|align=right, height=50!"
]
]