asciidoctor 4.0.1 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asciidoctor",
3
- "version": "4.0.1",
3
+ "version": "4.0.2",
4
4
  "description": "A JavaScript AsciiDoc processor powered by Asciidoctor",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "homepage": "https://github.com/asciidoctor/asciidoctor.js",
62
62
  "dependencies": {
63
- "@asciidoctor/core": "4.0.1"
63
+ "@asciidoctor/core": "4.0.2"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@biomejs/biome": "^2.4.13",
@@ -234,9 +234,10 @@ export abstract class AbstractNode {
234
234
  * Construct a URI reference or data URI to the target image.
235
235
  *
236
236
  * If the target image is already a URI it is left untouched (unless data-uri
237
- * conversion is requested). The image is resolved relative to the directory
238
- * named by assetDirKey. When data-uri is enabled and the safe level permits,
239
- * the image is embedded as a Base64 data URI.
237
+ * conversion is requested). If the target image is a data URI, then it is
238
+ * already an embedded image, so it is returned as-is. The image is resolved
239
+ * relative to the directory named by assetDirKey. When data-uri is enabled and
240
+ * the safe level permits, the image is embedded as a Base64 data URI.
240
241
  *
241
242
  * NOTE: When the document has both 'data-uri' and 'allow-uri-read' enabled
242
243
  * and the resolved image URL is a remote URI, this method returns a Promise
@@ -469,10 +469,26 @@ export class Document extends AbstractBlock<string> {
469
469
  * @returns {string[]} The list of substitutions to apply.
470
470
  */
471
471
  private _resolveDocinfoSubs;
472
+ /**
473
+ * @private
474
+ * Restore the document attributes to a previously captured snapshot, discarding any
475
+ * body-level (re)assignments replayed while pre-computing text. Mirrors Ruby's
476
+ * restore_attributes-before-convert invariant.
477
+ * @param {Object} snapshot - The attributes snapshot to restore.
478
+ */
479
+ private _restoreAttributeSnapshot;
472
480
  /**
473
481
  * @private
474
482
  * Walk the block tree and pre-compute all async text values.
475
483
  * Handles titles (AbstractBlock), list item text, table cell text, and reftexts.
484
+ *
485
+ * Runs in two passes (see {@link parse}): with `resolveContent` false only titles and
486
+ * reftexts are substituted (so the reftext→id map can be built); with `resolveContent`
487
+ * true the list item / table cell / dlist text is substituted, resolving any natural
488
+ * cross-references against the now-complete map. Title/reftext pre-computation is
489
+ * idempotent (results are cached), so running it in both passes is a no-op the second time.
490
+ * @param {AbstractBlock} block - The block to resolve.
491
+ * @param {boolean} resolveContent - Whether to substitute list item / cell / dlist text.
476
492
  */
477
493
  private _resolveAllTexts;
478
494
  /**