Skip to content

Commit eea7fa9

Browse files
committed
Updates to work with latest djoths.
1 parent 95fff5d commit eea7fa9

File tree

5 files changed

+37
-329
lines changed

5 files changed

+37
-329
lines changed

cabal.project

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ source-repository-package
1616
source-repository-package
1717
type: git
1818
location: https://github.com/jgm/djoths
19-
tag: 81a63ca744fc9e4696eea9c1541e31e08d50252f
19+
tag: fa1bf8a18938bf24ffdf36ff6584524798c5d53f

src/Text/Pandoc/Readers/Djot.hs

+3-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ import Data.List (foldl')
4545
readDjot :: (PandocMonad m, ToSources a) => ReaderOptions -> a -> m Pandoc
4646
readDjot _opts inp = do
4747
let sources = toSources inp
48-
case parseDoc ParseOptions{ optSourcePositions = False }
49-
(UTF8.fromText $ sourcesToText sources) of
48+
case parseDoc ParseOptions (UTF8.fromText $ sourcesToText sources) of
5049
Left e -> throwError $ PandocParseError $ T.pack $ show e
5150
Right d ->
5251
runReaderT (doc <$> convertBlocks (D.docBlocks d))
@@ -173,6 +172,8 @@ convertInline (D.Node attr il) = addAttrToInline attr <$>
173172
D.Subscript ils -> subscript <$> convertInlines ils
174173
D.Superscript ils -> superscript <$> convertInlines ils
175174
D.Span ils -> spanWith nullAttr <$> convertInlines ils
175+
D.Quoted D.DoubleQuotes ils -> doubleQuoted <$> convertInlines ils
176+
D.Quoted D.SingleQuotes ils -> singleQuoted <$> convertInlines ils
176177
D.Verbatim bs -> pure $ code (UTF8.toText bs)
177178
D.Symbol bs -> pure $
178179
let s = UTF8.toText bs

src/Text/Pandoc/Shared.hs

+2-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,8 @@ normalizeDate' s = fmap (formatTime defaultTimeLocale "%F")
299299
-- and 'Cm () Blocks' are instances of 'HasAttributes'.
300300
addPandocAttributes
301301
:: forall b . HasAttributes (Cm () b) => [(T.Text, T.Text)] -> b -> b
302-
addPandocAttributes kvs bs = unCm . addAttributes kvs $ (Cm bs :: Cm () b)
302+
addPandocAttributes kvs bs =
303+
unCm . addAttributes (("wrap","1"):kvs) $ (Cm bs :: Cm () b)
303304

304305
-- | Generate infinite lazy list of markers for an ordered list,
305306
-- depending on list attributes.

0 commit comments

Comments
 (0)