Copied to clipboard

Flag this post as spam?

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


  • Sharmarke Hujale 103 posts 346 karma points
    Jan 17, 2016 @ 17:57
    Sharmarke Hujale
    0

    Problem with the Rich text editor!

    Hi guys

    I don't know if any of you have experience the same problem,

    bascially, when I paste a text in the RTE and press publish after - and then return to my website,

    I see a duplicated text above my navigation. It seems like when I place a link in there (RTE) this problem occur.

    Can someone please help me with this, it's really frustrating.

    /Sharmarke

  • Sharmarke Hujale 103 posts 346 karma points
    Jan 17, 2016 @ 18:21
    Sharmarke Hujale
    0

    I found some hints to my problems

    I'm using social sharing for the projects content,

    So what's happening over the navigation is actually the meta tags (facebook and twitter) for description

    This is twitter:

    <meta name="twitter:description" content="<p><a href="https://www.facebook.com/hashtag/historyinaction?source=feed_text&amp;story_id=979005138787815"><span>#‎HistoryInAction‬</span></a> This <a href="https://www.facebook.com/hashtag/ivlp?source=feed_text&amp;story_id=979005138787815"><span>‪#‎IVLP‬</span></a> Danish Civil Rights leader met with Rev. Robert Graetz and his wife Jeannie in Alabama to learn about the role of the religious community in fighting for justice and c</p>">
    

    So in some kind of way the 'a' (link) is ruining the meta tags,

    I would appreciate it very much if someone could help me out with this,

    //Sharmarke

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Jan 17, 2016 @ 20:23
    Nicholas Westby
    0

    It is the quote marks for the href attribute that are messing up your content. You'll have to escape the nested quote marks (e.g., with &quot;) or use apostrophes instead.

  • Sharmarke Hujale 103 posts 346 karma points
    Jan 17, 2016 @ 22:04
    Sharmarke Hujale
    0

    Can you provide with an example?

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Jan 17, 2016 @ 22:51
    Nicholas Westby
    0

    In short, this is what you are currently outputting:

    <meta name="twitter:description" content="<a href="/"></a>">
    

    And this is what you should output:

    <meta name="twitter:description" content="<a href=&quot;/&quot;></a>">
    

    If there are ampersands and such, you should encode those too.

    Razor should handle this for you (unless you use something like Html.Raw, which prevents escaping HTML).

  • Sharmarke Hujale 103 posts 346 karma points
    Jan 18, 2016 @ 17:32
    Sharmarke Hujale
    0

    Thank you for your help

    I found another method to solve my problem

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Jan 18, 2016 @ 18:39
    Nicholas Westby
    0

    What method was that?

  • Sharmarke Hujale 103 posts 346 karma points
    Jan 18, 2016 @ 19:29
    Sharmarke Hujale
    1

    I changed this:

    <meta name="twitter:description" content="<a href="/"></a>" />
    

    To this:

    <meta name="twitter:description" content='<a href="/"></a>' />
    

    I took out the quote marks on content and replaced it with apostrophes like you said.

Please Sign in or register to post replies

Write your reply to:

Draft