-
Notifications
You must be signed in to change notification settings - Fork 201
Open
Description
Description
A Markdown file containing a relative link to a shell script (for example, [this script](./scripts/setupServiceKey.sh)) causes mark to process the non-markdown file as a candidate Confluence page, attempting metadata extraction and a Confluence page API request. This results in a build failure when the API cannot resolve the script file as a Confluence page.
Reproduction
Directory structure:
test-confluence-syndication/
├── SERVICE_KEYS.md
└── scripts/
└── setupServiceKey.sh
SERVICE_KEYS.md content:
# SERVICE_KEYS Testing
This is a test document with a relative link to [this script](./scripts/setupServiceKey.sh).scripts/setupServiceKey.sh content:
#!/usr/bin/env bash
echo "test"Run mark (v15.3.0):
docker run --rm -it -v "$PWD:/work" -w /work \
kovetskiy/mark@sha256:5946929029b861ca89a46828292273a19d5694c833a4c07b5bd4c33660ea19b2 \
mark --log-level TRACE \
-b "https://confluence.example.com/wiki" \
-u "user@example.com" \
-p "YOUR_TOKEN" \
--title-from-h1 \
--space "YOUR_SPACE" \
--parents "Parent Page" \
-f "./SERVICE_KEYS.md"Observed Behaviour
TRACE found a relative link: full=./scripts/setupServiceKey.sh filename=./scripts/setupServiceKey.sh hash=
TRACE filepath: scripts/setupServiceKey.sh
TRACE extracted metadata: space=~5c66e71d9f5b482e28d63e77 title=/usr/bin/env bash
TRACE rest: GET /wiki/rest/api/content/?expand=ancestors%2Cversion&spaceKey=~5c66e71d9f5b482e28d63e77&title=%2Fusr%2Fbin%2Fenv+bash&type=page
FATAL unable to resolve relative links
└─ resolve link: "./scripts/setupServiceKey.sh"
└─ find confluence page: scripts/setupServiceKey.sh / ~5c66e71d9f5b482e28d63e77 / /usr/bin/env bash
└─ api: find page
└─ the Confluence API returned unexpected status: 403 Forbidden
Root Cause
Mark treats the shell script as a markdown file:
- Detects the relative link
./scripts/setupServiceKey.sh - Attempts to extract metadata from the script file
- Uses the shebang line
#!/usr/bin/env bashas the page "title" - Tries to find a Confluence page with the title
/usr/bin/env bash - Fails with 403 error
Expected Behaviour
Relative links to non-markdown files (e.g., .sh, .py, .txt) should not be treated as Confluence pages and should not block publishing.
Environment
- Mark version: v15.3.0
- Docker digest:
sha256:5946929029b861ca89a46828292273a19d5694c833a4c07b5bd4c33660ea19b2 - Confluence: Cloud (A disposable Confluence created only to test this issue)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels