anchor.diff:               "xcon" "xcon-userid" "xmlrpc.beep" "xmlrpc.beeps" "xmpp" "z39.50r" "z39.50s"))
            (valid-schemes (append nyxt-schemes iana-schemes))
            (url (ignore-errors (quri:uri url))))
  -    (flet ((hostname-found-p (name)
  -             (handler-case (lookup-hostname name)
  -               (t () nil)))
  -           (valid-scheme-p (scheme)
  +    (flet ((valid-scheme-p (scheme)
                (find scheme valid-schemes :test #'string=))
              (http-p (scheme)
                (find scheme '("http" "https") :test #'string=)))
  
positive.code:                             ,args))))))))
  
  (defmemo lookup-hostname (name)
    "Resolve hostname NAME and memoize the result"
    #+sbcl
    (sb-bsd-sockets:get-host-by-name name)
    #-sbcl
    (iolib/sockets:lookup-hostname name))
  
  (export-always 'valid-url-p)
  (defun valid-url-p (url &key (check-dns-p t))
  
negative.code:                 (quri:uri-host url)
                  (or
                   (not check-dns-p)
                   ;; Onion links are not resolved via DNS, just accept them.
                   (string= (quri:uri-tld url) "onion")
                   ;; "http://algo" has the "algo" hostname but it's probably invalid
                   ;; unless it's found on the local network.  We also need to
                   ;; support "localhost" and the current system hostname.
                   (or (quri:ip-addr-p (quri:uri-host url))
                       (lookup-hostname (quri:uri-host url))))))))))
  
  (-> ensure-url (t) quri:uri)
  (defun ensure-url (thing)
  