Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 28 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@ on:
branches: [main]

jobs:
# Every job below declares its own `permissions:` block, so the workflow
# token cannot gain write access by accident. None of these jobs pushes a
# commit, creates a release or uploads release assets -- the .difypkg and the
# .vsix leave the workflow as Actions artifacts (the artifact API), not as
# repository contents -- so `contents: read` is enough for all five.
dify-plugin:
name: Dify plugin tests
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
Expand All @@ -26,9 +33,9 @@ jobs:
run:
working-directory: dify-plugin-MD2Docx
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: actions/setup-python@v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"

Expand All @@ -47,7 +54,7 @@ jobs:
run: python scripts/package.py --output dist/MD2Docx.difypkg

- name: Upload plugin package
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: MD2Docx-dify-plugin-${{ matrix.dify-plugin-version }}
path: dify-plugin-MD2Docx/dist/MD2Docx.difypkg
Expand All @@ -56,13 +63,15 @@ jobs:
vsc-plugin:
name: VS Code plugin tests
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
working-directory: VSC-plugin-MD2Docx-Converter
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: actions/setup-node@v7
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "24"

Expand All @@ -82,7 +91,7 @@ jobs:
run: npm run package

- name: Upload the VSIX
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: mdocx-converter-vsix
path: VSC-plugin-MD2Docx-Converter/*.vsix
Expand All @@ -91,22 +100,26 @@ jobs:
template-sync:
name: Template sync check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Verify the Dify templates match the VS Code source of truth
run: bash scripts/sync-templates.sh --check

preset-parity:
name: Preset parity check
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: actions/setup-python@v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"

- uses: actions/setup-node@v7
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "24"

Expand All @@ -130,14 +143,16 @@ jobs:
dependency-audit:
name: Dependency audit
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- uses: actions/setup-python@v7
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.12"

- uses: actions/setup-node@v7
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "24"

Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@

name: CodeQL

# Read-only at the workflow level. `security-events: write` is granted to the
# analyze job only -- the workflow token must not be able to write outside the
# job that actually uploads the SARIF results.
permissions:
contents: read
security-events: write
actions: read
packages: read

Expand All @@ -31,6 +33,13 @@ jobs:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
timeout-minutes: 30
# Job-level permissions replace the workflow-level ones, so the read
# permissions are repeated here and only the SARIF upload is writable.
permissions:
contents: read
actions: read
packages: read
security-events: write
strategy:
fail-fast: false
matrix:
Expand All @@ -40,16 +49,16 @@ jobs:
- language: python
paths: dify-plugin-MD2Docx
steps:
- uses: actions/checkout@v7
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
uses: github/codeql-action/init@1bd86f2fdb4b86187fa4059f16f31a3202acc9ea # v4.39.4
with:
languages: ${{ matrix.language }}
paths: ${{ matrix.paths }}
queries: security-and-quality

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
uses: github/codeql-action/analyze@1bd86f2fdb4b86187fa4059f16f31a3202acc9ea # v4.39.4
with:
category: "/language:${{ matrix.language }}"
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 AlexMultiAgent

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# MD2Docx Converter

[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/AlexMultiAgent/mdocx-converter/badge)](https://api.scorecard.dev/projects/github.com/AlexMultiAgent/mdocx-converter)

Tools that convert Markdown to polished Word (`.docx`) documents, with built-in Chinese/English templates, Mermaid diagram rendering, and fine-grained style control.

The project ships the same conversion pipeline in two packaging formats — a VS Code extension for local editing and a Dify plugin for workflow automation.
Expand Down
48 changes: 48 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Security Policy

## Reporting a vulnerability

Report security problems privately through GitHub's private vulnerability reporting:

**https://github.com/AlexMultiAgent/mdocx-converter/security/advisories/new**

Please do not open a public issue for a vulnerability. A public report makes the problem known before a fix exists, which leaves every user of the two products exposed.

## What counts as a vulnerability

This repository ships two products that convert Markdown into Word documents:

- the **VS Code extension** in `VSC-plugin-MD2Docx-Converter/`
- the **Dify plugin** in `dify-plugin-MD2Docx/`

A report counts as a vulnerability when crafted input can make one of the products do something the user did not ask for, or expose data the user did not intend to share. Typical examples:

- Markdown input that makes a plugin read or write files outside the working directory, or run a command that was never requested
- a way around the Pandoc sandbox or the Mermaid Ink URL filter to pull content from an arbitrary host
- a template, profile or packaging path that allows traversal or injection
- a crash that a crafted document triggers reliably

Not vulnerabilities: rendering differences in the produced document, missing features, and problems in the third-party services the plugins call (Pandoc, Mermaid Ink, VS Code, Dify).

## What to expect

We aim to acknowledge a report within **7 days** and to publish a fix or a security advisory within **90 days**. We will keep you updated while the vulnerability is being investigated, and we will credit you in the advisory unless you prefer to stay anonymous.

Please include the affected product, its version, the input that reproduces the problem and what you observed. A minimal reproduction is worth more than a long description.

## Coordinated disclosure

We follow a coordinated disclosure practice: the reporter receives the fix and the advisory text before any details become public. We ask for a reasonable embargo until that advisory is ready, and we do not publish a vulnerability before the disclosure timeline above has been met. Every disclosure ends with a public advisory on the repository's Security Advisories page. If several vulnerabilities are reported at once, we may publish one advisory that covers all of them.

Advisories for already fixed vulnerabilities are published on the same page.

## Supported versions

Both products share a single version line. The current release is **0.5.0**.

| Version | Supported |
| --- | --- |
| 0.5.0 | Yes |
| < 0.5.0 | No |

Security fixes land on the current version line only, so please upgrade to 0.5.0 before testing a report.
21 changes: 21 additions & 0 deletions dify-plugin-MD2Docx/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 AlexMultiAgent

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading