function ensureSafeUrl(url) {
  const normalizedUrl = String(url).replace(ATTRIBUTE_WHITESPACES, '');
  return normalizedUrl.match(SAFE_URL) ? url : '#';
}
Returns a safe URL based on a given value.
A URL is considered safe if it is safe for the user (does not contain any malicious code).
If a URL is considered unsafe, a simple `"#"` is returned.

Based on: https://github.com/ckeditor/ckeditor5/blob/bce8267e16fccb25448b4c68acc3bf54336aa087/packages/ckeditor5-link/src/utils.js#L63