Skip to content

Commit c2b8e61

Browse files
committed
check and intercept run-python marco in md_to_pptx
1 parent d0389bd commit c2b8e61

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tools/md_to_pptx/md_to_pptx.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ def _invoke(self, tool_parameters: dict) -> Generator[ToolInvokeMessage, None, N
3030
# get parameters
3131
md_text = get_md_text(tool_parameters)
3232
pptx_template_file: Optional[File] = tool_parameters.get("pptx_template_file")
33+
34+
# check parameters
35+
if "```run-python" in md_text:
36+
raise ValueError("The `run-python` marco of md2pptx is not allowed.")
3337
if pptx_template_file and not isinstance(pptx_template_file, File):
3438
raise ValueError("Not a valid file for pptx template file")
3539

0 commit comments

Comments
 (0)