Edgewall Software

Ticket #2048: 2048.patch

File 2048.patch, 1.7 KB (added by cboos, 6 years ago)

patch against 0.9b1 (or close) for the proposed feature

  • trac.css

     
    360360table.listing tbody tr:hover { background: #eed !important } 
    361361 
    362362/* Styles for the error page (and rst errors) */ 
     363span.notice { 
     364 background: #fcb; 
     365 border: 1px dotted #d00; 
     366 color: #500; 
     367 padding: 0 0 0 .5em; 
     368 margin: .5em; 
     369} 
    363370#content.error .message, div.system-message { 
    364371 background: #fdc; 
    365372 border: 2px solid #d00; 
  • formatter.py

     
    4444SUBSCRIPT_TOKEN = ",," 
    4545SUPERSCRIPT_TOKEN = r"\^" 
    4646INLINE_TOKEN = "`" 
     47NOTICE_TOKEN = r"\*\*\*" 
    4748 
    4849LINK_SCHEME = r"[\w.+-]+" # as per RFC 2396 
    4950 
     
    144145                  r"(?P<strike>!?%s)" % STRIKE_TOKEN, 
    145146                  r"(?P<subscript>!?%s)" % SUBSCRIPT_TOKEN, 
    146147                  r"(?P<superscript>!?%s)" % SUPERSCRIPT_TOKEN, 
     148                  r"(?P<notice>!?%s)" % NOTICE_TOKEN, 
    147149                  r"(?P<inlinecode>!?\{\{\{(?P<inline>.*?)\}\}\})", 
    148150                  r"(?P<inlinecode2>!?%s(?P<inline2>.*?)%s)" % (INLINE_TOKEN, 
    149151                                                                INLINE_TOKEN), 
     
    376378        else: 
    377379            return self.simple_tag_handler('<sup>', '</sup>') 
    378380 
     381    def _notice_formatter(self, match, fullmatch): 
     382        print match 
     383        if match[0] == '!': 
     384            return match[1:] 
     385        else: 
     386            return self.simple_tag_handler('<span class="notice">', '</span>') 
     387 
    379388    def _inlinecode_formatter(self, match, fullmatch): 
    380389        return '<tt>%s</tt>' % fullmatch.group('inline') 
    381390