ticket:845: 0001-HTMLWasher-quick-fix-for-handling-of-URLs.patch

File 0001-HTMLWasher-quick-fix-for-handling-of-URLs.patch, 1.2 KB (added by jcaffaro, 3 years ago)

Quick workaround deployed on CDS

  • modules/miscutil/lib/htmlutils.py

    From 653c781e32aeef0aeb1c7535bfe1e75c2df6f2de Mon Sep 17 00:00:00 2001
    From: Jerome Caffaro <jerome.caffaro@cern.ch>
    Date: Fri, 18 Nov 2011 09:38:15 +0100
    Subject: [PATCH] HTMLWasher: quick fix for handling of URLs
    
    ---
     modules/miscutil/lib/htmlutils.py |   10 +---------
     1 files changed, 1 insertions(+), 9 deletions(-)
    
    diff --git a/modules/miscutil/lib/htmlutils.py b/modules/miscutil/lib/htmlutils.py
    index 06fece6..7dd0e28 100644
    a b class HTMLWasher(HTMLParser): 
    204204    def handle_data(self, data): 
    205205        """Function called for text nodes""" 
    206206        if not self.silent: 
    207             # let's to check if data contains a link 
    208             import string 
    209             if string.find(str(data),'http://') == -1: 
    210                 self.result += cgi.escape(data, True) 
    211             else: 
    212                 if self.url: 
    213                     if self.url <> data: 
    214                         self.url = '' 
    215                         self.result += '(' + cgi.escape(data, True) + ')' 
     207            self.result += cgi.escape(data, True) 
    216208 
    217209    def handle_endtag(self, tag): 
    218210        """Function called for ending of tags"""