On this page
Overview
Extracts and audits links from AI Markdown, rendered HTML, CSS, srcset, bare URLs, and email text.
- Artifact
AIResponseURLPolicy.js· esm - Classification
public first party - Availability
Cross-host - Normalization
Mutable audit with exact link comparison after entity and Markdown escape decoding, without URI canonicalization or response mutation. Browsers use native HTML parsing; hosts without a document retain lexical extraction and the existing limited entity decoder. Already decoded rendered values are not decoded again. Authored links retain source offsets; DOM-only attribute links use document order after authored links.
Import and lifecycle
import * as module from '/arcane/modules/AIResponseURLPolicy.js';
Parsing and auditing with the bundled Markdown parser and detached native HTML elements when a document is available; performs no fetch or navigation and never changes response content.
Application-facing behavior: auditAIResponseLinks(), extractAIResponseLinks(), normalizeAIResponseLink(), decodeHTMLCharacterReferences().
Protocol and host implementation
In-process; bundled Marked parser and native HTML parsing when a document is available This detail does not widen the application-facing API or grant authority.
Exports, signatures, parameters, and results
| Binding | Form | Declaration or signature | Parameter syntax |
|---|---|---|---|
auditAIResponseLinks | function | function auditAIResponseLinks(text='',allowedLinks=[]) | text='',allowedLinks=[] |
decodeHTMLCharacterReferences | function | function decodeHTMLCharacterReferences(value='') | value='' |
extractAIResponseLinks | function | function extractAIResponseLinks(text='') | text='' |
normalizeAIResponseLink | function | function normalizeAIResponseLink(value='',{bare=false}={}) | value='',{bare=false}={} |
| Callable | Kind | Exact public signature | Parameter syntax |
|---|---|---|---|
auditAIResponseLinks | exported-function | function auditAIResponseLinks(text='',allowedLinks=[]) | text='',allowedLinks=[] |
extractAIResponseLinks | exported-function | function extractAIResponseLinks(text='') | text='' |
normalizeAIResponseLink | exported-function | function normalizeAIResponseLink(value='',{bare=false}={}) | value='',{bare=false}={} |
decodeHTMLCharacterReferences | exported-function | function decodeHTMLCharacterReferences(value='') | value='' |
Parameter meanings and results
extractAIResponseLinks(text) finds links across Markdown, HTML, CSS, srcset, bare URLs, and email text. auditAIResponseLinks(text, allowedLinks) returns a mutable {ok, links, unsupportedLinks, allowedLinks} audit using exact values after entity and Markdown escape decoding, without URI canonicalization. Authored links retain source offsets; DOM-only attribute links use document order after authored links.
Events, side effects, and errors
Source-literal CustomEvent dispatches
No source-literal CustomEvent dispatch is part of this artifact.
Lifecycle and event flow
This artifact has no additional documented lifecycle event flow.
Direct coded failures
This artifact directly assigns no stable coded failure.
Exported Error subclasses
This artifact exports no Error subclass.
Documented failure behavior
No additional module-specific rejection behavior is documented.
Availability and capabilities
Cross-host. Mutable audit with exact link comparison after entity and Markdown escape decoding, without URI canonicalization or response mutation. Browsers use native HTML parsing; hosts without a document retain lexical extraction and the existing limited entity decoder. Already decoded rendered values are not decoded again. Authored links retain source offsets; DOM-only attribute links use document order after authored links.
Cross-host link auditing independent of Core and provider transport. Browsers use native HTML parsing and entity decoding; hosts without a document retain lexical extraction and the existing limited entity decoder. Already decoded rendered values are not decoded again.
Contract example
import {auditAIResponseLinks} from '/arcane/modules/AIResponseURLPolicy.js';
const audit=auditAIResponseLinks(
'[Docs](https://example.com/docs)',
['https://example.com/docs']
);
console.log(audit.ok,audit.links);
Related reference
No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.