Jira reader: support colored inline text, indented lists

* Support for colored inlines has been added.
* Lists are now allowed to be indented; i.e., lists are still recognized
  if list markers are preceded by spaces.

Closes: #6183, #6184
This commit is contained in:
Albert Krewinkel 2020-03-13 09:43:13 +01:00
parent 91f2bcfe73
commit 7eb9914841
No known key found for this signature in database
GPG key ID: 388DC0B21F631124
4 changed files with 8 additions and 2 deletions

View file

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

View file

@ -121,6 +121,8 @@ jiraToPandocInlines :: Jira.Inline -> Inlines
jiraToPandocInlines = \case
Jira.Anchor t -> spanWith (t, [], []) mempty
Jira.AutoLink url -> link (Jira.fromURL url) "" (str (Jira.fromURL url))
Jira.ColorInline c ils -> spanWith ("", [], [("color", colorName c)]) $
fromInlines ils
Jira.Emoji icon -> str . iconUnicode $ icon
Jira.Entity entity -> str . fromEntity $ entity
Jira.Image _ url -> image (Jira.fromURL url) "" mempty

View file

@ -20,7 +20,7 @@ extra-deps:
- regex-pcre-builtin-0.95.0.8.8.35
- doclayout-0.3
- emojis-0.1
- jira-wiki-markup-1.0.0
- jira-wiki-markup-1.1.0
- HsYAML-0.2.0.0
- HsYAML-aeson-0.2.0.0
- doctemplates-0.8.1

View file

@ -96,6 +96,10 @@ tests =
"HCO ~3~^-^" =?>
para ("HCO " <> subscript "3" <> superscript "-")
, "color" =:
"This is {color:red}red{color}." =?>
para ("This is " <> spanWith ("", [], [("color", "red")]) "red" <> ".")
, "linebreak" =:
"first\nsecond" =?>
para ("first" <> linebreak <> "second")