Steps to reproduce
- Paste "<td><td></td>" in wikitext (source) mode
- Click the link to "preview" or switch to wikitext mode
- Note that there is no rendered output
- Switch back to Wikitext mode
The wikitext editor contains "<td><td></td>"
No content is visible
- Store the original wikitext and only change it if the user edits the specific line. This is how it seems to be handled in Visualeditor when editing pages.
- Warn the user that content may be lost before switching back
This seems to happen because in read mode no content is actually shown for that snippet, and because the <td> is parsed as wikitext. This issue occurs with a some specific types of random wikitext.