parse_icon_url

function parse_icon_url(icon_url: text): text(source)

Tests whether an asset icon URL is invalid. It will not try to resolve the URL, but it will remove trailing and leading whitespace and check that the string looks like an URL.

Throws "INVALID ASSET URL" if the URL is over 2048 characters or it does not match this regex pattern: ^\S+:\/\/[^\s$.?#].[^\s]*$

Return

the URL with whitespace removed.

Parameters

icon_url

the URL to trim and check