Edgewall Software

Ticket #127: genshi-python-pi-whitespace.patch

File genshi-python-pi-whitespace.patch, 708 bytes (added by Dale Sedivec <dale-keyword-genshi.e8bcba@…>, 16 years ago)

Trivial patch to rstrip source code in a <?python?> code block

  • genshi/template/markup.py

     
    193193                    # number quite right
    194194                    lines = [line.expandtabs() for line in data[1].splitlines()]
    195195                    first = lines[0]
    196                     rest = dedent('\n'.join(lines[1:]))
     196                    rest = dedent('\n'.join(lines[1:])).rstrip()
    197197                    if first.rstrip().endswith(':') and not rest[0].isspace():
    198198                        rest = '\n'.join(['    ' + line for line
    199199                                          in rest.splitlines()])