Modify

Opened 8 years ago

Closed 6 years ago

#12731 closed defect (worksforme)

Some Blank Lines in Shell Scripts are Dropped

Reported by: trac-hacks.org@… Owned by: Ryan J Ollos
Priority: normal Component: IncludeMacro
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

Very useful plugin.

I'm including a bash script from my Git repository. It looks great, but only the blank line right after the shebang is displayed. All of the later blank lines in the file are dropped. I'm calling the macro thus:

[[Include(source:repo/path/to/script@b2cb8e4c, application/x-shellscript)]]

Attachments (0)

Change History (4)

comment:1 Changed 6 years ago by Ryan J Ollos

#13386 closed as a duplicate.

comment:2 Changed 6 years ago by Ryan J Ollos

Possible fix that I received by email:

  • includemacro/macros.py

     
    189189
    190190        # Escape if needed.
    191191        if not self.config.getbool('wiki', 'render_unsafe_content', False):
    192             out = to_unicode(out)
     192            if source_format in ('source', 'browser', 'repos'):
     193                out = out.render(encoding=None, strip_whitespace=False)
     194            else:
     195                out = to_unicode(out)
    193196            try:
    194197                out = HTMLParser(StringIO(out)).parse() | HTMLSanitizer()
    195198            except ParseError:

comment:3 Changed 6 years ago by Ryan J Ollos

Status: newaccepted

comment:4 Changed 6 years ago by Ryan J Ollos

Resolution: worksforme
Status: acceptedclosed

I cannot reproduce in Trac 1.0-stable, 1.2-stable or trunk. Please provide your Genshi version, and whether you are running with or without speedups.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.