summaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorNikolai Korobeinikov <31213770+ricnorr@users.noreply.github.com>2022-03-26 20:00:05 +0300
committerGitHub <noreply@github.com>2022-03-26 10:00:05 -0700
commite2923747a4c963a5256e3972dbd3c5afb1d50645 (patch)
treec200e2b190a09b244a6351ee38aed8474524ea88 /src/Text
parent51f18d52c701b038e8c51fd98dae2e764b472620 (diff)
Docx writer: add bookmark with table id to table (#7989)
This allows tables with ids to be linked to. Closes #7285.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index 400c12cae..38401052a 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -930,10 +930,12 @@ blockToOpenXML' _ HorizontalRule = do
$ mknode "v:rect" [("style","width:0;height:1.5pt"),
("o:hralign","center"),
("o:hrstd","t"),("o:hr","t")] () ]
-blockToOpenXML' opts (Table attr caption colspecs thead tbodies tfoot) =
- tableToOpenXML opts
+blockToOpenXML' opts (Table attr caption colspecs thead tbodies tfoot) = do
+ content <- tableToOpenXML opts
(blocksToOpenXML opts)
(Grid.toTable attr caption colspecs thead tbodies tfoot)
+ let (tableId, _, _) = attr
+ wrapBookmark tableId content
blockToOpenXML' opts el
| BulletList lst <- el = addOpenXMLList BulletMarker lst
| OrderedList (start, numstyle, numdelim) lst <- el