From 3a79f37d8814d3870f7243a23b54f899a1e67065 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 12 Feb 2020 17:43:10 -0800 Subject: LaTeX reader: improve caption and label parsing. - Don't emit empty Span elements for labels. - Put tables with labels in a surrounding Div. --- src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc/Readers/LaTeX') diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index 4aa9976c9..cfd4f1dba 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -115,12 +115,13 @@ data LaTeXState = LaTeXState{ sOptions :: ReaderOptions , sLogMessages :: [LogMessage] , sIdentifiers :: Set.Set Text , sVerbatimMode :: Bool - , sCaption :: (Maybe Inlines, Maybe Text) + , sCaption :: Maybe Inlines , sInListItem :: Bool , sInTableCell :: Bool , sLastHeaderNum :: DottedNum , sLastFigureNum :: DottedNum , sLastTableNum :: DottedNum + , sLastLabel :: Maybe Text , sLabels :: M.Map Text [Inline] , sHasChapters :: Bool , sToggles :: M.Map Text Bool @@ -137,12 +138,13 @@ defaultLaTeXState = LaTeXState{ sOptions = def , sLogMessages = [] , sIdentifiers = Set.empty , sVerbatimMode = False - , sCaption = (Nothing, Nothing) + , sCaption = Nothing , sInListItem = False , sInTableCell = False , sLastHeaderNum = DottedNum [] , sLastFigureNum = DottedNum [] , sLastTableNum = DottedNum [] + , sLastLabel = Nothing , sLabels = M.empty , sHasChapters = False , sToggles = M.empty -- cgit v1.2.3