Edgewall Software

Ticket #5639: css-conversion.patch

File css-conversion.patch, 1.3 KB (added by jens.b@…, 5 years ago)

patch against trunk (rv5790)

  • web_ui.py

     
    6262    def get_supported_conversions(self): 
    6363        yield ('txt', _('Plain Text'), 'txt', 'text/x-trac-wiki', 'text/plain', 
    6464               9) 
     65        yield ('css', _('Style sheet'), 'css', 'text/x-trac-wiki', 'text/css', 
     66               9) 
    6567 
    6668    def convert_content(self, req, mimetype, content, key): 
    67         # Tell the browser that the content should be downloaded and 
    68         # not rendered. The x=y part is needed to keep Safari from being  
    69         # confused by the multiple content-disposition headers. 
    70         req.send_header('Content-Disposition', 'attachment; x=y') 
     69        if key == 'txt': 
     70            # Tell the browser that the content should be downloaded and 
     71            # not rendered. The x=y part is needed to keep Safari from being  
     72            # confused by the multiple content-disposition headers. 
     73            req.send_header('Content-Disposition', 'attachment; x=y') 
    7174 
    72         return (content, 'text/plain;charset=utf-8') 
     75            return (content, 'text/plain;charset=utf-8') 
     76        elif key == 'css': 
     77            return (content, 'text/css;charset=utf-8') 
    7378 
    7479    # INavigationContributor methods 
    7580