|
|
1 месяц назад | |
|---|---|---|
| .. | ||
| README.md | 1 месяц назад | |
| regressions.js | 1 месяц назад | |
| run.sh | 1 месяц назад | |
| shim.js | 1 месяц назад | |
| spec-test.js | 1 месяц назад | |
| spec-tests.json | 1 месяц назад | |
JS tests for the stm-markdown renderer in js/statum.js. These are the
repository's first JavaScript tests; they run under
QuickJS so no Node.js is required.
tests/markdown/run.sh # regressions + spec suite, gates on 95%
tests/markdown/run.sh -v # also list every failing spec example
run.sh builds the vendored QuickJS interpreter on first use
(tools/qjs/build.sh, ~20s with gcc; the binary is gitignored) and reuses a
system qjs when one is on PATH.
regressions.js — hand-written cases: the three reported bugs
(emphasis spanning a line break, single newlines must not start
paragraphs, wrapped lines must stay inside list items), the security
posture (raw HTML neutralised, javascript:/data:/vbscript: URL
filtering, entity smuggling), and edge cases (CRLF, empty input,
tight vs loose lists, setext headings).spec-test.js — the official CommonMark 0.31.2 example suite (655
examples, extracted from the spec with spec_tests.py --dump-tests into
spec-tests.json), compared after cmark-style whitespace normalisation.The renderer keeps Statum's escape-first security posture, so two spec sections are out of scope and excluded from the denominator:
A handful of in-scope examples also differ by design:
href is replaced with # (<irc://…>, <made-up-scheme:…>).Current score: 96.4% of the 588 in-scope examples.
git clone https://github.com/commonmark/commonmark-spec /tmp/cmspec
python3 /tmp/cmspec/test/spec_tests.py -s /tmp/cmspec/spec.txt --dump-tests \
> tests/markdown/spec-tests.json