configs
/configs contains site config constants and types only; it loads neither the parser nor React. Config is fixed when the parser is created; mutating the original object afterwards has no effect.
Constants
Fields come from upstream wikiparser-node. The library exports neither a normalization function nor source constants; the minimum config is not part of the public API. Read it from the upstream package yourself if you need it and accept the degraded behavior.
Creating a parser
- The factory deep-copies and normalizes config: it fills
excludes, normalizesdoubleUnderscore, and performs a minimal shape check. - Invalid config throws
WikitextParseError("INVALID_CONFIG"). - Changing config requires a new parser, so parsing never mutates shared config implicitly.
defaultsare per-parser defaults that each call can override; budget merging is described in Parsing/parse.
Custom site config
For site differences, copy MEDIAWIKI_CONFIG and adjust fields; this is the supported path. Do not rely on the upstream minimum config as a public option: it silently degrades <ref>, <gallery>, and file parameters, and the library makes no compatibility promise for it. If you genuinely need minimal recognition, read wikiparser-node/config/minimum.json and convert it to ParserConfig yourself after confirming those degradations are acceptable.
Relation to budgets
Site config does not contain parse budgets. Source length, node counts, and depth are parse options merged as "per-call → factory defaults → shared defaults"; see Parsing /parse.
Related
- Parsing
/parse:createWikiparserand parse options. - Status and compatibility: pinned upstream versions.