Skip to content
Merged
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
44 changes: 44 additions & 0 deletions workflows/agentic-wiki-writer.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,50 @@ safe-outputs:
CONTENT=$(printf '%s' "$entry" | base64 -d | jq -r '.value')
printf '%s\n' "$CONTENT" > "$FILENAME"
done
- name: Sanitize Mermaid diagrams
run: |
python3 - <<'EOF'
import re, glob

def fix_mermaid_block(block):
# Remove backtick markdown-string syntax from node labels.
# GitHub's wiki renderer does not support mermaid markdown strings
# (e.g. A["`text`"]), causing "Unable to render rich display" errors.
# Pattern: "` inside_bt ` after_bt " -> " inside_bt after_bt "
def fix_backtick_label(m):
inside_bt = m.group(1)
after_bt = m.group(2)
combined = re.sub(
r'\s+', ' ',
(inside_bt + ' ' + after_bt).replace('\\n', ' ')
).strip()
return '"' + combined + '"'

fixed = re.sub(r'"`([^`]*)`([^"]*)"', fix_backtick_label, block)
# Fix any remaining \n escape sequences in labels (replace with space)
fixed = re.sub(r'\\n', ' ', fixed)
return fixed

def fix_file(path):
with open(path, encoding='utf-8') as f:
content = f.read()
parts = re.split(r'(```mermaid[^\n]*\n.*?```)', content, flags=re.DOTALL)
fixed = ''.join(
fix_mermaid_block(p) if p.startswith('```mermaid') else p
for p in parts
)
if fixed != content:
with open(path, 'w', encoding='utf-8') as f:
f.write(fixed)
return True
return False

changed = [f for f in glob.glob('*.md') if fix_file(f)]
if changed:
print(f'Fixed Mermaid syntax in: {", ".join(changed)}')
else:
print('No Mermaid syntax issues found')
EOF
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
Expand Down
Loading