Steps to reproduce:
- In the wikitext editor, create a ref name that has an unbalanced number of quotation marks: <ref name="Foo>Citation goes here.</ref>
- Open the page in VisualEditor. (See the visible wikitext?)
- Make any change and save the page.
- Find the nowiki tags in the diff.
Example: https://en.wikipedia.org/w/index.php?diff=649197137