Optionaltext: stringThe String text of this inline element.
Optionalopts: anyA plain object of options: id - The String id of this inline element. type - The String type qualifier (e.g. 'ref', 'bibref'). target - The String target (e.g. a URI).
Provide a default logger. The Logging mixin (logging.js) overrides this getter on the prototype.
Get the value of the reftext attribute with substitutions applied. The result is pre-computed during Document.parse() via precomputeReftext. Falls back to the raw reftext attribute if precomputeReftext() has not been called yet.
the String reftext or null if not set.
Set the value of the role attribute on this node.
Accepts a single role name, a space-separated String, or an Array.
A single role name, a space-separated String, or an Array.
Add the given role directly to this node.
The String role name to add.
true if the role was added, false if it was already present.
Get the converted content (alias for text).
Convert this inline element using the document's converter.
Retrieve the Set of option names that are enabled on this node.
a Set of option name strings.
Generate a data URI that embeds the image at the given local path.
The image path is cleaned to prevent access outside the jail when the document safe level is SafeMode.SAFE or higher. The image data is read and Base64-encoded. In non-Node environments this method returns an empty data URI with a warning.
A String path to the target image.
OptionalassetDirKey: stringThe String attribute key for the image directory.
a Promise resolving to a String data URI.
Read the image data from the specified URI and generate a data URI.
The image data is fetched and Base64-encoded. The MIME type is taken from the Content-Type response header.
NOTE: This method is async in JS (the Fetch API is async). When called from imageUri, the caller must await the returned Promise.
The URI from which to read the image data (http/https/ftp).
OptionalcacheUri: booleanA Boolean to control caching (not yet supported in JS).
a Promise resolving to a String data URI.
Get the alt text for this inline image.
the value of the alt attribute, or ''.
Get the value of the specified attribute.
Looks for the attribute on this node first. If not found and fallbackName is
set, and this node is not the Document node, look for that attribute on the
Document node. Otherwise, return defaultValue.
The attribute name to resolve.
OptionaldefaultValue: anyThe value to return if the attribute is not found.
OptionalfallbackName: string | booleanWhen truthy, also checks the Document's
attributes. Pass true to fall back using the same name, or a string to use a different name.
the attribute value or defaultValue.
Get the attributes hash for this node.
a plain Object of attributes.
Get the context name for this node.
the context name.
Get the {Converter} instance being used to convert the current {Document}.
the converter instance.
Get the document to which this node belongs.
the Document.
Get the icon URI for the named icon.
The String icon name.
a Promise resolving to a String URI.
Get the String id for this node.
the id, or undefined if not set.
Get the image URI for the target image.
The String target image path or URL.
OptionalassetDirKey: stringThe String asset directory attribute key.
a Promise resolving to a String URI.
Get the logger for this node.
the logger instance.
Get the media URI for the target.
The String target path or URL.
OptionalassetDirKey: stringThe String asset directory attribute key.
a String URI.
Get the String name of this node.
the node name.
Get the parent node of this node.
the parent AbstractNode, or undefined for the root document.
Get the value of the reftext attribute with substitutions applied.
the reftext value, or undefined if not set.
Retrieve the space-separated String role for this node.
the role as a space-separated String.
Retrieve the String role names for this node as an Array.
the role names as a String Array, empty if the role attribute is absent.
Return the target (e.g. URI or anchor) of this inline node.
Return the text of this inline node.
Return the type qualifier of this inline node (e.g. 'ref', 'bibref').
Check if the specified attribute is defined on this node, with optional value match and document-level fallback.
The attribute name.
OptionalexpectedValue: anyWhen truthy, also checks that the resolved value equals this.
OptionalfallbackName: string | booleanWhen truthy, also checks the Document's
attributes. Pass true to use the same name, or a string for a different fallback name.
Check if the specified option attribute is enabled on this node.
This method checks whether the <name>-option attribute is set.
The String or Symbol name of the option.
true if the option is enabled, false otherwise.
Check if the reftext attribute is defined.
Check if the specified role name is present in this node's role list.
The String role name to find.
Check if the role attribute is set on this node, optionally matching an exact value.
Unlike hasRole, which checks for an individual role name within a
space-separated list, this method tests the raw role attribute string as a whole.
OptionalexpectedValue: stringWhen provided, checks that the role
attribute equals this string exactly.
Construct a reference or data URI to an icon image for the given name.
If the 'icon' attribute is set on this node the name is ignored and the attribute value is used as the target path. Otherwise the icon path is built from 'iconsdir', the name, and 'icontype' (default: 'png').
The String name of the icon.
a Promise resolving to a String reference or data URI for the icon image.
Construct a URI reference or data URI to the target image.
If the target image is already a URI it is left untouched (unless data-uri conversion is requested). The image is resolved relative to the directory named by assetDirKey. When data-uri is enabled and the safe level permits, the image is embedded as a Base64 data URI.
NOTE: When the document has both 'data-uri' and 'allow-uri-read' enabled and the resolved image URL is a remote URI, this method returns a Promise rather than a String. Await the result when that combination may be active.
A String path to the target image.
OptionalassetDirKey: stringThe String attribute key for the image directory.
a Promise resolving to a String reference or data URI.
Check if the specified attribute is defined with an optional value match. Alias for hasAttribute.
OptionalexpectedValue: anyCheck whether this node has reftext — either an explicit 'reftext' attribute or a title that can serve as the cross-reference text. Mirrors Ruby's AbstractNode#reftext?
Construct a URI reference to the target media.
A String reference to the target media.
OptionalassetDirKey: stringThe String attribute key for the media directory.
a String reference for the target media.
Normalize the asset file or directory to a concrete and rinsed path.
Delegates to normalizeSystemPath with start set to document.baseDir.
The String asset reference to normalize.
OptionalassetName: stringThe String label for the asset used in messages.
Optionalautocorrect: booleanA Boolean indicating whether to recover from an illegal path.
the normalized String path.
Resolve and normalize a secure path from the target and start paths.
Prevents resolving a path outside the jail (defaulting to document.baseDir) when the document safe level is SafeMode.SAFE or higher.
The String target path.
Optionalstart: stringThe String start (parent) path.
Optionaljail: stringThe String jail path.
Optionalopts: anyA plain object of options:
recover {boolean} - Whether to automatically recover for illegal paths.targetName {string} - Label used in messages for the path being resolved.the resolved String path.
Normalize the web path using the PathResolver.
The String target path.
Optionalstart: stringThe String start (parent) path.
OptionalpreserveUriTarget: booleanWhether a URI target should be preserved as-is.
the resolved String path.
Pre-compute the reftext with substitutions applied asynchronously. Called during Document.parse() so the synchronous getter works during conversion.
Read the contents of the file at the specified path.
This method checks that the file is readable before attempting to read it.
The String path from which to read the contents.
Optionalopts: anyA plain object of options:
warnOnFailure {boolean} - Whether a warning is issued when the file cannot be read (default: false).normalize {boolean} - Whether lines are normalized and coerced to UTF-8 (default: false).label {string} - Label for the file used in warning messages.a Promise resolving to the file content, or null if not readable.
Resolve the URI or system path to the target, then read and return its contents.
When the resolved path is a URI and allow-uri-read is enabled, the content is fetched via the Fetch API (async). When it is a local path, the file is read via readAsset.
The URI or local path String from which to read the data.
Optionalopts: anyA plain object of options:
label {string} - Label used in warning messages (default: 'asset').normalize {boolean} - Whether the data should be normalized (default: false).start {string} - Relative base path for resolving the target.warnOnFailure {boolean} - Whether warnings are issued on failure (default: true).warnIfEmpty {boolean} - Whether a warning is issued when the target contents are empty (default: false).a Promise resolving to the content, or null on failure.
Remove the attribute from this node.
The attribute name to remove.
the previous value, or undefined if the attribute was not present.
Remove the given role directly from this node.
The String role name to remove.
true if the role was removed, false if it was not present.
Set the value of the specified attribute on this node.
The attribute name to assign.
Optionalvalue: anyThe value to assign.
Optionaloverwrite: booleanWhen false, does nothing if the attribute already exists.
true if the attribute was set, false if blocked by overwrite=false.
Subclasses (e.g. Document) may return the resolved value string or null when the attribute is locked.
Set the String id for this node.
The String id to assign.
Set the specified option on this node by setting the <name>-option attribute.
The String name of the option.
Set the parent of this node. Also updates the document reference.
Set the value of the role attribute on this node.
Accepts a single role name, a space-separated String, an Array, or spread arguments.
A single role name, a space-separated String, an Array, or multiple role names as spread arguments.
the value of the role attribute.
Update the attributes of this node with the new values.
A plain object of additional attributes to assign.
the updated attributes object on this node.
Generate cross-reference text (xreftext) that can be used to refer to this inline node.
Uses the explicit reftext for this inline node, if specified, retrieved by calling the reftext method. Otherwise, returns null.
Optional_xrefstyle: stringNot currently used.
the reftext to refer to this inline node, or null if no reftext is defined.
Represents an inline element in an AsciiDoc document.