Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
    
What does this have to do with your specific hardware? –  Daniel Beck May 13 '11 at 9:36
    
@Daniel I just changed that :) –  slhck May 13 '11 at 9:38
    
@slhck I know, you blocked my edit ;) –  Daniel Beck May 13 '11 at 9:39

2 Answers 2

up vote 3 down vote accepted

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".

share|improve this answer
    
heys how do i "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")". Where is the textedit's preferences? –  Pacerier May 13 '11 at 10:40
1  
"Preferences..." under the "TextEdit" menu - for future reference that's where most Mac applications will keep their preferences. –  Scott May 13 '11 at 14:55
    
+1 So there's actually more to TextEdit than an NSTextView. Good to know. –  Daniel Beck May 13 '11 at 16:44

Consider renaming the file to .txt so it opens as plain text.


You can always use the Terminal to view or edit the file, e.g. using cat or vim.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.