Auto-detects URLs in pasted HTML or plain text and converts them to links or images when paste.autoparse is enabled.
Access:
app.getService('autoparser')
App code:
const autoparser = app.getService('autoparser');
Plugin:
const autoparser = this.app.getService('autoparser');
format#
Parses input as HTML or plain text and replaces URL patterns with link or image tags, returning the result and a changed flag.
Parameters:
- input (
any) — input - kind (
any) — kind
Returns: { html: string, changed: boolean }
autoparser.format(html, { kind: 'html' });
parsePlainText#
Splits plain text by lines and converts URL patterns to HTML links or images, escaping non-URL segments.
Parameters:
- text (
string) — text
Returns: string
autoparser.parsePlainText('Visit https://example.com');