Skip to content

Update dependency @asciidoctor/core to v4 - #556

Open
oxide-renovate[bot] wants to merge 1 commit into
mainfrom
renovate/asciidoctor-core-4.x
Open

oxide-renovate[bot] wants to merge 1 commit into
mainfrom
renovate/asciidoctor-core-4.x

Conversation

@oxide-renovate

@oxide-renovate oxide-renovate Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
@asciidoctor/core ^2.2.6 → ^4.0.0 age confidence

Release Notes

asciidoctor/asciidoctor.js (@​asciidoctor/core)

v4.1.0

Compare Source

Summary

Release meta

Released on: 2026-09-22
Released by: github-actions[bot]
Published by: GitHub

Logs: full diff

Changelog

Bug Fixes
  • Fix concurrent load()/convert() calls occasionally reporting include file not found (rendering Unresolved directive) -- or image to embed not found or not readable for a data-uri image -- for a file that does exist on disk. The lazy node:fs initializer, duplicated in reader.js and abstract_node.js, published its fs/promises handle one microtask ahead of the fs.constants it needs, so a call entering that window read F_OK/R_OK off undefined; the resulting TypeError was swallowed by the caller’s catch and turned into "the file does not exist". Both values are now published together, once both imports have resolved, and concurrent callers share a single initialization -- factored out into src/node_fs.js, so there is one such initializer for the whole package (#​1882)
  • Fix XmlSanitizeRx stripping only the first tag of a value. The regex was ported from Ruby without the global flag, while every call site passes it to String#replace, which — unlike Ruby’s gsub — replaces a single match without it. A value holding more than one tag kept everything after the first: doctitle({ sanitize: true }) and the partitioned DocumentTitle, the <meta name="author"> tag of the html5 and semantic-html5 backends, and the DocBook xreflabel attribute. Parser.processAuthors was unaffected: it built its own global copy, which now uses the shared regex
  • Fix the warning issued when an asset cannot be found or read (e.g. image::does-not-exist.svg[opts=inline]) always reporting the document as <stdin>. The docfile attribute was looked up on the node instead of on the document, and since docfile is only ever set as a document attribute the lookup never resolved (asciidoctor#4873)
Improvements
  • Add an experimental semantic-html5 backend (convert(input, { backend: 'semantic-html5' })) that maps every AsciiDoc node to the HTML element that carries its meaning -- <section>, <figure>/<figcaption>, <aside>, <blockquote>, <details>, <nav>, <time>... -- instead of the AsciiDoc.py-compatible wrapper <div>s of the default html5 backend, with ARIA roles, a <header>/<main>/<footer> page skeleton, an optional XML syntax (htmlsyntax=xml) and its own default stylesheet (asciidoctor-semantic.css, with automatic light/dark themes). This backend is experimental: it is the testbed for the modern HTML output effort started upstream (asciidoctor/asciidoctor#242), so its markup, class names and stylesheet may change in any release, and it does not replace the html5 backend. The converter class is exported as SemanticHtml5Converter. See What’s New for examples, and devdocs/semantic-html5-converter.adoc for the element mapping and design choices
  • Add an experimental build-time mode to the built-in highlightjs source highlighter: set :highlightjs-mode: build to colorize source blocks at conversion time instead of in the browser. It supports callouts, linenums, highlight= and start=, and embeds the theme stylesheet (:highlightjs-theme:, default github; :highlightjs-stylesheet: link to link the CDN instead). highlight.js is an optional peerDependency, loaded lazily; in the browser, the adapter falls back to client-side highlighting with a warning
  • Syntax highlighter adapters may now be asynchronous: the core awaits highlight() and docinfo(), so an adapter can use an async engine such as Shiki. Existing synchronous adapters are unaffected
Infrastructure
  • scripts/strip-internal.js now deletes a generated declaration file that is left with no content -- because every declaration it held was @internal, or because TypeScript emitted nothing for it -- instead of publishing an empty .d.ts (first hit by the new src/node_fs.js, whose exports are all internal)
  • Fix the type-generation post-processing (scripts/patch-jsdoc.js) losing the JSDoc of exported object literals that TypeScript synthesizes as namespaces: the comment on the declaration itself was never restored (only the per-property ones), and files in types/ subdirectories were never matched back to their src/ source. The published declarations now carry the previously dropped documentation for ContentModel, Extensions, HttpCacheManager, Logging, several rx namespaces and the experimental buildEngine

v4.0.11

Compare Source

Summary

Release meta

Released on: 2026-08-18
Released by: ggrossetie
Published by: GitHub

Logs: full diff

Changelog

Improvements
  • Add Options#getProgramName(), #getUsageLine(), and #getHelpDescription() to the extensible CLI (@asciidoctor/core’s cli.js), letting an extended CLI override just the program name shown by --help-- or the usage line/description individually -- the same wayInvoker#version()can already be overridden;#getHelpPreamble()` remains available to override the whole preamble as a last resort
Bug Fixes
  • Fix a footnote inside a list item or table cell being numbered (and listed in the footnotes block) ahead of an earlier footnote in a preceding paragraph, instead of in document order. List item and table cell text is substituted eagerly, ahead of normal body conversion, so any footnote there previously consumed the next footnote number immediately regardless of its actual position in the document; it’s now assigned a placeholder that resolves to the real, document-order number once real conversion reaches that block. Reading a list item’s or table cell’s text/getText() before conversion (e.g. from an extension) no longer fixes the wrong number either -- an unresolved footnote there now previews as 1 rather than consuming the real counter (#​1871)

v4.0.10

Compare Source

Summary

Release meta

Released on: 2026-08-17
Released by: ggrossetie
Published by: GitHub

Logs: full diff

Changelog

Bug Fixes
  • Fix the inline pass:[...] macro escaping its content instead of passing it through unmodified when no explicit substitution list is given, e.g. pass:[<u>underlined</u>] rendered as <u&gt;underlined</u&gt; instead of <u>underlined</u>. The passthrough’s subs was left undefined, which fell through to applySubs()’s NORMAL_SUBS` default parameter instead of the intended "no substitutions" behavior (#​1870)
  • Fix a footnote inside a list item or table cell not advancing the footnote counter, causing a subsequent footnote elsewhere in the document to reuse the same number and id (invalid HTML, and the later footnote reference would link to the earlier definition). List item and table cell text is substituted eagerly, ahead of normal body conversion, and the footnote counter was unconditionally reset afterwards; it now carries forward into conversion so later footnotes continue numbering from where these left off (#​1871)

v4.0.9

Compare Source

Summary

Release meta

Released on: 2026-08-16
Released by: ggrossetie
Published by: GitHub

Logs: full diff

Changelog

Bug Fixes
  • Fix the extension DSL this types (BlockProcessorDslInterface, BlockMacroProcessorDslInterface, InlineMacroProcessorDslInterface, and the document-processor DSLs for preprocessors, tree processors, postprocessors, include processors, and docinfo processors) missing the node-builder helpers -- createSection, createBlock, createList, createListItem, createImageBlock, createInline, parseContent, parseAttributes, and the createBlock/createInline shorthands (createParagraph, createOpenBlock, createExampleBlock, createPassBlock, createListingBlock, createLiteralBlock, createAnchor, createInlinePass) -- even though all of them are available at runtime on the bound processor instance, since every processor type shares the same Processor base class (matching Ruby’s Asciidoctor::Extensions::Processor)
  • Fix JSDoc Document type references across abstract_node.js, extensions.js, parser.js, syntax_highlighter.js, and table.js (and the corresponding generated .d.ts files) resolving to the ambient DOM Document type instead of Asciidoctor’s own Document class from document.js. None of those source files imported Document, so TypeScript resolved the unqualified name to lib.dom.d.ts — getDocument(), extension processor callbacks (Preprocessor#process(), TreeProcessor#process(), etc.), Parser methods, SyntaxHighlighterBase methods, and Table.Cell#getInnerDocument() were all typed against the browser DOM document rather than the Asciidoctor document, silently defeating type checking on any code calling Asciidoctor Document methods on the result
  • Fix logging.js logging a spurious CORS error to the console in some browsers (e.g. Firefox) on first use. The per-execution logger context lazily probes for node:async_hooks and falls back to null when unavailable, but the dynamic import('node:async_hooks') itself was still attempted in the browser, where it is treated as a cross-origin fetch and rejected -- caught safely, but still logged by the browser regardless. The import is now skipped entirely when process is undefined (i.e. outside Node.js)
Infrastructure
  • Add compile-only type tests (test/types/document_type.test-d.ts) guarding against the Document DOM-leak regression above, covering AbstractNode#getDocument(), Preprocessor/TreeProcessor/Postprocessor/IncludeProcessor/DocinfoProcessor’s process()/handles(), Registry#activate(), and SyntaxHighlighterBase’s docinfo()/writeStylesheet()/writeStylesheetToDisk()

v4.0.8

Compare Source

Summary

Release meta

Released on: 2026-08-06
Released by: ggrossetie
Published by: GitHub

Logs: full diff

Changelog

Improvements
  • Export Severity ({ DEBUG, INFO, WARN, ERROR, FATAL, UNKNOWN }) from @asciidoctor/core’s public API (index.jsandbrowser.js). Previously the constant existed only inside logging.jsand was not re-exported, so a custom logger built withLoggerManager.newLogger(name, { add })had no way to compare the (already-numeric)severity` argument against named levels without redeclaring the map by hand
  • Wire up the pipe constructor option on Logger (new Logger({ pipe })), mirroring Ruby’s Logger.new(logdev). It previously had no effect — _writeln() always wrote to process.stderr/console.error regardless of the option. pipe now accepts anything with a write(line) method, or a function called as (line, severity) — the numeric severity lets a function-style pipe route by level (e.g. console.error for ERROR+, console.warn for WARN) without subclassing Logger, overriding add(), or touching the internal _writeln() method
Infrastructure
  • Add compile-only type tests (test/types/logging.test-d.ts) covering the Logger constructor’s pipe option (both the object {write} form and the severity-aware (line, severity) function form, plus a negative @ts-expect-error case for an invalid pipe value) and LoggerManager.newLogger()’s add/postConstruct` override shape

v4.0.7

Compare Source

Summary

Release meta

Released on: 2026-07-31
Released by: ggrossetie
Published by: GitHub

Logs: full diff

Changelog

Bug Fixes
  • Fix PathResolver#partitionPath()/#expandPath() dropping a slash from file:/// (and other triple-slash) URIs, turning file:///Users/guillaume/foo.png into file://Users/guillaume/foo.png — a malformed URL whose "host" (Users) browsers reject as Not allowed to load local resource. UriSniffRx only ever matches up to 2 slashes after the scheme, so for a triple-slash URI the 3rd slash is left in the remainder to partition into segments; partitionPath() unconditionally filtered out all empty segments (including that leading one), silently discarding the information needed to reconstruct the slash on joinPath(). It now mirrors Ruby’s String#split('/') semantics and drops only trailing empty segments, keeping leading ones intact

v4.0.6

Compare Source

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 a data: 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-circuited imageUri() for any data: target by returning it unchanged, bypassing the space-encoding that normalizeWebPath() still applies for every other URI-ish target — and that upstream Asciidoctor (Ruby) also applies, since image_uri has no data:-specific early return at all. imageUri() now runs data: targets through encodeSpacesInUri() before returning them, matching Ruby’s output byte-for-byte, while still avoiding the spurious could not retrieve image data from URI warning the earlier fix was meant to prevent
  • Fix tasks/changelog.js notes (used to generate GitHub release notes) leaving AsciiDoc attribute references such as [#&#8203;1857](https://redirect.github.com/asciidoctor/asciidoctor.js/issues/1857) unresolved in the generated Markdown. extractReleaseNotes used 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 matching MemoryLogger methods) with an optional progname/pn parameter instead of a required one. The generated .d.ts previously declared both arguments as mandatory, so calling doc.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 because getLogger() resolves to the LoggerLike union (Logger | MemoryLogger | NullLogger | Console) and TypeScript requires a call to satisfy every member’s signature
  • Type messageWithContext()/createLogMessage() on Document, ConverterBase, PathResolver, and Table.ParserContext (and the static equivalents on Parser). These are installed at runtime by the applyLogging() mixin (logging.js) after the class body closes, so tsc’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 LoggerLike union (test/types/logging.test-d.ts, run by npm run test:types), covering every shorthand log method across single- and two-argument call forms, the applyLogging() consumers listed above, and negative @ts-expect-error checks (e.g. fatal()/unknown() are intentionally unavailable on the raw LoggerLike union because Console has neither, but resolve once narrowed away from Console)

v4.0.5

Compare Source

Summary

Release meta

Released on: 2026-07-21
Released by: ggrossetie
Published by: GitHub

Logs: full diff

Changelog

Bug Fixes
  • Fix Document#getLogger() (and getLogger() on any prototype augmented by applyLogging(): Converter, Parser, PathResolver, Table.ParserContext) silently ignoring a per-instance override of the logger getter, even though its own JSDoc describes it as "a method alias for the logger getter". applyLogging() (logging.js) installed getLogger as a fixed arrow function with no this binding, so it always fell back to the global LoggerManager.logger instead of resolving through this.logger — breaking the logger option to convert()/load() once the async-local-storage scope from load() had closed (i.e. during doc.convert(), when most block/inline converters and extensions run). Extensions/converters that follow the documented doc.getLogger() pattern (e.g. to log a warning with messageWithContext()) would have those messages silently escape a caller-supplied logger such as a MemoryLogger
  • Fix inline macro extensions ignoring the contentModel/positionalAttrs (or the DSL contentModel()/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 in attributes.text instead — e.g. registry.inlineMacro(function () { this.named('emoji'); this.positionalAttributes('size'); this.process(...) }) produced { text: '2x' } instead of { '1': '2x', size: '2x' } for emoji:smile[2x]. Substitutors#subMacros (the inline macro substitution path in substitutors.js) read the extension config with keys that were never populated by the DSL/static config (#​1857)
Improvements
  • Extension Processor config keys (contentModel, positionalAttrs, defaultAttrs) now use camelCase consistently across every registration style — the DSL setters, class-based static config, and the block/inline macro substitution code that reads them. The legacy Ruby-style snake_case keys (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' } or MyProcessor.config = { content_model: 'attributes' }). Processor.config also gained a static setter, so assigning a static config object after the class declaration (as shown in the BlockMacroProcessor/InlineMacroProcessor JSDoc examples) no longer throws a TypeError
  • Type AbstractNode#logger/#getLogger() and Reader/PreprocessorReader#logger/#getLogger()/#createLogMessage() with the new LoggerLike union (Logger | MemoryLogger | NullLogger | Console, exported from logging.js) instead of a bare object. In reader.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 #private members instead of _-prefixed by convention; the remaining _-prefixed fields that PreprocessorReader must read/reassign (_dir, _document, _lines, …) are annotated @internal so they’re stripped from the generated public .d.ts without changing runtime access

v4.0.4

Compare Source

Summary

Release meta

Released on: 2026-07-15
Released by: ggrossetie
Published by: GitHub

Logs: full diff

Changelog

Improvements
  • Declare the instance form ("style 3") of the Registry extension registration methods in the TypeScript typings. The runtime has always accepted an already-constructed processor (registry.includeProcessor(new MyIncludeProcessor())) in addition to the class and registration-function forms, but the 4.0 typings only declared the latter two, forcing consumers such as the VS Code AsciiDoc extension to augment the module by hand. preprocessor, treeProcessor, postprocessor, includeProcessor, docinfoProcessor, block, blockMacro and inlineMacro now expose an overload accepting a processor instance (the syntax processor methods also accept the optional explicit name), and the compile-only type tests cover the instance form
  • Type the filter callback accepted by AbstractBlock#findBy (and its query alias) as (node: AbstractBlock) => boolean | string instead of the bare Function, so the candidate node passed to the callback resolves as an AbstractBlock without casts — both in the two-argument form and in the findBy(callback) shorthand
  • Type the reader received by preprocessor and include processor callbacks as PreprocessorReader instead of Reader, and export PreprocessorReader from the package root. Preprocessor#process, IncludeProcessor#process and the matching DSL process(fn) callbacks actually receive a PreprocessorReader at runtime, so its members (pushInclude, getIncludeDepth, …) now resolve without casts or manual module augmentation
Infrastructure
  • Display the package version number in the generated TypeDoc API documentation (includeVersion option), so both the @asciidoctor/core API docs and the asciidoctor CLI docs show which release they document (e.g. @asciidoctor/core - v4.0.3)
  • Publish a major.minor alias of the TypeDoc API documentation on each stable release — e.g. releasing v4.0.4 (re)deploys the docs to both 4.0.4/ and 4.0/ on GitHub Pages, so the 4.0 URL always points to the documentation of the latest 4.0.x release
  • Simplify the release workflow: the intermediate "Bump version for release" workflow (release-bump.yml) is gone — the Release workflow is now dispatched directly with the version to release and performs the whole chain (bump + tag, build, npm publish, GitHub release, docs) in a single run, from main or from a maintenance branch (e.g. 4.0.x or v4.0.x). The git commands (commit, tag, push) live in the workflow itself; the release scripts are reduced to three focused tools: tasks/version.js <version> (sets both package versions and keeps the asciidoctor → @asciidoctor/core dependency in sync), tasks/changelog.js release <version> (rolls the Unreleased section into a dated release section) / tasks/changelog.js notes <version> (prints the Markdown release notes of a version to stdout), and tasks/publish.js (publishes both packages to npmjs). tasks/release.js, scripts/publish.sh, the npm run release script and the skip_publish input are gone (use GitHub’s "Re-run failed jobs" to resume a partially failed release). The reusable build and native-image workflows accept a ref input so the release builds the tagged commit (with the bumped version) rather than the pre-bump branch head
  • Publishing a maintenance release no longer steals the npm latest dist-tag: when the version being published is older than the currently published latest (e.g. releasing 4.0.5 while 4.1.0 is out), the packages are published under a latest-<major>.<minor> dist-tag (e.g. latest-4.0, following the latest-2 convention already used for the 2.x line) instead

v4.0.3

Compare Source

Summary

Release meta

Released on: 2026-07-13
Released by: github-actions[bot]
Published by: GitHub

Logs: full diff

Changelog

Bug Fixes
  • Fix AsciiDoc table cells (a) losing their content when they belong to a table that is itself nested inside another AsciiDoc cell — the deeper cells rendered as an empty <div class="content"></div> (text became invisible). Document#convert computes each AsciiDoc cell’s inner content in _convertAsciiDocCells, but that pass only ran on the root document (guarded by !parentDocument) and, when it converted an AsciiDoc cell’s inner document, never recursed into the tables inside that inner document. So a nested table’s own AsciiDoc cells were rendered before their _innerContent was ever set. The pass now recurses into a cell’s inner document before rendering it, so AsciiDoc cells at any nesting depth have their content computed first

v4.0.2

Compare Source

Summary

Release meta

Released on: 2026-07-06
Released by: github-actions[bot]
Published by: GitHub

Logs: full diff

Changelog

Improvements
  • The HTML5 converter can now inline an SVG image whose target is a data: URI (e.g. image::data:image/svg+xml;base64,…[opts=inline]). readSvgContents decodes both Base64 and percent-encoded data: payloads instead of only reading from a file or remote URI, so a diagram or image embedded as a data-URI can be rendered as inline <svg> without writing a file or enabling allow-uri-read. The SVG format is inferred from the image/svg+xml media type, so an explicit format=svg attribute is no longer required on a data: URI target
Bug Fixes
  • imageUri now returns a data: URI image target as-is instead of attempting to read it as a file or fetch it via the Fetch API; previously, with both data-uri and allow-uri-read set, a data: URI target (e.g. data:image/png;base64,…) triggered a spurious "could not retrieve image data from URI" warning
  • Fix the built-in asciidoctor-version attribute reporting the hard-coded upstream Ruby version (3.0.0.dev) instead of the actual library version — it now resolves to the @asciidoctor/core package version (e.g. 4.0.1), so references such as {asciidoctor-version} reflect the real release
  • Report Asciidoctor.js (instead of Asciidoctor) in the HTML5 <meta name="generator"> and manpage Generator: metadata, so the generated output identifies the JavaScript library and its version (e.g. Asciidoctor.js 4.0.1)
  • Fix natural cross-references (e.g. <<Some section title>>) not resolving inside list items, description list items and table cells — they rendered as <a href="#Some section title">[Some section title]</a> instead of linking to the section’s generated ID. Unlike paragraph text (substituted lazily during conversion, after the reftext→id map is built), list/cell/dlist text is pre-computed eagerly in _resolveAllTexts, which ran before the map existed; the synchronous resolveId fallback then matched against the raw reftext attribute rather than the computed xreftext (a section’s title), so the lookup failed. Text pre-computation now runs in two passes — titles and reftexts first, then the reftext→id map is built, then list/cell/dlist content text — restoring Ruby’s invariant that all references are known before any content substitution resolves a natural cross-reference
  • Fix a registered converter’s flat string trait properties (convention #2, e.g. converter.outfilesuffix = '.html') being silently overwritten with accessor functions after the first conversion — normalizing the converter applied the BackendTraits mixin, which installed same-named accessor methods on the instance, clobbering the author’s strings. Code reading converter.outfilesuffix then got a function instead of .html (and only after normalization, so the value’s type changed mid-lifecycle). applyBackendTraits no longer overwrites an existing same-named data property, and Document reads backend traits through _getBackendTraits() rather than the accessor methods, so flat string properties stay strings throughout
  • Fix JavaScript templates not being applied depending on their file extension and the project’s module format (#​1841) — a .js template in a "type": "module" (ESM) project crashed with template.render is not a function, and .mjs templates were silently ignored (the extension was not even recognised). The template loader used a CommonJS require() for .js/.cjs files, which returned the ESM namespace object (not the render function) for ESM .js files and did not handle .mjs at all. .js and .mjs templates are now loaded with a dynamic import() (which Node resolves as either ESM or CommonJS) and the render function is taken from the module’s default export, so all combinations of extension (.js, .cjs, .mjs) and module format (ESM or CommonJS) work. The same loading is applied to the optional helpers file (helpers.js/helpers.cjs/helpers.mjs), which can now also be an ES module

v4.0.1

Compare Source

Summary

Release meta

Released on: 2026-07-01
Released by: github-actions[bot]
Published by: GitHub

Logs: full diff

Changelog

Bug Fixes
  • Fix reassigned document-body attributes all resolving to their final value — a custom attribute redefined in the body (e.g. :reassigned: one … :reassigned: two) must resolve to the value in scope at each reference (Ruby renders one then two), but every reference rendered the last value when any content preceded the entries (including a document header). The parser reset the shared block-attributes object between blocks with Object.keys(...), which skips the Symbol-keyed ATTR_ENTRIES_KEY, so the array of AttributeEntry objects leaked and accumulated across blocks; each block’s attribute-entry playback then replayed every assignment. The reset now uses Reflect.ownKeys(...) so the entries are cleared too
  • Fix reassigned attributes not resolving correctly when referenced from list item or table cell text (e.g. :x: 1 … * item {x} … :x: 2 … * item {x}) — unlike paragraph content (resolved lazily during conversion with attribute-entry playback), list item and table cell text is pre-computed eagerly after restoreAttributes() reverted the document to its header state, so body-level attributes were out of scope and rendered as unresolved ({x}) or with the wrong value. _resolveAllTexts now replays each block’s attribute entries in document order (mirroring AbstractBlock#convert) while pre-computing, then restores the header state. In addition, a block carrying only Symbol-keyed attribute entries (an :attr: entry immediately preceding a list or table) now still receives them — the parser’s transfer guard used Object.keys(...).length (0 for entry-only attributes) instead of Reflect.ownKeys(...).length, matching Ruby’s attributes.empty? where :attribute_entries is counted
  • Fix loss of the structured source_location on log messages emitted through the reader/preprocessor path (e.g. include file not found, unterminated <type> block, unterminated preprocessor conditionals) — these were logged as a plain string with the cursor baked into the text as a "<path>: line <N>: " prefix, so message.getSourceLocation() returned null (regression from 2.x). The reader now logs an auto-formatting message that keeps the cursor as a structured source_location, so getSourceLocation() (getFile()/getLineNumber()) is populated again and getText() stays clean; the stderr Logger still renders the "<path>: line <N>: " prefix. This restores line-anchored diagnostics for downstream tooling (IDE integrations, linters, CI annotations)
  • Fix allow-uri-read not being recognised when declared with an empty value (e.g. allow-uri-read= or attributes: { 'allow-uri-read': '' }) — include resolution checked the attribute’s truthiness via getAttribute, but ’'is falsy in JavaScript while Asciidoctor treats the mere presence of an attribute as enabled; the include reader (Node and browser modes) now checks presence viahasAttribute, matching Ruby’s attr?` semantics
  • Fix incorrect generated type declarations for async substitutor methods — applySubs, subQuotes, subMacros, subPostReplacements, subSource, subCallouts, highlightSource, restorePassthroughs and parseAttributes are all async but their JSDoc @returns declared the unwrapped type (e.g. string), so the emitted .d.ts advertised string instead of Promise<string>; callers following the types could concatenate the returned Promise and produce [object Promise]. The JSDoc now declares Promise<…> and the .d.ts was regenerated
Improvements
  • Improve typing of MemoryLogger#getMessages() — it previously returned any[]; the LogMessage wrapper class is now exported and getMessages() is declared to return LogMessage[], so consumers get typed getSeverity() (string), getText() (string) and getSourceLocation() (Cursor | undefined) accessors. The wrapper’s internal _text/_sourceLocation fields were renamed to public text/sourceLocation properties (consistent with severity), providing dual property/getter access

v4.0.0

Compare Source

Summary

This release is a complete rewrite of Asciidoctor.js — the Opal runtime and transpiled Ruby code have been replaced by a native JavaScript implementation.
The public API has been preserved as closely as possible from version 3, but there are breaking changes.
Please refer to the migration guide before upgrading.

Release meta

Released on: 2026-06-22
Released by: github-actions[bot]
Published by: GitHub

Logs: full diff

Changelog

Bug Fixes
  • Fix registry reuse — extensions registered directly on a registry instance (e.g. registry.preprocessor(fn)) now survive the internal reset and are preserved across multiple conversions, matching the behaviour of group-block registrations (Extensions.create(name, block)); both patterns are now safe to reuse
Improvements
  • Document registry reuse behaviour — extensions registered via a group block (Extensions.create(name, block)) survive the internal reset and are safe to reuse across multiple conversions; extensions registered directly on a registry instance are cleared on every activation and will be silently lost after the first conversion
  • Add --extension CLI option to load and register Asciidoctor extension files — the option calls the register(registry) named export of the loaded module with a shared registry; can be repeated to load multiple extensions
  • Clarify --require CLI option — it now only loads the module as a side effect and no longer auto-calls any exported function; use --extension to register Asciidoctor extensions, and --require for libraries that configure themselves on load (syntax highlighters, polyfills, etc.)
  • Improve JSDoc for IncludeProcessorDsl#handles — add @overload signatures documenting the two setter forms (arity-1 (target) and arity-2 (doc, target)) and the invoker form; update IncludeProcessorDslInterface typedef to expose both setter overloads
Breaking Changes
  • --require no longer inspects or calls a register export from the loaded module — this auto-call was already broken (it passed the Extensions namespace instead of a registry instance); any extension that relied on this behaviour must be updated to either export a register(registry) function and be loaded via --extension, or self-register using Extensions.register() at the top level to remain loadable via --require

v3.0.4

Compare Source

Summary

This release is based on Asciidoctor 2.0.20 and Opal 1.7.3 and fixes a regression introduced in 3.0.3.

Release meta

Released on: 2024-02-12
Released by: @​ggrossetie
Published by: GitHub Actions

Logs: full diff

Changelog

Bug Fixes
  • Default condition should be last one in conditional exports otherwise the following error is thrown: "Module not found: Error: Default condition should be last one" (#​1722) - thanks @​roseckyj & @​korva
Infrastructure
  • Update development dependencies

New Contributors

Full Changelog: asciidoctor/asciidoctor.js@v3.0.3...v3.0.4

v3.0.3

Compare Source

Summary

This release is based on Asciidoctor 2.0.20 and Opal 1.7.3.

Release meta

Released on: 2024-01-13
Released by: @​ggrossetie
Published by: GitHub Actions

Logs: full diff

Changelog

Bug Fixes
  • Fix types exports in package.json - thanks @​sinedied
  • Addd context and node_name accessor in the type definition - thanks @​RayOffiah
Infrastructure
  • Update development dependencies

New Contributors

Full Changelog: asciidoctor/asciidoctor.js@v3.0.2...v3.0.3

v3.0.2

Compare Source

Summary

This release is based on Asciidoctor 2.0.20 and Opal 1.7.3.

Release meta

Released on: 2023-06-24
Released by: @​ggrossetie
Published by: GitHub Actions

Logs: full diff

Changelog

Breaking Changes
  • Remove Asciidoctor namespace in TypeScript:

    import asciidoctor, { Document } from '@asciidoctor/core'
    
    const Asciidoctor = asciidoctor()
    Asciidoctor.convert('Hello _world_')
  • Publish @asciidoctor/core as an ES6 module

Bug Fixes
  • Strip alternate BOM that uses char code 65279 when input passes through a Buffer (#​1344)
  • Map Document.append (#​1681)
  • Bridge converter pass as option (#​1666)
  • Add getSectionNumeral() function by @​benjaminleonard (#​1659)
  • Fix getDocinfo and findBy type definition (#​1621)
  • Bridge common Ruby object methods (#​1491)
  • parseContent now calls toHash on attrs (#​1519)
Improvements
  • Map this.super.<method> to call the parent function (#​1682)

  • Map AbstractBlock.getContentModel and AbstractBlock.setContentModel (#​1680)

  • Map Document.getSyntaxHighlighter (#​1667)

  • Map CompositeConverter#convert (#​1649)

  • Simplify table option checks by @​mojavelinux (#​1656)

  • Support Stream.Writable as to_file (#​1624)

    const data = []
    const writableStream = new Writable({
      write (chunk, encoding, callback) {
        data.push(chunk.toString())
        callback()
      }
    })
    const doc = Asciidoctor.convert(text, { to_file: writableStream, safe: safe })
    const html = data.join('')
Infrastructure
Documentation

New Contributors

v3.0.1

Compare Source

v3.0.0

Compare Source


Configuration

📅 Schedule: (in timezone America/Los_Angeles)

  • Branch creation
    • "after 8pm,before 6am"
  • Automerge
    • "after 8pm,before 6am"

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate CLI.

@oxide-renovate oxide-renovate Bot added the dependencies Pull requests that update a dependency file label Sep 30, 2026
@oxide-renovate
oxide-renovate Bot force-pushed the renovate/asciidoctor-core-4.x branch from 803c9b2 to 86196bc Compare September 30, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants