Ticket #1270: html.2.diff

File html.2.diff, 606 bytes (added by Malcolm Tredinnick <malcolm@…>, 19 years ago)

Updated patch using &#39;.

  • html.py

     
    2424    "Returns the given HTML with ampersands, quotes and carets encoded"
    2525    if not isinstance(html, basestring):
    2626        html = str(html)
    27     return html.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('"', '&quot;')
     27    return html.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;').replace('"', '&quot;').replace("'","&#39;")
    2828
    2929def linebreaks(value):
    3030    "Converts newlines into <p> and <br />s"
Back to Top