v4.0.5
Summary
Release meta
Released on: 2026-07-21
Released by: ggrossetie
Published by: GitHub
Logs: full diff
Changelog
Bug Fixes
- Fix
Document#getLogger()(andgetLogger()on any prototype augmented byapplyLogging():Converter,Parser,PathResolver,Table.ParserContext) silently ignoring a per-instance override of theloggergetter, even though its own JSDoc describes it as "a method alias for theloggergetter".applyLogging()(logging.js) installedgetLoggeras a fixed arrow function with nothisbinding, so it always fell back to the globalLoggerManager.loggerinstead of resolving throughthis.logger— breaking theloggeroption toconvert()/load()once the async-local-storage scope fromload()had closed (i.e. duringdoc.convert(), when most block/inline converters and extensions run). Extensions/converters that follow the documenteddoc.getLogger()pattern (e.g. to log a warning withmessageWithContext()) would have those messages silently escape a caller-supplied logger such as aMemoryLogger - Fix inline macro extensions ignoring the
contentModel/positionalAttrs(or the DSLcontentModel()/positionalAttributes()/resolveAttributes()setters) configuration, so the macro’s bracket content was never parsed into named/positional attributes and always ended up as a raw string inattributes.textinstead — e.g.registry.inlineMacro(function () { this.named('emoji'); this.positionalAttributes('size'); this.process(...) })produced{ text: '2x' }instead of{ '1': '2x', size: '2x' }foremoji:smile[2x].Substitutors#subMacros(the inline macro substitution path insubstitutors.js) read the extension config with keys that were never populated by the DSL/static config (#1857)
Improvements
- Extension
Processorconfig keys (contentModel,positionalAttrs,defaultAttrs) now usecamelCaseconsistently across every registration style — the DSL setters, class-basedstatic config, and the block/inline macro substitution code that reads them. The legacy Ruby-stylesnake_casekeys (content_model,positional_attrs,pos_attrs,default_attrs) are still accepted for backward compatibility when a processor class declares its config directly (static config = { content_model: 'attributes' }orMyProcessor.config = { content_model: 'attributes' }).Processor.configalso gained a static setter, so assigning a static config object after the class declaration (as shown in theBlockMacroProcessor/InlineMacroProcessorJSDoc examples) no longer throws aTypeError - Type
AbstractNode#logger/#getLogger()andReader/PreprocessorReader#logger/#getLogger()/#createLogMessage()with the newLoggerLikeunion (Logger | MemoryLogger | NullLogger | Console, exported fromlogging.js) instead of a bareobject. Inreader.js, fields and helper methods that are only ever touched within the class that declares them (Reader’s cursor mark,PreprocessorReader’s include/conditional-directive bookkeeping) are now real JS#privatemembers instead of_-prefixed by convention; the remaining_-prefixed fields thatPreprocessorReadermust read/reassign (_dir,_document,_lines, …) are annotated@internalso they’re stripped from the generated public.d.tswithout changing runtime access