Safari not rendering HTML properly?

So I've downloaded this script to export notes from the Notes app under Catalina and it saves them all as individual HTML files. When I use Quick Look, I can see them as normal HTML files (links are blue, underlined, clickable, <h1> tags are shown as bigger and bold text, etc).


Now when I open them with Safari or any other browser, none of that happens and all I see is normal text. Any idea why this happens and how to fix this?


Quick Look:


Safari:


Firefox:


Chrome:

MacBook Pro 15″, macOS 10.13

Posted on Dec 20, 2021 2:37 AM

Reply
Question marked as Top-ranking reply

Posted on Dec 20, 2021 7:13 AM

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.

Similar questions

5 replies
Question marked as Top-ranking reply

Dec 20, 2021 7:13 AM in response to tiagorocha

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.

Dec 20, 2021 7:34 AM in response to TrafGib

Hi, thanks for the reply.

You're right, it's not just Safari. My bad.

And yes, the HTML is complete. I think my issue was that since QuickLook is rendering it properly, I automatically assumed there was a problem with Safari (and of course, the other browsers).


This is what's considered markdown language so just having those pieces of "code" is enough for some apps. Maybe QuickLook is ok with markdown...? It's the only reasonable explanation, I guess :)

Dec 20, 2021 7:45 AM in response to tiagorocha

Hi tiagorocha,


"Maybe QuickLook is ok with markdown...? It's the only reasonable explanation, I guess :)" - Fair guess. I hadn't considered it.


This threw me: "And yes, the HTML is complete."


If you open the file in question using text.app, or an HTML editor, does the code have the components I mentioned, such as the DOCTYPE? Or, do you mean "complete" as in correct for markdown? I ask because Markdown code does not really resemble HTML as all. In other words, the screenshots that you included, from each of the browsers, is showing HTML code versus Markdown code.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Safari not rendering HTML properly?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.