HTML Tags in List Description
Filed Under (SharePoint) by Boris Gomiunik on 21-12-2009
I noticed what seems to be a slight bug in MOSS couple of days ago. If you use HTML tags in SharePoint list description, the HTML will be displayed in List settings and in "View all site content" page (sample below:)
But no HTML in list view – the HTML tags get escaped.
A minor JavaScript fixes this:
use the …ToolPaneView=2 parameter to add the Content editor Webpart above the list view. If you don’t understand what I’m talking about, please take a look at this post.
Edit the webpart properties and in source editor paste the following code:
<script type="text/javascript">
Elementi = document.getElementsByTagName('div');
for(i=0; i < Elementi.length; i++)
{
if(Elementi[i].className != null && Elementi[i].className=="ms-listdescription")
{
Elementi[i].innerHTML = deHTML(Elementi[i].innerHTML);
}
}
function deHTML(vhod) {
vhod = vhod.replace(/</gi,'<');
vhod = vhod.replace(/>/gi,'>');
return vhod;
}
</script>
and the result is:


