diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2022-09-27 13:03:26 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2022-09-27 13:03:26 -0700 |
| commit | a27e10111a27c96b746e58552550facd4f14f29d (patch) | |
| tree | 640b65172dc2e68b417ad12c146c539b1e6d947e /src | |
| parent | 301f9058397e8a8e255cd1ca390bc0f9e97a08f7 (diff) | |
Fix small whitespace things.
Diffstat (limited to 'src')
24 files changed, 12 insertions, 42 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index aab2ae94b..d5df55f93 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -525,6 +525,3 @@ adjustLinksAndIds exts thisfile allfiles Image (fixAttrs attr) ils (fixURL url,tit) fixInline (Span attr ils) = Span (fixAttrs attr) ils fixInline x = x - - - diff --git a/src/Text/Pandoc/Citeproc/Util.hs b/src/Text/Pandoc/Citeproc/Util.hs index 8bffc0f32..791041bcd 100644 --- a/src/Text/Pandoc/Citeproc/Util.hs +++ b/src/Text/Pandoc/Citeproc/Util.hs @@ -79,4 +79,3 @@ toIETF "ukrainian" = "uk-UA" toIETF "vietnamese" = "vi-VN" toIETF "latin" = "la" toIETF x = x - diff --git a/src/Text/Pandoc/Class/Sandbox.hs b/src/Text/Pandoc/Class/Sandbox.hs index 4243a7be5..64547be92 100644 --- a/src/Text/Pandoc/Class/Sandbox.hs +++ b/src/Text/Pandoc/Class/Sandbox.hs @@ -47,4 +47,3 @@ sandbox files action = do mapM_ logOutput (filter ((<= verbosity) . messageVerbosity) newMessages) return result - diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs index cc4f0c730..6a416608f 100644 --- a/src/Text/Pandoc/Extensions.hs +++ b/src/Text/Pandoc/Extensions.hs @@ -631,4 +631,3 @@ parseFormatSpec = parse formatSpec "" case polarity of '+' -> (ext : extsToEnable, extsToDisable) _ -> (extsToEnable, ext : extsToDisable) - diff --git a/src/Text/Pandoc/Highlighting.hs b/src/Text/Pandoc/Highlighting.hs index 2d87033f6..54f62bb82 100644 --- a/src/Text/Pandoc/Highlighting.hs +++ b/src/Text/Pandoc/Highlighting.hs @@ -237,4 +237,3 @@ lookupHighlightingStyle s Just sty -> return sty Nothing -> throwError $ PandocOptionError $ T.pack $ "Unknown highlight-style " ++ s - diff --git a/src/Text/Pandoc/Lua/Writer.hs b/src/Text/Pandoc/Lua/Writer.hs index 6b4273d88..f216ea63b 100644 --- a/src/Text/Pandoc/Lua/Writer.hs +++ b/src/Text/Pandoc/Lua/Writer.hs @@ -61,4 +61,3 @@ writeCustom luaFile opts doc = do push opts callTrace 2 1 forcePeek $ peekText top - diff --git a/src/Text/Pandoc/Parsing/Citations.hs b/src/Text/Pandoc/Parsing/Citations.hs index dfad454fd..923cd7dd0 100644 --- a/src/Text/Pandoc/Parsing/Citations.hs +++ b/src/Text/Pandoc/Parsing/Citations.hs @@ -54,4 +54,3 @@ simpleCiteIdentifier = do rest <- many $ regchar <|> internal (oneOf ":.#$%&-+?<>~/") <|> try (oneOf ":/" <* lookAhead (char '/')) return $ T.pack $ firstChar:rest - diff --git a/src/Text/Pandoc/Readers/CommonMark.hs b/src/Text/Pandoc/Readers/CommonMark.hs index 528d84dbf..a055c1310 100644 --- a/src/Text/Pandoc/Readers/CommonMark.hs +++ b/src/Text/Pandoc/Readers/CommonMark.hs @@ -158,4 +158,3 @@ specFor opts = foldr ($) defaultSyntaxSpec exts [ (taskListSpec <>) | isEnabled Ext_task_lists opts ] ++ [ (rebaseRelativePathsSpec <>) | isEnabled Ext_rebase_relative_paths opts ] - diff --git a/src/Text/Pandoc/Readers/Docx/Fields.hs b/src/Text/Pandoc/Readers/Docx/Fields.hs index 4cb89ac0c..637e4fc88 100644 --- a/src/Text/Pandoc/Readers/Docx/Fields.hs +++ b/src/Text/Pandoc/Readers/Docx/Fields.hs @@ -132,6 +132,6 @@ pageref = do farg <- fieldArgument switches <- spaces *> many pagerefSwitch let isLink = case switches of - ("\\h", _) : _ -> True + ("\\h", _) : _ -> True _ -> False return (farg, isLink) diff --git a/src/Text/Pandoc/Readers/Docx/Util.hs b/src/Text/Pandoc/Readers/Docx/Util.hs index c0f9182f4..2e87fa946 100644 --- a/src/Text/Pandoc/Readers/Docx/Util.hs +++ b/src/Text/Pandoc/Readers/Docx/Util.hs @@ -67,4 +67,3 @@ findAttrByName :: NameSpaces -> Text -> Text -> Element -> Maybe Text findAttrByName ns pref name el = let ns' = ns <> elemToNameSpaces el in findAttr (elemName ns' pref name) el - diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index f3aa29490..1e19fbbf8 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -1324,4 +1324,3 @@ block = do blocks :: PandocMonad m => LP m Blocks blocks = mconcat <$> many block - diff --git a/src/Text/Pandoc/Readers/LaTeX/Citation.hs b/src/Text/Pandoc/Readers/LaTeX/Citation.hs index 90fa1bc16..95629ce29 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Citation.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Citation.hs @@ -208,4 +208,3 @@ complexNatbibCitation inline mode = try $ do inNote :: Inlines -> Inlines inNote ils = note $ para $ ils <> str "." - diff --git a/src/Text/Pandoc/Readers/LaTeX/Inline.hs b/src/Text/Pandoc/Readers/LaTeX/Inline.hs index 53a3c1597..e5d7ccb30 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Inline.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Inline.hs @@ -394,5 +394,3 @@ doAcronymPlural form = do return . mconcat $ [spanWith ("",[],[("acronym-label", untokenize acro), ("acronym-form", "plural+" <> form)]) $ mconcat [str $ untokenize acro, plural]] - - diff --git a/src/Text/Pandoc/Readers/LaTeX/Math.hs b/src/Text/Pandoc/Readers/LaTeX/Math.hs index 92f41910b..68122d216 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Math.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Math.hs @@ -218,5 +218,3 @@ italicize x@(Para [Image{}]) = x -- see #6925 italicize (Para ils) = Para [Emph ils] italicize (Plain ils) = Plain [Emph ils] italicize x = x - - diff --git a/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs b/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs index 6c22a4ceb..5cc97e1a6 100644 --- a/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs +++ b/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs @@ -469,5 +469,3 @@ siUnitMap = M.fromList , ("watt", str "W") , ("weber", str "Wb") ] - - diff --git a/src/Text/Pandoc/Writers/BibTeX.hs b/src/Text/Pandoc/Writers/BibTeX.hs index 07e27892c..309690164 100644 --- a/src/Text/Pandoc/Writers/BibTeX.hs +++ b/src/Text/Pandoc/Writers/BibTeX.hs @@ -57,5 +57,3 @@ writeBibTeX' variant opts (Pandoc meta _) = do case writerTemplate opts of Nothing -> main Just tpl -> renderTemplate tpl context - - diff --git a/src/Text/Pandoc/Writers/CommonMark.hs b/src/Text/Pandoc/Writers/CommonMark.hs index 13ded1f62..95184c5fd 100644 --- a/src/Text/Pandoc/Writers/CommonMark.hs +++ b/src/Text/Pandoc/Writers/CommonMark.hs @@ -14,4 +14,3 @@ CommonMark: <http://commonmark.org> module Text.Pandoc.Writers.CommonMark (writeCommonMark) where import Text.Pandoc.Writers.Markdown (writeCommonMark) - diff --git a/src/Text/Pandoc/Writers/Custom.hs b/src/Text/Pandoc/Writers/Custom.hs index ae0cf0c7e..4cd42be62 100644 --- a/src/Text/Pandoc/Writers/Custom.hs +++ b/src/Text/Pandoc/Writers/Custom.hs @@ -12,4 +12,3 @@ a Lua writer. module Text.Pandoc.Writers.Custom ( writeCustom ) where import Text.Pandoc.Lua.Writer ( writeCustom ) - diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs index a461b31b7..c38844ce0 100644 --- a/src/Text/Pandoc/Writers/EPUB.hs +++ b/src/Text/Pandoc/Writers/EPUB.hs @@ -689,7 +689,7 @@ pandocToEPUB version opts doc = do navPointNode formatter (Div _ bs) = concat <$> mapM (navPointNode formatter) bs navPointNode _ _ = return [] - + -- Create the tocEntry from the metadata together with the sections and title. tocEntry <- createTocEntry meta metadata plainTitle secs navPointNode @@ -740,7 +740,7 @@ createCoverPage :: PandocMonad m => -> (WriterOptions -> Pandoc -> m B8.ByteString) -> Text -> StateT EPUBState m ([Entry], [Entry]) -createCoverPage meta metadata opts' vars cssvars writeHtml plainTitle = +createCoverPage meta metadata opts' vars cssvars writeHtml plainTitle = case epubCoverImage metadata of Nothing -> return ([],[]) Just img -> do @@ -807,7 +807,7 @@ createChapterEntries opts' vars cssvars writeHtml chapters = do -- remove notes or we get doubled footnotes (Pandoc (setMeta "title" (walk removeNote $ fromList xs) nullMeta) bs, - -- Check if the chapters belongs to the frontmatter, + -- Check if the chapters belongs to the frontmatter, -- backmatter of bodymatter defaulting to the body case lookup "epub:type" kvs of Nothing -> "bodymatter" @@ -832,7 +832,7 @@ createChapterEntries opts' vars cssvars writeHtml chapters = do -- | Splits the blocks into chapters and creates a corresponding reftable createChaptersAndReftable :: WriterOptions -> [Block] -> ([Chapter], [(Text, Text)]) createChaptersAndReftable opts secs = (chapters, reftable) - where + where chapterHeaderLevel = writerEpubChapterLevel opts isChapterHeader :: Block -> Bool @@ -845,18 +845,18 @@ createChaptersAndReftable opts secs = (chapters, reftable) -- If the header is of the same level as chapters, create a chapter | chapterHeaderLevel == lvl = Chapter [d] : secsToChapters rest - -- If the header is a level higher than chapters, + -- If the header is a level higher than chapters, -- create a chapter of everything until the next chapter header. | chapterHeaderLevel > lvl = Chapter [Div attr (h:xs)] : secsToChapters ys ++ secsToChapters rest where (xs, ys) = break isChapterHeader bs secsToChapters bs = - -- If this is the last block, keep it as is, + -- If this is the last block, keep it as is, -- otherwise create a chapter for everything until the next chapter header. (if null xs then id else (Chapter xs :)) $ secsToChapters ys where (xs, ys) = break isChapterHeader bs - + -- Convert the sections to initial chapters chapters' = secsToChapters secs @@ -879,7 +879,7 @@ createChaptersAndReftable opts secs = (chapters, reftable) _ -> id) [] (parseTags raw) extractLinkURL' _ _ = [] - + -- Extract references for the reftable from Block elements extractLinkURL :: Int -> Block -> [(T.Text, T.Text)] extractLinkURL num (Div (ident, _, _) _) diff --git a/src/Text/Pandoc/Writers/ICML.hs b/src/Text/Pandoc/Writers/ICML.hs index 7f0c4d5a7..d9443bcce 100644 --- a/src/Text/Pandoc/Writers/ICML.hs +++ b/src/Text/Pandoc/Writers/ICML.hs @@ -486,7 +486,7 @@ inlineToICML opts style _ (Span (ident, _, kvs) lst) = in inlinesToICML opts (dynamicStyle <> style) ident lst -- ident will be the id of the span, that we need to use down in the hyperlink setter -- if T.null ident --- then +-- then -- else do -- | Convert a list of block elements to an ICML footnote. @@ -559,7 +559,7 @@ makeLinkDest ident cont = vcat [ -- | Create the markup for the content (incl. named destinations) -- | NOTE: since we have no easy way to get actual named dests, we just create them for any short content blocks makeContent :: Text -> Doc Text -> Doc Text -makeContent ident cont +makeContent ident cont | isEmpty cont = empty | not (Text.null ident) = makeLinkDest ident cont | otherwise = inTagsSimple "Content" $ flush cont diff --git a/src/Text/Pandoc/Writers/Markdown/Types.hs b/src/Text/Pandoc/Writers/Markdown/Types.hs index 2e94597be..7a1d252bc 100644 --- a/src/Text/Pandoc/Writers/Markdown/Types.hs +++ b/src/Text/Pandoc/Writers/Markdown/Types.hs @@ -78,5 +78,3 @@ instance Default WriterState , stIds = Set.empty , stNoteNum = 1 } - - diff --git a/src/Text/Pandoc/XML/Light.hs b/src/Text/Pandoc/XML/Light.hs index 85095338d..61025cb5c 100644 --- a/src/Text/Pandoc/XML/Light.hs +++ b/src/Text/Pandoc/XML/Light.hs @@ -111,4 +111,3 @@ nodeToContent (Conduit.NodeElement el) = nodeToContent (Conduit.NodeContent t) = Just (Text (CData CDataText t Nothing)) nodeToContent _ = Nothing - diff --git a/src/Text/Pandoc/XML/Light/Proc.hs b/src/Text/Pandoc/XML/Light/Proc.hs index 73b80bbee..87104f3a4 100644 --- a/src/Text/Pandoc/XML/Light/Proc.hs +++ b/src/Text/Pandoc/XML/Light/Proc.hs @@ -11,7 +11,7 @@ This code is taken from xml-light, released under the BSD3 license. -} module Text.Pandoc.XML.Light.Proc - ( + ( -- * Replacement for xml-light's Text.XML.Proc strContent , onlyElems @@ -135,5 +135,3 @@ lookupAttrBy p as = attrVal `fmap` find (p . attrKey) as -- satisfies the given predicate. findAttrBy :: (QName -> Bool) -> Element -> Maybe Text findAttrBy p e = lookupAttrBy p (elAttribs e) - - diff --git a/src/Text/Pandoc/XML/Light/Types.hs b/src/Text/Pandoc/XML/Light/Types.hs index e7698a0a2..59edb8979 100644 --- a/src/Text/Pandoc/XML/Light/Types.hs +++ b/src/Text/Pandoc/XML/Light/Types.hs @@ -189,5 +189,3 @@ fromXLContent :: XL.Content -> Content fromXLContent (XL.Elem el) = Elem $ fromXLElement el fromXLContent (XL.Text cd) = Text $ fromXLCData cd fromXLContent (XL.CRef s) = CRef (T.pack s) - - |
