Open HTML as Source Code in TextEdit Before Making a Small Change
TextEdit can display an HTML document as formatted content rather than showing its tags. That can be useful for reading, but it is the wrong view when a small source change is required. Preserve the original file before switching to an editing workflow.
Use this procedure for a local file you are authorised to edit. Make a working copy and identify the exact change, such as correcting a visible heading. Keep unrelated formatting and links outside the scope of that edit.
Open the source deliberately
In TextEdit on Mac, choose File, Open and select the HTML file. Click Show Options and select Ignore rich text commands, then open it. Apple documents this as the route for viewing the HTML source instead of the rendered page.
For regular source work, TextEdit settings also offers Display HTML files as HTML code instead of formatted text. Changing this preference affects later openings, so use the per-file route first if this is an occasional task.
Apple notes that formatted HTML editing can substitute curly quotes and long dashes, while code-editing mode uses straight quotes and hyphens. Inspect attribute quotes and other punctuation around your change; visually similar characters can have different meanings in source code.
Verify both the file and its appearance
Make the smallest intended edit and save the working file with the correct .html extension. For a new file, Apple’s documented route begins with Format, Make Plain Text, then confirms Use .html when saving.
Reopen the saved file as code and confirm the change is present. Then preview the local page in a browser and inspect the affected heading, nearby layout and relevant links. A readable source file and a correct rendered result are separate checks.
Keep any required images or stylesheets in their expected locations during the preview. Missing companion files can make the page look broken even when the text edit is correct.
Retain the original until the change is accepted. Saving a local HTML file prepares a candidate; it does not publish that file to a website or establish that a hosted page has changed.
References: Apple: HTML in TextEdit.