You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: add heading hierarchy check and fix set -e crash in validate_docs.sh
Two issues fixed:
1. **Bug fix**: `((WARNINGS++))` and `((ERRORS++))` with `set -e` causes
the script to exit prematurely when the counter is 0, because bash
treats `((0))` as falsy (exit code 1). Replaced with
`WARNINGS=$((WARNINGS + 1))` which always succeeds.
2. **New check**: Added TYPO3 heading hierarchy validation that detects:
- First section heading not using `=` (h2) — catches the common issue
where sections extracted from a parent page retain their old heading
levels (e.g. `-` for h3 instead of `=` for h2)
- Non-standard underline characters (e.g. `^` instead of `=/-/~`)
- Skipped heading levels (e.g. h2 directly to h4 without h3)
The check follows TYPO3 heading convention:
- h1: `=` above and below (page title)
- h2: `=` below only (sections)
- h3: `-` below only (subsections)
- h4: `~` below only (sub-subsections)
This would have caught the heading issues reported in
TYPO3-Documentation/TYPO3CMS-Guide-HowToDocument#510.
Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
0 commit comments