I have a basic asp repeater that generates a ul
and its child li
s. It seems that each li
is preceded by this magical zero space character (​
). This messes up the design by adding extra space between each list item.
The code is currently on a dev site so I can't give you a link. Here is the basic markup
<asp:Repeater ID="rptrPageMeta" runat="server">
<HeaderTemplate>
<ul>
</HeaderTemplate>
<ItemTemplate>
<li>
</li>
</ItemTemplate>
<FooterTemplate>
</ul>
<div class="clear"></div>
</FooterTemplate>
</asp:Repeater>
The repeater has a list of data items that gets bound to it in the Presenter. But in this example it is irrelevant since nothing from each item gets rendered. This is what it generates:
<ul>
​
<li>
</li>​
<li>
</li>​
<li>
</li>​
<li>
</li>​
<li>
</li>​
<li>
</li>
</ul>
I would like to remove the character rather than do a CSS hack to hide it. I have tried to remove all white space from the file by making all the code on one line. This removed the white spaces that were there but wont get rid of the zero space character. I also edited the file in notepad++ with all characters displayed and the character wasn't there.
What are some ways that I can remove this character?
EDIT: I did create a fresh project and was not able to reproduce this issue. The only thing I can assume now is that it is caused by Sitefinity. This code is used in a widget template inside of a Sitefinity 5 CMS.
Current Hack: The way I am getting around this is by using the following js on the specific list:
if ($('.my-list').length > 0) {
$('.my-list').each(function() {
$(this).html($(this).children('li'));
});
}