I recently created a .html file in TextEdit on my Mac (Mac OS X 10.5.8). I then opened that .html file in my browser and it showed the page I created just fine. I closed the .html file and TextEdit and refreshed the page. It still worked fine. Then I opened up the .html file in TextEdit again and all the text was gone (the page in the browser still works fine though). Where did all the text go?

link|improve this question
1  
This isn't really a programming question. Try superuser.com – Mike Atlas Feb 26 '10 at 21:18
Agree with Mike. – yodaj007 Feb 26 '10 at 21:19
feedback

migrated from stackoverflow.com Feb 26 '10 at 21:23

This question came from our site for professional and enthusiast programmers.

3 Answers

Try selecting "Ignore rich text commands in HTML files" in the Open/Save section of TextEdit's preferences window.

Edit: after making sure this option is set, you'll likely need to re-open the file.

link|improve this answer
feedback

TextEdit was trying to render the page and present it rather than letting you edit the source. You should consider using a real editor.

link|improve this answer
textEdit is a Rich Text editor and will not always display the plain text output. An editor like TextWrangler might be better suited. – jweede Feb 26 '10 at 22:38
@jweede: TextEdit can be used as a plain text editor. However as you mentioned TextWrangler is much better suited. – Chealion Mar 18 '10 at 17:28
feedback

TextEdit is converting the HTML to rich text and displaying it as it is marked up by the tags. TextEdit is considered a rich text editor and not suitable for HTML or coding use.

You should use a raw text editor like TextWrangler or TextMate if you plan on doing coding or html work.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown