function printUrl(url, dangerousCharOrChars = []) {
  const dangerousChars = [
    " ",
    ...(Array.isArray(dangerousCharOrChars)
      ? dangerousCharOrChars
      : [dangerousCharOrChars]),
  ];

  return new RegExp(
    dangerousChars.map((x) => escapeStringRegexp(x)).join("|"),
    "u",
  ).test(url)
    ? `<${encodeUrl(url, "<>")}>`
    : url;
}
@param {string} url
@param {string[] | string} [dangerousCharOrChars]
@returns {string}