Description
When entering #!/bin/bash into a code block, MoinMoin does not show the line in the HTML view.
Steps to reproduce
Create a new page (or edit the SandBox)
- Create a new code block containing a sample bash script (for example)
- Save and view the page
- The hashbang line is not rendered in the HTML
I expect to see the #!/bin/bash
Example
This isn't showing the #!/bin/bash line.
echo foobar
Nor does this show the #!/usr/bin/env python line.
def foo: bar
This does as the formatter doesn't think that this is a formatting line.
- #!/bin/bash echo foobar
Component selection
- general - formatter
Details
This Wiki.
Workaround
Add something else on the line preceeding #!/bin/bash
Or apply this HORRIBLE patch (against 1.6.3):
--- formatter/__init__.py-orig 2008-07-23 19:07:03.000000000 +0100 +++ formatter/__init__.py-new 2008-07-23 19:06:12.000000000 +0100 @@ -317,6 +317,8 @@ return self.text(errmsg) def _get_bang_args(self, line): + if line.startswith('#!/'): + return None if line.startswith('#!'): try: name, args = line[2:].split(None, 1)
Discussion
The parser successfully negotiates that the content type should be 'text', but the formatter removes the line if it begins with '#!'. Since many wiki's probably are used for code snippets, these lines are probably missing.
It doesn't seem to affect the version of MoinMoin running at http://moinmoin.wikiwikiweb.de though... (1.5.9)
if your stuff begins with #! and you want to see that as content (or it is not meant as parser format spec for moin), you have to add another #! line specifying the parser you want to use:
{{{ #!python #!/usr/bin/env python def foo: bar }}}
Renders as:
Plan
- Priority:
- Assigned to:
- Status: