To set Text Edit preferences for HTML on your mac.
1) Open Text Edit.
2) Go to TextEdit>Preferences on the menu bar.
3) Click on New Document Tab and be sure Plain Text is checked.
4) Click on Open and Save tab and, as shown below, be sure add .txt is unchecked. Then check "ignore rich text commands..."