B-8FL9-validate-markdown-structure-by-applying-json-schema-to-its-ast
Settle on a particular markdown AST library (e.g. mdast/remark) and, since the resulting AST is acyclic (a tree), apply a JSON Schema directly against it to validate document structure. This would give schema-driven structural validation of markdown docs without inventing a bespoke validation layer.