Auto-Fixers
Some Inspect findings include an auto-fix option. When available, Synapse can automatically transform your template HTML to resolve the issue, producing a corrected version and a reverse patch for undo.
How Auto-Fix Works
- Run an inspect -- trigger a Quick Check or Full Inspect on your template
- Review findings -- findings with auto-fix available are marked in the results
- Apply the fix -- the auto-fixer modifies the template AST to resolve the issue
- Undo if needed -- every auto-fix produces a reverse patch, so you can revert the change
Auto-fixes are applied to the template's structured AST (V2 templates), not raw HTML strings. This ensures changes are precise and reversible.
Currently Supported Auto-Fixers
| Finding Code | What It Fixes |
|---|---|
HTML_MISSING_DOCTYPE | Adds <!DOCTYPE html> declaration |
HTML_MISSING_CHARSET | Adds <meta charset="utf-8"> to <head> |
HTML_MISSING_LANG | Adds lang="en" to the <html> tag |
HTML_MISSING_VIEWPORT | Adds viewport meta tag to <head> |
HTML_MISSING_TITLE | Adds a <title> tag to <head> |
DARK_MODE_NO_META | Adds color-scheme meta tag |
DARK_MODE_NO_CSS_SCHEME | Adds supported-color-schemes meta tag |
DM005 | Adds MSO dark-mode override conditional |
DARK_MODE_HARDCODED_BG | Defines a dark-mode CSS variant for hardcoded backgrounds |
DARK_MODE_HARDCODED_TEXT | Defines a dark-mode CSS variant for hardcoded text colors |
DARK_MODE_LOGO_NO_SWAP | Adds dark-mode logo image swap markup |
Limitations
- Auto-fixers only work with V2 templates (templates stored with
body_ast). V1 templates must be manually fixed. - Not all findings are auto-fixable. Complex issues like invalid HTML nesting or spam keyword density require manual intervention.
- Auto-fixes are best-effort -- always review the result before sending.
Note
The auto-fix registry is extensible. New fixers are added as the findings catalog grows.