Possible bug: link to other files in HTML

Hello there and thanks in advance for you help. So, I have a search.html file that looks properly when I open it directly in jupyter-lab (I can’t display it here due to upload limitations).
However, if I have any other file with an href to search.html, for example, like this:

<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Welcome to playground’s documentation! &#8212; playground  documentation</title>
    <link rel="stylesheet" type="text/css" href="_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
    <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
    <script src="_static/jquery.js"></script>
    <script src="_static/underscore.js"></script>
    <script src="_static/doctools.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  </head><body>
    
    <p><a class="reference internal" href="search.html"><span class="std std-ref">Search Page</span></a></p>    

    
  </body>
</html>

If I open the file and press the link the search.html will be rendered like this (without any CSS, and that’s not what the file looks like):

I suppose this is happening because search.html is being rendered within the tab of the first file. I have tried adding the attribute target="_blank" to the anchor HTML element but did not work.

I assume this is a bug since if you preview a Markdown file that has a link to another file it works properly by opening it in another tab within jupyter.

Any help?

What happens when you press the “Trust HTML” button you show up at the top?
I think what you are expecting that by pressing the link in ‘search.html’ is “preview any HTML files that are in your folders.” For security/safety in Jupyter though this isn’t allowed by default.
But you don’t want to have to hit trust each time, right? And so I think though you can add the ability to “preview any HTML files that are in your folders” as a sidecar to your JupyterLab by using jupyter-http-server as described here. Once that is added you can develop in JupyterLab and then switch over to the HTTP server view to test links.
Assuming that works for your use case, a related tip that I’ve found you can switch over to the HTTP server using URLs too, once you pick up the pattern in the address bar. Meaning you can have another browser tab or window open and adjust the URL to move around if you have a lot of files and layers of file hierarchy.