WP adds <br /> before <select even where there is no line break in source code
|Reported by:||chirael||Owned by:|
|Component:||Formatting||Keywords:||wpautop has-patch needs-testing|
My source code in the WP HTML editor:
<label for="sellby">How soon do you need to sell?</label><select id="sellby" name="sellby" required="1">
Note how there is *no line break* between </label> and <select
HTML generated by WP, however:
<label for="sellby">How soon do you need to sell?</label><br /> <select id="sellby" name="sellby" required="1">
Um, how (and why?) did that extra <br /> get in there?
This also happened when I was using the Visual editor; switched to the HTML editor to see if it was an error on my part but nope - there is no line break whatsoever in my HTML source code, so I have no idea why WP insists on adding one.
It's particularly vexing because I would like my text label to be next to (on the same line as) my select boxes, but WP is forcing it to be on the next line, which is making my form look awful.
AFAIK it's only happening with select boxes, but it's pretty consistent for me.
Since it's happening with the HTML editor as well as the Visual editor I left the Component as General so better minds than mine can categorize it appropriately.