Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I feel stupid for not being able to answering myself this...

Is there a way to open a HTML file in TextEdit without it rendering the file but just showing it as source (and possibly edit it)?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

It is in TextEdit help - search for HTML

If you open an HTML file and don’t see the HTML code, TextEdit is displaying the file in the same way a browser would. You can choose to display the file’s HTML code instead.

To display the code in an HTML file:

Choose File > Open.

Select “Ignore rich text commands.”

Locate the file and click Open.

To always view the code in HTML files, choose TextEdit > Preferences, click “Open and Save,” and then select “Ignore rich text commands in HTML files” below “When Opening a File.”

So it seems you have to choose before opening the file.

share|improve this answer
    
Looks like you can make that a permanent setting TextEdit -> Preferences... and then click the 'Open and Save' tab and you'll see a checkbox to check to turn on 'Ignore rich text commands in HTML files' when opening a new file. –  Ian C. Mar 18 '11 at 17:03
    
Yes I meant that you have to choose that in preferences or on opening file - so both before/on opening and not when you have it open –  Mark Mar 18 '11 at 17:07
    
Thanks, great! It's a bit like choosing the way the file is encoded. –  DaG Mar 18 '11 at 17:10

Use the T key combination to render the document you're viewing as plaintext instead of WYSIWYG.

share|improve this answer
1  
Thanks, but this just strips fonts etc. from the file, but does not show the html source (tags etc.). –  DaG Mar 18 '11 at 15:52
    
Until now, that's the best I thought you could get with TextEdit. –  Ian C. Mar 18 '11 at 17:03
    
Yes, and I appreciate it. I didn't downvote you! –  DaG Mar 18 '11 at 17:09
    
@DaG: down votes don't really worry me. :) –  Ian C. Mar 18 '11 at 17:45

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.