1

I have Multiline text box in a list which has text as below:

Note #1: Global Sport Academy & document (the "YMCA") dated 12/01/15

Notes #2: ......

In Edit view, it displays correctly but when I see in display view, it renders in a paragraph without line breaks and special characters as below:

Note #1: Global Sport Academy &amp; document (the &quot;YMCA&quot;) dated 12/01/15<br/>Notes #2:......

I searched online and made changes to Displayform.aspx, XSL as below:

<xsl:value-of disable-output-escaping="yes" select="ddwrt:AutoNewLine(string(@Notes))" ddwrt:nbsp-preserve="yes"/>

Now It shows line breaks properly but &amp; and &quot; are still there.

Note #1:  Global Sport Academy &amp; document (the &quot;YMCA&quot;) dated 12/01/15

Notes #2:......
  • Please show code for ddwrt:AutoNewLine – Amit Bhagat Jan 21 '16 at 5:38
  • Its SharePoint Data View Web Part Extension Functions in the ddwrt Namespace msdn.microsoft.com/en-us/library/… – Prash S Jan 21 '16 at 14:46
  • I checked link and found it is clearly mentioned that it will convert any '&' to '&amp;' and few more, so that is expected result of using AutoNewLine. Please tell me if Note field allows formatting or not and if you are using that xsl code in Content Query WebPart. – Amit Bhagat Jan 22 '16 at 14:11
0

Set disable-output-escaping="yes". This will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.