Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lua,docx - port @edwintorok's OOXML changes in #8392 to v1.5 #8496

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/resources/filters/layout/docx.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ end

function docxAlign(align)
if align == "left" then
return "start"
return "let"
elseif align == "center" then
return "center"
elseif align == "right" then
return "end"
return "right"
else
return nil
end
Expand Down
15 changes: 9 additions & 6 deletions src/resources/filters/quarto-post/docx.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,16 @@ local function calloutDocxDefault(node, type, hasIcon)
<w:tblStyle w:val="Table" />
<w:tblLook w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:noHBand="0" w:noVBand="0" w:val="0000" />
<w:tblBorders>
<w:left w:val="single" w:sz="24" w:space="0" w:color="$color"/>
<w:right w:val="single" w:sz="4" w:space="0" w:color="$color"/>
<w:top w:val="single" w:sz="4" w:space="0" w:color="$color"/>
<w:left w:val="single" w:sz="24" w:space="0" w:color="$color"/>
<w:bottom w:val="single" w:sz="4" w:space="0" w:color="$color"/>
<w:right w:val="single" w:sz="4" w:space="0" w:color="$color"/>
</w:tblBorders>
<w:tblCellMar>
<w:left w:w="144" w:type="dxa" />
<w:right w:w="144" w:type="dxa" />
</w:tblCellMar>
<w:tblInd w:w="164" w:type="dxa" />
<w:tblW w:type="pct" w:w="100%"/>
<w:tblLook w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:noHBand="0" w:noVBand="0" w:val="0000" />
</w:tblPr>
<w:tr>
<w:trPr>
Expand Down Expand Up @@ -105,6 +104,7 @@ local function calloutDocxDefault(node, type, hasIcon)

-- close the table
local suffix = pandoc.List({pandoc.RawBlock("openxml", [[
<w:p/>
</w:tc>
</w:tr>
</w:tbl>
Expand All @@ -125,16 +125,19 @@ local function calloutDocxSimple(node, type, hasIcon)
<w:tbl>
<w:tblPr>
<w:tblStyle w:val="Table" />
<w:tblLook w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:noHBand="0" w:noVBand="0" w:val="0000" />
<w:tblInd w:w="164" w:type="dxa" />
<w:tblBorders>
<w:left w:val="single" w:sz="24" w:space="0" w:color="$color"/>
</w:tblBorders>
<w:tblCellMar>
<w:left w:w="0" w:type="dxa" />
<w:right w:w="0" w:type="dxa" />
</w:tblCellMar>
<w:tblInd w:w="164" w:type="dxa" />
<w:tblLook w:firstRow="0" w:lastRow="0" w:firstColumn="0" w:lastColumn="0" w:noHBand="0" w:noVBand="0" w:val="0000" />
</w:tblPr>
<w:tblGrid>
<w:gridCol w:w="7920" />
</w:tblGrid>
<w:tr>
<w:trPr>
<w:cantSplit/>
Expand Down
Binary file modified tests/docs/smoke-all/2024/01/31/8507.docx.snapshot
Binary file not shown.