# HG changeset patch # User Paul Boddie # Date 1341960450 -7200 # Node ID 43371b8d3dc1337d9dde62ca860d981143649595 # Parent a618b2b858b92d7b6140651d84d7e8aeecf4e829 Moved formatting-related functions to MoinSupport. diff -r a618b2b858b9 -r 43371b8d3dc1 ImprovedTableParser.py --- a/ImprovedTableParser.py Sun Jun 17 20:45:00 2012 +0200 +++ b/ImprovedTableParser.py Wed Jul 11 00:47:30 2012 +0200 @@ -269,34 +269,6 @@ table_attrs[name] = value del attrs[name] -# Formatting of embedded content. - -def getFormatterClass(request, format): - - """ - Return a formatter class using the 'request' for the given output 'format', - returning a plain text formatter if no formatter can be found for the - specified 'format'. - """ - - try: - return wikiutil.searchAndImportPlugin(request.cfg, "formatter", format or "plain") - except wikiutil.PluginMissingError: - return wikiutil.searchAndImportPlugin(request.cfg, "formatter", "plain") - -def formatText(text, request, fmt): - - "Format the given 'text' using the specified 'request' and formatter 'fmt'." - - parser_cls = getParserClass(request, request.page.pi["format"]) - parser = parser_cls(text, request, line_anchors=False) - old_fmt = request.formatter - request.formatter = fmt - try: - return redirectedOutput(request, parser, fmt, inhibit_p=True) - finally: - request.formatter = old_fmt - # Sorting utilities. def get_sort_columns(s, start=0):