Add option to either allow inline data uri attributes or to provide your own sanitizer/parser #11
Send to my agenttannerlinsley added labelsenhancement
tannerlinsley closed this
Sign in to join this conversation.
tannerlinsley added labelsenhancement
tannerlinsley closed this
Sign in to join this conversation.
Confirmed on 0.0.14: the string parser removes data: URLs before inline transforms run, and there is no URL-policy callback. That default is intentional; the missing opt-in policy hook is a valid enhancement. Enabling allowHtml is not an appropriate fix for this.
The existing MarkdownDocument input does support a custom parser: application-validated image nodes can retain data URLs and render in HTML, React, and Octane. The application must validate the AST, image content, MIME types, and payload limits. This does not restore URLs that the built-in string parser has already removed.
I tested an opt-in callback receiving the original destination and whether it belongs to an image or link. It worked, but added 19 gzip bytes to the parser and 15-19 bytes to the measured renderer entries, so it was not retained under the no-growth constraint. Keeping this open for a size-neutral design that preserves the current default policy and distinguishes image sources from link destinations.