That doesn’t solve my problem. Although my problem might be a different one, actually. I just tested again. Without the visual editor, if my code is as I posted earlier:
<div>
<a>foo</a>
<a>foo</a>
</div>
it renders it as
<div>
<a>foo</a><br />
<a>foo</a>
</div>
which is fine. If the code is:
<div>
<a>foo</a>
<a>foo</a>
</div>
it puts <p>
tags in to keep the white space, which is fine too, except that it doesn’t do them properly. It renders it as:
<div>
<a>foo</a></p>
<p><a>foo</a>
</div>
Note that there are two missing <p>
tags: the first opening tag and the last closing tag. With three or more paragraphs, the middle ones are fine, and the first and last are still wrong.
Curiously, without the link tags, it’s still wrong, but slightly differently. It does the closing tag properly but not the opening one:
<div>
foo</p>
<p>foo</p>
</div>
I can live with all this because it is displayed properly in all the browsers I’ve tested it on, but it doesn’t validate. Obviously.
So it’s not the visual editor.