v4.0.6
Summary
Release meta
Released on: 2026-07-26
Released by: ggrossetie
Published by: GitHub
Logs: full diff
Changelog
Bug Fixes
- Fix
AbstractNode#imageUri()no longer percent-encoding spaces in adata:URI image target (e.g.image::data:image/svg+xml,<svg ...><text>a b</text></svg>[]), a regression from the data URI image target support added for inline SVG embedding. That change short-circuitedimageUri()for anydata:target by returning it unchanged, bypassing the space-encoding thatnormalizeWebPath()still applies for every other URI-ish target — and that upstream Asciidoctor (Ruby) also applies, sinceimage_urihas nodata:-specific early return at all.imageUri()now runsdata:targets throughencodeSpacesInUri()before returning them, matching Ruby’s output byte-for-byte, while still avoiding the spuriouscould not retrieve image data from URIwarning the earlier fix was meant to prevent - Fix
tasks/changelog.js notes(used to generate GitHub release notes) leaving AsciiDoc attribute references such as[#1857](https://github.com/asciidoctor/asciidoctor.js/issues/1857)unresolved in the generated Markdown.extractReleaseNotesused to extract the raw AsciiDoc section for a release and convert only that fragment to Markdown, losing the:uri-repo:attribute definition from the changelog header in the process. The whole changelog is now converted to Markdown once, and the release section is extracted from the resulting Markdown instead, so attribute references resolve correctly - Type
Logger#warn()/#debug()/#info()/#error()/#fatal()/#unknown()/#log()(and the matchingMemoryLoggermethods) with an optionalprogname/pnparameter instead of a required one. The generated.d.tspreviously declared both arguments as mandatory, so callingdoc.getLogger().warn(doc.messageWithContext(...))with a single argument — the documented pattern for logging from an extension — was flagged by editors as "expected 2 arguments" even though it is valid at runtime; the error surfaced becausegetLogger()resolves to theLoggerLikeunion (Logger | MemoryLogger | NullLogger | Console) and TypeScript requires a call to satisfy every member’s signature - Type
messageWithContext()/createLogMessage()onDocument,ConverterBase,PathResolver, andTable.ParserContext(and the static equivalents onParser). These are installed at runtime by theapplyLogging()mixin (logging.js) after the class body closes, sotsc’s JSDoc-based declaration emit never picked them up —doc.messageWithContext(...)`, the pattern shown in the extensions guide, previously had no type at all on the public API surface
Infrastructure
- Add compile-only type tests for the Logger/MemoryLogger/NullLogger API and the
LoggerLikeunion (test/types/logging.test-d.ts, run bynpm run test:types), covering every shorthand log method across single- and two-argument call forms, theapplyLogging()consumers listed above, and negative@ts-expect-errorchecks (e.g.fatal()/unknown()are intentionally unavailable on the rawLoggerLikeunion becauseConsolehas neither, but resolve once narrowed away fromConsole)