title: Invalid HTML code generated by WordPress (<link rel='https://api.w.org/'...)
body: <p>WordPress 5.2.4</p>
  
  <p>I'm trying to get valid HTML.</p>
  
  <p>A validator (<a href="https://validator.w3.org/" rel="nofollow noreferrer">https://validator.w3.org/</a> ) shows this:</p>
  
  <blockquote>
    <p>Error: Bad value <a href="https://api.w.org/" rel="nofollow noreferrer">https://api.w.org/</a> for attribute rel on element link:
    The string <a href="https://api.w.org/" rel="nofollow noreferrer">https://api.w.org/</a> is not a registered keyword.</p>
    
    <p>From line 135, column 1; to line 135, column 60</p>
    
    <p>↩https://api.w.org/' href='<a href="http://ved/wp-json/" rel="nofollow noreferrer">http://ved/wp-json/</a>'
    />↩
  </blockquote>
  
  <p>The problem seems to be in wp-includes/rest-api.php, line 841:</p>
  
  <pre><code>function rest_output_link_wp_head() {
      $api_root = get_rest_url();
  
      if ( empty( $api_root ) ) {
          return;
      }
  
      echo "&lt;link rel='https://api.w.org/' href='" . esc_url( $api_root ) . "' /&gt;\n"; // Line 841.
  }
  </code></pre>
  
  <p>Well, this seems to be the core of WordPress. But it renders invalid code.</p>
  
  <p>Cold you help me with these two questions:
  1. What is the most correct and elegant way to cope with this problem?
  2. Is there anything that should be taken into consdideration here. I mean that I don't seem to be going to use REST API, but maybe some plugins need REST API. </p>