Allowing unsafe HTML in articles Follow

Comments

13 comments

  • Avatar
    Nicole Nguyen

    If the i class is stripped, what is the workaround for using Font Awesome icons then?

    For example, if I add 

    <i class="fas fa-camera-retro"></i>

    It gets removed from the html in my article.

  • Avatar
    Patrick Bosmans

    Hello Nicole,

    One of the features of WYSIWYG editors is that they will "clean up" HTML that they do not support. For example, <bold> is not supported with our WYSIWYG but <strong> is and thus bold tags are removed.

    I did some digging into this for you and currently, the WYSIWYG editor that we use in our help center does not support this tag, so at this time there is no workaround.

    I'm sorry I couldn't give you better news on this, but please let us know if there is anything else we can help with.

    Sincerely, 

    Patrick | Tier 1 Advocate 

  • Avatar
    Tami Settergren

    Is there a workaround for centering <td> elements? I'd like my bullets to be centered, rather than left-aligned.

  • Avatar
    Molly VS

    Hey Tami!

    So not all HTML would be supported in the editor, but I was able to use the following class with some success:


    It basically indented the list a bit as opposed to the left justification.

    Hope that's useful to you!

  • Avatar
    Alexia Wolfhagen

    So... Font awesome is not supported?? How do i add icons then?

  • Avatar
    Ruth Anthony

    I cant find the option to Display Unsafe Content under Settings. Can you please help?

  • Avatar
    Nicole - Community Manager

    Hi Ruth - 

    Make certain that you are in the Guide Admin and not the settings for Support. You can toggle this using the four grey boxes in the upper right-hand corner of the screen. 

    From there, click the gear icon in the left-hand pane. This will take you into the settings. 

    Then, scroll down to the section titled "security" and you will see a box you can check next to "Display unsafe content." 

     

  • Avatar
    Stephen Fusco

    Hey Alexia, 

    There are some "hacky" way to get Font Awesome to work, such as utilizing <div> or <p> tags instead of <i> tags. In some testing this seems to have worked but we cannot guarantee it as a workaround because as stated Font Awesome is not really supported in help center. 

    That said, there is a community post here which might help: https://support.zendesk.com/hc/en-us/community/posts/203458726-Help-Center-Adding-icons-into-your-theme 

    Wes also suggested another solution not using font awesome icons here: https://support.zendesk.com/hc/en-us/community/posts/211589848-Adding-category-images-to-the-Copenhagen-Theme

     

     

  • Avatar
    Zachary (Edited )

    Hello Zendesk team,

    New to Zendesk so bear with me. I'm trying to edit the source code of a particular article (specifically, I am trying to wrap a <p> element within <a> elements to make the entire piece clickable - which is pretty common), but the changes I make are getting stripped out. I assumed it has something to do with TinyMCE, but is there a way to prevent this? Is it only stripping in the preview and it will save in production?

    Any help would be appreciated.

    Thanks!

  • Avatar
    Jessie - Community Manager

    Hey Zachary!

    Just to clarify, do you have unsafe HTML enabled in your Help Center? 

    I'm going to check with some of our Community Moderations to have them take a look for you.

  • Avatar
    Zachary

    I do, yes. I'm also only using <p> and <a> elements, which are listed as safe. 

    I'm trying to change this:

    <p>Foo bar <a href="my-website" target="_blank">blog post</a>.</p>

    To this:

    <a href="my-website" target="_blank"><p>Foo bar blog post.</p></a>

    But each time I make the changes, the <a> elements are stripped out, which leaves just this:

    <p>Foo bar blog post.</p>

    Am I doing something wrong?

  • Avatar
    Jessie - Community Manager

    Hey Zachary!

    Yeah, I don't have any insights to share on this. I'll ping the Moderators again to see if they can help!

  • Avatar
    Jacob J Christensen

    Hi Zachary,

    This isn't really my area of expertise, but it looks to me like the <p> inside <a> element is not always allowed and some browsers are not handling it well, even when it is allowed.

    I'm just guessing, but maybe the editor is stripping it to prevent unwanted rendering.

    Is there a reason why you don't simply mark the entire content and use the editor to hyperlink everything?

    Hope I'm being helpful, otherwise just tell me off...

Please sign in to leave a comment.

Powered by Zendesk