Hi tiagorocha,
It appears as through the "script to export notes" is not creating complete HTML. In the three example you include, note that the first tag showing is <div>, which defines a division. In order for a browser to render the page, as you are expecting, there is a fair bit of HTML that needs to proceed that.
The first, and important, missing is the document type. After that is the opening html tag and language. Then the header section, and finally the body tag would contain the little bit of code you are showing in your snapshots.
<!DOCTYPE html>
<html lang=en>
<head>
<meta charset=utf-8>
</head>
<body>
Your code goes here
<footer>
</footer>
</body>
</html>
Your post title "Safari not rendering HTML properly?" is misleading. You have provided examples of three different browsers behaving the same way. To suggest that Safari is doing something wrong is not a correct assessment. It would seem that the script is simply not generating complete HTML code. As such, it is surprising that Quick Look does so well filling in the major missing pieces of the coding.