# HG changeset patch # User Paul Boddie # Date 1371225712 -7200 # Node ID ea518fa2d815f1ee15325b75dcd7c4924fe0effc # Parent 448e3575c8ddacb77d121d0aacbfe98cb7bbb678 Made use of a MoinSupport function for formatting. diff -r 448e3575c8dd -r ea518fa2d815 MoinShare.py --- a/MoinShare.py Fri Jun 14 15:59:21 2013 +0200 +++ b/MoinShare.py Fri Jun 14 18:01:52 2013 +0200 @@ -164,14 +164,11 @@ if "text/html" in update.preferred: parser_cls = getParserClass(request, format) - parser = parser_cls(body, request) if format == "html": update.content = body - elif hasattr(parser, "formatForOutputType"): - s = codecs.getwriter("utf-8")(StringIO()) - parser.formatForOutputType("text/html", write=s.write) - update.content = unicode(s.getvalue(), "utf-8") + elif hasattr(parser_cls, "formatForOutputType"): + update.content = formatTextForOutputType(body, request, parser_cls, "text/html") else: fmt = request.html_formatter fmt.setPage(page)