Skip to content

Commit 67851f1

Browse files
authored
Merge pull request #12642 from quarto-dev/bugfix/8392
Port OpenXML docx fixes from #8392 to 1.8
2 parents 6202430 + b808c60 commit 67851f1

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

news/changelog-1.8.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ All changes included in 1.8:
66

77
- ([#12598](https://github.com/quarto-dev/quarto-cli/pull/12598)): Ensure `.fragment` on an image with caption applies to whole figure.
88

9+
### `docx`
10+
11+
- ([#8392](https://github.com/quarto-dev/quarto-cli/issues/8392)): Fix `docx` generation issues in tables
12+
913
## Projects
1014

1115
### `website`

src/resources/filters/layout/docx.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ end
110110

111111
function docxAlign(align)
112112
if align == "left" then
113-
return "start"
113+
return "left"
114114
elseif align == "center" then
115115
return "center"
116116
elseif align == "right" then
117-
return "end"
117+
return "right"
118118
else
119119
return nil
120120
end

src/resources/filters/quarto-post/docx.lua

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,16 @@ function calloutDocx(node)
1515
<w:tblStyle w:val="Table" />
1616
<w:tblLook w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:noHBand="0" w:noVBand="0" w:val="0000" />
1717
<w:tblBorders>
18-
<w:left w:val="single" w:sz="24" w:space="0" w:color="$color"/>
19-
<w:right w:val="single" w:sz="4" w:space="0" w:color="$color"/>
2018
<w:top w:val="single" w:sz="4" w:space="0" w:color="$color"/>
19+
<w:left w:val="single" w:sz="24" w:space="0" w:color="$color"/>
2120
<w:bottom w:val="single" w:sz="4" w:space="0" w:color="$color"/>
21+
<w:right w:val="single" w:sz="4" w:space="0" w:color="$color"/>
2222
</w:tblBorders>
2323
<w:tblCellMar>
2424
<w:left w:w="144" w:type="dxa" />
2525
<w:right w:w="144" w:type="dxa" />
2626
</w:tblCellMar>
27-
<w:tblInd w:w="164" w:type="dxa" />
28-
<w:tblW w:type="pct" w:w="100%"/>
27+
<w:tblLook w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:noHBand="0" w:noVBand="0" w:val="0000" />
2928
</w:tblPr>
3029
<w:tr>
3130
<w:trPr>
@@ -101,6 +100,7 @@ function calloutDocx(node)
101100

102101
-- close the table
103102
local suffix = pandoc.List({pandoc.RawBlock("openxml", [[
103+
<w:p/>
104104
</w:tc>
105105
</w:tr>
106106
</w:tbl>
@@ -121,16 +121,19 @@ function calloutDocx(node)
121121
<w:tbl>
122122
<w:tblPr>
123123
<w:tblStyle w:val="Table" />
124-
<w:tblLook w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:noHBand="0" w:noVBand="0" w:val="0000" />
124+
<w:tblInd w:w="164" w:type="dxa" />
125125
<w:tblBorders>
126126
<w:left w:val="single" w:sz="24" w:space="0" w:color="$color"/>
127127
</w:tblBorders>
128128
<w:tblCellMar>
129129
<w:left w:w="0" w:type="dxa" />
130130
<w:right w:w="0" w:type="dxa" />
131131
</w:tblCellMar>
132-
<w:tblInd w:w="164" w:type="dxa" />
132+
<w:tblLook w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:noHBand="0" w:noVBand="0" w:val="0000" />
133133
</w:tblPr>
134+
<w:tblGrid>
135+
<w:gridCol w:w="7920" />
136+
</w:tblGrid>
134137
<w:tr>
135138
<w:trPr>
136139
<w:cantSplit/>
-10 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)