--- widget.py.subpages 2009-07-31 13:04:28.000000000 +0100 +++ widget.py 2009-07-31 13:05:53.000000000 +0100 @@ -17,6 +17,7 @@ #from MoinMoin.parser.wiki import Parser from MoinMoin.parser.text_moin_wiki import Parser from StringIO import StringIO +from copy import copy import re # TupleList is based on Dict from MoinMoin.wikidict @@ -205,17 +206,13 @@ else: # Option 1b: It's wikiformatted formattedwiki = StringIO() - # The following is copied from MoinMoin._tests.test_parser_wiki - request = RequestCLI() + + self.request.formatter.page = self.request.page + request = copy(self.request) request.redirect(formattedwiki) - page = Page(self.request, 'ThisPageDoesNotExistsAndWillNeverBeReally') - page.set_raw_body(unformattedPage) - from MoinMoin.formatter.text_html import Formatter - page.formatter = Formatter(request) - request.formatter = page.formatter - page.formatter.setPage(page) - - Parser(unformattedPage, request).format(page.formatter) + request.page.set_raw_body(unformattedPage) + + Parser(unformattedPage, request).format(request.formatter) menuHtml = formattedwiki.getvalue() else: # Option 2: It's an attachment