title: PyQt5 QWebEngineView - Make a Markdown from a file - Python
body: <p>I have this method who read a file and put the content into a Plain Text.</p>
  <pre><code>def show_open_dialog():
      global file_path
      
      if not save_if_modified():
          return
  
      file_name, _ = QFileDialog.getOpenFileName(
          window_area, 
          'Open fle...', 
          os.getcwd(), 
          'Text files (*.txt *.py)'
      )
  
      if file_name:
          with open(file_name, 'r') as f:
              # Print content into text area.
              text_area.setPlainText(f.read())
              
          file_path = file_name
  </code></pre>
  <p>When this method is called, it open a window where I can choose a file and charge it like Notepad of Windows, and it works fine. Now what I want to do is create a Markdown with the information from that file, that is, pass it to HTML.</p>
  <p>I have already created the QWebEngineView element.</p>
  <pre><code>browser_area = QWebEngineView()
  </code></pre>
  <p>And this is the modifications I made inside of &quot;with open&quot; but that It does not work.</p>
  <pre><code># Print content into text area.
  text_area.setPlainText(f.read())
              
  # Raw data.
  file_content = f.read()
              
  # To HTML.
  browser_area.setHtml(file_content)
        
  # Show it.
  browser_area.show()
  </code></pre>
  <p>After print the content, only show an empty window.</p>
  <p>I also tried <a href="https://github.com/trentm/python-markdown2" rel="nofollow noreferrer">Markdown2</a> (markdown2.markdown(file_content)) instead of .setHtml() but It does not work too.</p>
  <p>For the moment I just want to show the content in a new window and show a message if the HTML cannot be loaded.</p>