Docx writer: move ": " out of the caption bookmark.

This is needed so that native references to the figure are included as
"As seen in Figure X, it is..." instead of
"As seen in [Figure: , it is..."
This commit is contained in:
Tristan Stenner 2021-10-26 15:03:12 +02:00 committed by John MacFarlane
parent f4d9b443d8
commit 6509ff6204
2 changed files with 4 additions and 6 deletions

View file

@ -880,8 +880,7 @@ blockToOpenXML' opts (SimpleFigure attr@(imgident, _, _) alt (src, tit)) = do
("<w:fldSimple w:instr=\"SEQ Figure"
<> " \\* ARABIC \"><w:r><w:t>"
<> tshow fignum
<> "</w:t></w:r></w:fldSimple>"),
Str ":", Space] : alt
<> "</w:t></w:r></w:fldSimple>")] : Str ": " : alt
else alt
return $
Elem (mknode "w:p" [] (map Elem paraProps ++ contents))

View file

@ -98,8 +98,8 @@ tableToOpenXML opts blocksToOpenXML gridTable = do
addLabel :: Text -> Text -> Int -> [Block] -> [Block]
addLabel tableid tablename tablenum bs =
case bs of
(Para ils : rest) -> Para (label : Space : ils) : rest
(Plain ils : rest) -> Plain (label : Space : ils) : rest
(Para ils : rest) -> Para (label : Str ": " : ils) : rest
(Plain ils : rest) -> Plain (label : Str ": " : ils) : rest
_ -> Para [label] : bs
where
label = Span (tableid,[],[])
@ -108,8 +108,7 @@ addLabel tableid tablename tablenum bs =
("<w:fldSimple w:instr=\"SEQ Table"
<> " \\* ARABIC \"><w:r><w:t>"
<> tshow tablenum
<> "</w:t></w:r></w:fldSimple>"),
Str ":"]
<> "</w:t></w:r></w:fldSimple>")]
-- | Parts of a table
data RowType = HeadRow | BodyRow | FootRow