aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs9
-rw-r--r--src/Text/Pandoc/Shared.hs11
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs3
-rw-r--r--tests/html-reader.html4
4 files changed, 22 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 361d64361..c43bc5295 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -270,7 +270,14 @@ pOrderedList = try $ do
"lower-alpha" -> LowerAlpha
"upper-alpha" -> UpperAlpha
"decimal" -> Decimal
- _ -> DefaultStyle
+ _ ->
+ case lookup "type" attribs of
+ Just "1" -> Decimal
+ Just "I" -> UpperRoman
+ Just "i" -> LowerRoman
+ Just "A" -> UpperAlpha
+ Just "a" -> LowerAlpha
+ _ -> DefaultStyle
let nonItem = pSatisfy (\t ->
not (tagOpen (`elem` ["li","ol","ul","dl"]) (const True) t) &&
not (t ~== TagClose "ol"))
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index ef9f66aa7..edf2619c0 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -142,9 +142,14 @@ import Text.Pandoc.Data (dataFiles)
import Paths_pandoc (getDataFileName)
#endif
#ifdef HTTP_CLIENT
-import Network.HTTP.Client (httpLbs, parseUrl, withManager,
+import Network.HTTP.Client (httpLbs, parseUrl,
responseBody, responseHeaders,
Request(port,host))
+#if MIN_VERSION_http_client(0,4,18)
+import Network.HTTP.Client (newManager)
+#else
+import Network.HTTP.Client (withManager)
+#endif
import Network.HTTP.Client.Internal (addProxy)
import Network.HTTP.Client.TLS (tlsManagerSettings)
import System.Environment (getEnv)
@@ -905,7 +910,11 @@ openURL u
Right pr -> case parseUrl pr of
Just r -> addProxy (host r) (port r) req
Nothing -> req
+#if MIN_VERSION_http_client(0,4,18)
+ resp <- newManager tlsManagerSettings >>= httpLbs req'
+#else
resp <- withManager tlsManagerSettings $ httpLbs req'
+#endif
return (BS.concat $ toChunks $ responseBody resp,
UTF8.toString `fmap` lookup hContentType (responseHeaders resp))
#else
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 915b193f7..a2778ea97 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -458,7 +458,8 @@ blockToHtml opts (Div attr@(_,classes,_) bs) = do
if speakerNotes
then case writerSlideVariant opts of
RevealJsSlides -> addAttrs opts' attr $ H5.aside $ contents'
- DZSlides -> addAttrs opts' attr $ H5.div $ contents'
+ DZSlides -> (addAttrs opts' attr $ H5.div $ contents')
+ ! (H5.customAttribute "role" "note")
NoSlides -> addAttrs opts' attr $ H.div $ contents'
_ -> mempty
else addAttrs opts attr $ H.div $ contents'
diff --git a/tests/html-reader.html b/tests/html-reader.html
index 749925b2a..b6dd50fcc 100644
--- a/tests/html-reader.html
+++ b/tests/html-reader.html
@@ -259,13 +259,13 @@ These should not be escaped: \$ \\ \> \[ \{
></ol
><p
>Nesting:</p
- ><ol class="upper-alpha"
+ ><ol type="A"
><li
>Upper Alpha<ol class="upper-roman"
><li
>Upper Roman.<ol start="6" class="decimal"
><li
- >Decimal start with 6<ol start="3" class="lower-alpha"
+ >Decimal start with 6<ol start="3" type="a"
><li
>Lower alpha with paren</li
></ol