1. Kayako Download customers: we will continue to develop and support Kayako Download beyond July 2017, alongside the new Kayako for existing customers.

    Find out more.

  2. The forum you are viewing relates to Kayako Classic. If you signed up or upgraded to the new Kayako (after the 4th July 2016), the information in this thread may not apply to you. You can visit the forums for the new Kayako here.

Recommended Allowable HTML Tags

Discussion in 'Using Kayako Classic' started by tallen-bt, Sep 1, 2011.

  1. tallen-bt

    tallen-bt Established Member

    So are replies already received lost as far as formatting?
     
  2. Gary McGrath

    Gary McGrath Staff Member

    Pretty much yes, they will be stored without line breaks ( you can fix them, but you would need to edit it in SQL directly to add back in line breaks where needed )

    Gary
     
  3. tallen-bt

    tallen-bt Established Member

    Or I could edit the reply and do the same thing. Yeah it looks like it fixed it for both forwarding and replies. Too bad the original isn't kept and just 're-parsed'. Would make these kinds of things easier :rolleyes:
     
  4. Gary McGrath

    Gary McGrath Staff Member

    Excellent :) Least that one was more easy to get to the bottom of!

    Gary
     
  5. tallen-bt

    tallen-bt Established Member

    Definitely! Thanks again for your help!
     
  6. tallen-bt

    tallen-bt Established Member

    Another parsing question! Word/Outlook spits out:
    HTML:
    "><![if !supportLists]><span style="mso-list:Ignore">1.<span style="font:7.0pt &quot;Times New Roman&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><![endif]>
    Since Kayako doesn't know how to render it, I get funniness like this:
    ListFunniness.PNG

    Is there a way this can be changed? Not sure if doing a find/replace for code like that in the rendering and replacing it with clean html lists will solve it. Ideas?
     
  7. Gary McGrath

    Gary McGrath Staff Member

    The question here is how you would want it parsed, its got an if statement for "use this code" or "use this instead", you would have to remove the if stuff ( thats not even valid html! ) and decide what to replace it with.

    Gary
     
  8. tallen-bt

    tallen-bt Established Member

    Yeah I know it isn't valid. Ideally I would replace it with a list tag instead to make it an HTML list and not that grime that Microsoft uses. Though I see this becoming very complex.
     
  9. stevenutt

    stevenutt Established Member

    I've seen Outlook do quite a few of those types of things.

    As well as a few more serious problems, such as the other day we got a email that didn't display at all in the support system. I finally tracked down the problem to Outlook putting style formatting within a email ref, i.e:
    Code:
    <a href="mailto:..."><span style='color:blue'>...</span></a>
    - email taken out to protect the guilty.
    For the moment I've just had to take "a" out of the allowed tags.

    But regarding the outlook "if" things, they're used in lot's of places and are broke. However at least in the case of the lists (which we get too), it actually shows the list.

    Apart from things just not showing, my worst broken html stuff is when people use tables for their signatures and then don't close the td, tr and table tags properly (see image below) as this really messes up the ticket and I really don't want to have to kill tables in the rest of the emails as people send us through info in tables a lot...
    tableSig.JPG
     
  10. Gary McGrath

    Gary McGrath Staff Member

    If you close the table with an /table tag, will it stop further issues, even if its missing /tr or /td tags? if so, there could be a parser fix that could be made to address it

    Gary
     
  11. tallen-bt

    tallen-bt Established Member

    I am not quite sure I understand the 'Email Tag' issue based on what you mentioned in your post. I don't think your issue spans from the code you mentioned...

    HTML:
    <![if !supportLists]><span style='font-family:Symbol'><span style='mso-list:Ignore'>&middot;<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span></span><![endif]>Text Goes Here
    I noticed some emails actually render that as a bullet list and some just fail (per my original picture a few comments up.
     
  12. stevenutt

    stevenutt Established Member

    @Gary agreed we probably just need to close the table tag, it'd be nice if we could parse it so that it could work out if there was a missing table tag...

    @tallen-bt, I may be wrong about what exactly was causing the post not to display, but I do know that when I removed the "a" from the list of allowed tags it was visable (it might have also become visible if I had removed the span, but that would have killed off to much of the other formatting and I'd rather just have people have to copy and paste emails and links).
     
  13. Gary McGrath

    Gary McGrath Staff Member

    Steve,

    Can you give me a copy of raw source of an email where the table formatting on signatures is breaking everything, so I can run it through a parser test.

    Gary
     
  14. stevenutt

    stevenutt Established Member

    Below is 2 examples, one comes directly from the email, the other is as per the system edit button, I'll also try and grab and example from the mysql db to see which that holds.

    p.s. Took out second name, email, phone and part of company as this is a customer so probably shouldn't spread that stuff around.

    Code:
    <table>
    <tr valign=top>
    <td><font size=5 color=blue>Russell</font>
    
    <tr valign=top>
    <td><font size=3>Technical Specialist</font>
    <tr valign=top>
    <td><font size=1>__________________________________</font>
    <tr valign=top>
    <td><font size=3><b>... Foods ISC</b></font>
    <tr valign=top>
    <td><font size=3>TEL: <b>...</b></font>
    
    <tr valign=top>
    <td><font size=3>MOB: <b>...</b></font>
    <tr valign=top>
    <td><font size=3 color=blue>[email taken out]</font></table>
    <p><font size=3>&nbsp;</font>
    HTML:
    ><table><tr valign=top><td><font size=5 color=blue>Russell</font><tr valign=top><td><font size=3>Technical Specialist</font><tr valign=top><td><font size=1>
    p.p.s Just took out the ______ breakline in case that was causing an issue, but it seemed to make no difference...
     
  15. Gary McGrath

    Gary McGrath Staff Member

    The only issue with the above... it has an /table tag in it, its still broken?

    Edit: oh wait, I see the top one is ok, but the second one is missing it
    Gary
     
  16. stevenutt

    stevenutt Established Member

    Yep, it seems that it is passed and the last bit is ripped off, this could actually be because I had the Breakline of ________ in (as that is in by default) and have only just taken it out.

    Putting an extra </table> at the end of these posts does fix it, but I'd rather only put that in to ones that have this problem, as otherwise I'm just breaking the html for the sake of it...

    By the way the way the swticketposts table stores it as this:
    HTML:
    <table><tr valign=top><td><font size=5 color=blue>Russell</font><tr valign=top><td><font size=3>Technical Specialist</font><tr valign=top><td><font size=1>
     
  17. Gary McGrath

    Gary McGrath Staff Member

    Hi Steve,

    On your strip tags function, add this code before it calls the "return strip_tags_attributes" line at the end.

    Code:
    $_tcount = substr_count($_contents, '<table');
    $_tccount = substr_count($_contents, '</table>');
    if ($_tcount > $_tccount) {
    $_x = 1;
    while($_x <= ($_tcount - $_tccount)) {
    $_contents = $_contents . "</table>";
    $_x++;
    }
    }
    
    
    Gary
     
    stevenutt likes this.
  18. stevenutt

    stevenutt Established Member

    Hi Gary,

    Excellent, as usual, perfect fix.

    Cheers
     
  19. Gary McGrath

    Gary McGrath Staff Member

    Your welcome :)

    Gary
     
  20. George Black

    George Black New Member

    Thanks for sharing the iformation. It's just what I needed.
     

Share This Page