📝 CHECKPOINT.md

Checkpoint: MD BBCode Mod — GFM Conformance Pass

Purpose: bring Andrew's SMF Markdown BBCode mod (MDParser.php/MDBBC.php) up to a level of GFM spec conformance good enough to satisfy SMF's lead dev, who recommended testing against the full GFM spec (https://github.github.com/gfm/) after reviewing the mod for possible official SMF inclusion.

Files / components

File Status Use it?
MDParser.php (this session's patched version, attached) Patched: emphasis rewrite, loose/tight lists, indented-code blank-line merging, link destination fixes, code span fix, bare-URL/www/email autolinking Yes — this is the current working version, supersedes the originally-uploaded copy
MDBBC.php (originally uploaded) Untouched this session — no changes were needed Yes, unchanged
MD_SYNTAX_MANUAL.md (attached) Full table of every currently-supported syntax element + raw/rendered examples, generated from the actual current parser Yes — hand this to anyone (including SM) who wants to see current scope
extract_spec.py (attached) One-time script: pulls cmark-gfm's test/spec.txt and converts it to spec.json (672 examples, tagged by section/extension) Only needed if spec.json (attached separately) is ever lost — otherwise skip straight to run_tests.php
spec.json (attached) Already-extracted output of extract_spec.py — the 672-example test suite itself Yes — drop it next to MDParser.php and run_tests.php, no re-fetch needed
run_tests.php (attached) Runs MDParser.php against every example in spec.json, writes results.json Re-run after every parser change
analyze.py (attached) Reads results.json, applies a "cosmetic-diff-tolerant" normalizer (strips our own CSS classes, rel= attribute, self-closing-tag style, tag-per-line formatting) to separate real bugs from harmless serialization differences; writes real_failures.json and prints per-section pass rates Re-run after every run_tests.php run

Verified facts — don't re-check

Open items (decisions, not blockers)

Next actual action

Run analyze.py's per-section breakdown on the current real_failures.json. Links is now largely down to reference-style-link failures (out of scope) plus a handful of exotic raw-HTML-mixed-with-brackets edge cases — List items (32/48) and Lists (13/26) are the next-best-value targets. Starting a fresh session should: install php-cli (apt-get install -y php-cli, no sudo needed), drop all six attached files in one directory, then run php run_tests.php && python3 analyze.py, and pick up from there.