Fix nested code fences
Skill slogsdon/skills-vault-knowledge/skills/fix-nested-code-fences
Use when a markdown file has nested code fences that break rendering — when a ```markdown, ```bash, or similar block appears inside another ``` block anywhere in a generated or edited markdown file.From its SKILL.md
npx -y skills add slogsdon/skills-vault-knowledge --skill fix-nested-code-fencesAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.4 KB, 266 tokens by cl100k_base, as published. Nobody here has run it
Skill: fix-nested-code-fences
When a code block contains inner triple-backtick fences, replace the outer fence with ~~~ — the minimum change that fixes rendering without altering any content.
Don't: change inner fences — only the outer fence needs replacing. Don't apply this to tilde fences that are already correct.
The Problem
When markdown is generated or written that contains code block examples inside other code blocks, the inner fences terminate the outer block early, breaking rendered output. Common in: skill templates, documentation generators, README examples, any file where markdown is shown inside markdown.
The Fix
Replace the outer fence with ~~~ when the block contains inner ``` fences. Inner fences stay as-is.
Before:
```markdown
## Example
```bash
VAR=value
```
```
After:
~~~markdown
## Example
```bash
VAR=value
```
~~~
Steps
- Read the file
- Find any fenced code block that contains inner
```fences - Replace the outer opening and closing fences with
~~~ - Leave inner fences unchanged
- Confirm the fix and offer to commit if in a git repo
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.