Strip out DIV tags around rich text fields
-
16-10-2019 - |
Pergunta
I've noticed that SharePoint 2010 wraps rich text fields (multiline text) with DIV tags, which can be annoying. I've got a custom XSL template for the columns being pulled by a content query web part and would like to format the text correctly; unfortunately, the extra "naked" DIV tags (no attributes) cause line breaks where I don't need them.
For example, the following has a line break:
Address: <xsl:value-of select="@MyAddressColumn" disable-output-escaping="yes"/>
So it comes out like this:
Address:
123 Main St.
I want it to be this instead:
Address: 123 Main St.
Is there any way to prevent these DIV tags from being generated around the content by SharePoint? Thanks.
Solução
One way to fix this was to append a class on a tag surrounding the address, and then add display:inline to the nested DIV:
.test div
{
Display:inline;
}
<DIV class="test">address: <DIV>123 main st.</DIV></DIV>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a sharepoint.stackexchange