Skip to content

Commit

Permalink
Add grid_tables extra argument
Browse files Browse the repository at this point in the history
  • Loading branch information
ReinderVosDeWael committed Apr 25, 2024
1 parent 6288d86 commit d118172
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.ruff_cache
.vscode
local

.DS_Store
local_run.py
Expand Down
8 changes: 7 additions & 1 deletion src/ctk_functions/functions/file_conversion/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ def markdown2docx(markdown: str) -> bytes:
The .docx file.
"""
with tempfile.NamedTemporaryFile(suffix=".docx") as temp_file:
pypandoc.convert_text(markdown, "docx", format="md", outputfile=temp_file.name)
pypandoc.convert_text(
markdown,
"docx",
format="md",
outputfile=temp_file.name,
extra_args=["-f", "markdown+grid_tables"],
)
temp_file.seek(0)
return temp_file.read()

0 comments on commit d118172

Please sign in to comment.