Where did the text of my .html file go in TextEdit on Mac OS X?

2

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?

David

Posted 2010-02-26T21:17:17.547

Reputation:

1

This isn't really a programming question. Try http://superuser.com/

– Mike Atlas – 2010-02-26T21:18:28.010

Agree with Mike. – Amy – 2010-02-26T21:19:41.953

Answers

3

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.

Tom

Posted 2010-02-26T21:17:17.547

Reputation: 283

2

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

Jeremy L

Posted 2010-02-26T21:17:17.547

Reputation: 2 587

textEdit is a Rich Text editor and will not always display the plain text output. An editor like TextWrangler might be better suited. – jweede – 2010-02-26T22:38:53.000

@jweede: TextEdit can be used as a plain text editor. However as you mentioned TextWrangler is much better suited. – Chealion – 2010-03-18T17:28:21.617

1

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.

Josh K

Posted 2010-02-26T21:17:17.547

Reputation: 11 754