diff options
| author | Nikolai Korobeinikov <31213770+ricnorr@users.noreply.github.com> | 2022-03-26 20:00:05 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-26 10:00:05 -0700 |
| commit | e2923747a4c963a5256e3972dbd3c5afb1d50645 (patch) | |
| tree | c200e2b190a09b244a6351ee38aed8474524ea88 /src/Text | |
| parent | 51f18d52c701b038e8c51fd98dae2e764b472620 (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.hs | 6 |
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 |
