Monday, October 23, 2017

macos - How do open a HTML file as text on OS X?


How do we open a HTML file on OS X?


I tried open with TextEdit.app but it shows me the HTML page not that HTML source! Even when I put it as "text only" it doesn't work (it just takes the HTML page and strip off everything but the text, which apparently isn't the source code that i would like to view)


Btw I do not wish to download anything extra just to view the source of a HTML page.


Note, I do know that I can open the file in a web browser, select view source, then select all, copy, then open TextEdit.app, then paste. That's way too much work.


Answer



When you're opening the file in TextEdit (with the File -> Open dialogue) check the "Ignore rich text commands" checkbox. You can make this the default in the "Open and Save" tab of TextEdit's preferences (the very first checkbox "Ignore rich text commands in HTML files") so it'll work if you just drag a file onto the icon or control-click and do "Open With".


No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...