Re: TextEdit bug in Save As HTML



In article <siegman-4C2567.10581317032008@xxxxxxxxxxxxxxxxx>,
AES <siegman@xxxxxxxxxxxx> wrote:

Steps:

Open an RTF document "MyDoc.rtf" in TextEdit.

Choose Save As . . , select Format = HTML

Pick the destination folder, set new name to "NewDoc.html"
(you have to type in the .html yourself; it's not auto-added)

Wrong. The ".html" is added automatically, but you won't see it if the
"Hide Extension" box is checked. If you type ".html", it'll uncheck the
box. If you type a different extension like ".doc", you'll get a
warning when you click Save, and it'll ask whether you want the filename
to end with ".doc.html" or just ".html".


HTML code is added, and the new doc is Saved as expected
The _title bar_ of the open window changes to "NewDoc.html"
But the _content_ of the window is still the original RTF document

Huh?

What the heck did you expect to see? Changing the window content to
show the HTML tags would be MUCH more annoying to most users, especially
if they were planning to continue editing and resave it again under
another name, as either HTML or RTF. Some folk would panic because
they've never seen HTML before and think their document has been wrecked
by a bug or virus.

TextEdit does what most other apps do in similar situations. If I open
a Word document and do a Save as RTF, it doesn't change the window
contents to reflect the fact that some of the formatting can't be done
in RTF. If I open a high-quality JPEG photo and Save as GIF, it doesn't
change the window's contents to 8-bit color.


Everything comes out OK in the end: The resulting NewDoc.html is decent
HTML code; it auto-opens in Safari; you can force-open it in TextEdit
(pure text mode) and touch up the HTML if you want; it's very handy and
useful that TextEdit can create this HTML output.

You can also have TextEdit open & display the HTML file as styled text
instead of HTML code, and what you see will be pretty close to the
appearance of the original RTF document. You can then edit and resave
it without any knowledge of HTML, and the resaved file will still be
HTML (unless you Save As a different file type).

To have TextEdit open an HTML file as styled text, you can use the Open
command in TextEdit and uncheck the "Ignore rich text commands" box.

Or you can go to TextEdit -> Preferences -> Open and Save, and uncheck
"Ignore rich text commands in HTML files" preference setting. This
affects how it opens HTML files when you drag them onto TextEdit or use
"Open With -> TextEdit" from the Finder.

Note that TextEdit has similar options that allow you to open RTF files
and see the raw RTF formatting code instead of the styled text.
.



Relevant Pages

  • Re: Page Size in TextEdit
    ... of e-mails in a thread) in .rtf format, and edit the resulting file to ... When I create a New file in TextEdit it defaults to A4. ... Using BBEdit/TextWrangler to examine the RTF saved by Mail, ... A4 version opens as A4. ...
    (uk.comp.sys.mac)
  • Re: Page Size in TextEdit
    ... of e-mails in a thread) in .rtf format, and edit the resulting file to ... When I create a New file in TextEdit it defaults to A4. ... Using BBEdit/TextWrangler to examine the RTF saved by Mail, ... A4 version opens as A4. ...
    (uk.comp.sys.mac)
  • Re: Default program: MS Word?
    ... I create a new document in TextEdit. ... I wonder why TextEdit offers the .rtf option if it can't ... so if you remove the rtf extension the system doesn't really ... But why would MS Word ALWAYS be the one that opens these files? ...
    (comp.sys.mac.apps)
  • Re: Default program: MS Word?
    ... I create a new document in TextEdit. ... Then when TextEdit first opens it, ... I wonder why TextEdit offers the .rtf option if it can't ... so if you remove the rtf extension the system doesn't really ...
    (comp.sys.mac.apps)
  • Re: Can I get TextEdit to open html as source?
    ... It saves a template html file. ... so dragged it to TextEdit and...ah. ... It still opens as rendered html. ...
    (uk.comp.sys.mac)