aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Stenner <ttstenner@gmail.com>2021-10-26 15:03:12 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2021-10-29 08:40:20 -0700
commit6509ff62043b6445098cc9c94628fab464638f62 (patch)
tree73b91a3592325cb503fd6b7f3cc82bc1d44ccd5e /src
parentf4d9b443d8b44b802d564a64280cbe9ea89dacc8 (diff)
downloadpandoc-6509ff62043b6445098cc9c94628fab464638f62.tar.gz
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..."
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs3
-rw-r--r--src/Text/Pandoc/Writers/Docx/Table.hs7
2 files changed, 4 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index fccbb0719..ce7133f33 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -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))
diff --git a/src/Text/Pandoc/Writers/Docx/Table.hs b/src/Text/Pandoc/Writers/Docx/Table.hs
index e23856f28..4dc4ad6a2 100644
--- a/src/Text/Pandoc/Writers/Docx/Table.hs
+++ b/src/Text/Pandoc/Writers/Docx/Table.hs
@@ -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