Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Aluma 13 posts 107 karma points
    Oct 12, 2017 @ 16:44
    Aluma
    0

    Macro Partial View: Textarea Property is Displaying HTML/XML character in place of punctuation

    I have created a Macro Partial View with 'Textarea' input type defined on two of the fields (each field corresponds to a person's bio description-split into two parts). The macro is working as intended as far as functionality is concerned. However, it is not parsing/rendering text correctly.

    1) I went to the Content section and inserted the macro on the appropriate page.

    2) I've ensured that my div class names and IDs are accurate.

    3) I copy-pasted a text description in the Textarea property and clicked save/publish (no errors).

    4) Apostrophes are being displayed as ' on the webpage. Example:

    enter image description here

    5) I've also tried manually typing in the content (instead of pasting it), but the problem remains.

    6) I have the following tag in the head of the HTML master layout page:

    <meta charset="utf-8">
    

    Essentially, the Textarea input field is parsing apostrophes as their equivalent HTML entity code, and I don't know how to prevent it from doing that. I've tried to clear cache and restart the application pool, but the problem remains. This is not happening anywhere else on the site, and I have lots of text and content that is being rendered from macros, as well as regular templates and partials.

    What I'm working with:

    • Umbraco 7.6.3
    • Windows 7
    • Problem occurs in all major browsers (Chrome/Safari/Firefox/IE)

    Would really appreciate your help!

  • Proxicode 128 posts 324 karma points
    Oct 12, 2017 @ 18:08
    Proxicode
    0

    Was this copied from a Word doc (or any Office doc) by chance?

  • Aluma 13 posts 107 karma points
    Oct 12, 2017 @ 18:17
    Aluma
    1

    Thanks for the reply, Proxicode. I'm aware of what you're hinting at, so I've physically typed the text, yet I'm still facing the same problem.

  • Aluma 13 posts 107 karma points
    Oct 12, 2017 @ 19:58
    Aluma
    100

    Solution Found:

    I had to wrap the result of my Textarea property in @Html.Raw()

    Now, the characters appear correctly (unencoded).

    Thanks to Dennis A. from Umbraco support.

Please Sign in or register to post replies

Write your reply to:

Draft