0

I am querying a Sharepoint list with javascript and displaying it in a highly customized way. I have several fields and am showing the Field name and then the field value. One of them is not aligned vertically.

<div class="heading">Author:</div>
<div class="info">&#8203;Organization Management</div>

the styles are as follows

    .heading {
        font-size:large;
        font:sans seriff;
        font-weight:700;
        color:black;
        float:left;
        margin-right:15px;
    }

    .info {
        font-size:large;
        font:sans seriff;
        color:black;
        text-align:left;
    }

This happened on only the one fields and not the other 3 i displayed. The html is generated so Im fairly certain it identical. Inspection seems to prove this out.

Looking at the List properties of the SharePoint list, I see that the rest of these were type 'Single Line of Text' while the 'Author' field was of type 'Multiple Lines of Text' AND 'Type of Text' was set to 'Enhanced rich text (Rich text with pictures, tables, and hyperlinks)'

I changed the second setting to 'Plain Text'
editing each item and saving also eliminated the 8203 character. This corrected the styling issue.

I can not explain why 8203 would affect vertical spacing.

Any ideas? At some point, I may actually want to use rich text editing...

greg
  • 1,673
  • 1
  • 17
  • 30
  • @Daniel A. White - I'm not sure that's an applicable dupe; it describes the same end state (the presence of the ​ character) but it doesn't address the OP's question. In his case, he's using SharePoint & is trying to figure out how to prevent the character from being programmatically inserted into his data. – Stevangelista May 14 '14 at 21:11
  • I can't add an answer because of the dupe flag, but consider this jQuery-based solution for finding & removing the character in question (you mention use of JS - if jQ is not an option, it could be obviously be re-written in pure JS): $('.info').text().replace(/^[\s\u200B]+|[\s\u200B]+$/g,'') – Stevangelista May 14 '14 at 21:21
  • well, this has some of the same words as the other listing, but Sharepoint is not even in there, and I posted this question because Sharepoint is adding that character in. I answered why and how to stop it because it took me 2 hours to figure it out. I suppose Mr White is confident no one else will ever have the problem. – greg May 15 '14 at 18:59

0 Answers0