wp_nav_menu does something I don’t care for

wp_nav_menu() is a function in WordPress that provides the code to display navigation menus on your blog. Being the OCD freak that I am, the function currently does something that drives me crazy.

Calling the function with a handful of links should yield code (in my opinion) that should look like this:

				<ul id="list_id" class="list_class" role="navigation">
					<li id="menu-item-id"><a href="http://wordpress.org/1/">Link 1</a></li>
					<li id="menu-item-id"><a href="http://wordpress.org/2/">Link 2</a></li>
					<li id="menu-item-id"><a href="http://wordpress.org/3/">Link 3</a></li>
				</ul>

Instead, it comes out looking like this:

				<ul id="list_id" class="list_class" role="navigation"><li id="menu-item-id"><a href="http://wordpress.org/1/">Link 1</a></li>
<li id="menu-item-id"><a href="http://wordpress.org/2/">Link 2</a></li>
<li id="menu-item-id"><a href="http://wordpress.org/3/">Link 3</a></li>
</ul>

Notice that the first list item is immediately appended to the unordered list tag. Also, each subsequent line goes back to the first character of the new line, instead of being formatted in a manner consistent with readable code.

Now, I’d assume the function itself would have no way of knowing how many tabs or spaces precede it, so it wouldn’t be able to format it correctly, is that correct? I don’t know the answer, that’s why I’m asking the question. But at the very least, shouldn’t it insert a carriage return before the first line item?