1.1 --- a/moinformat/parsers/__init__.py Tue Jul 24 18:45:13 2018 +0200
1.2 +++ b/moinformat/parsers/__init__.py Tue Jul 24 18:45:32 2018 +0200
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Moin wiki parsers.
1.6
1.7 -Copyright (C) 2017 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2017, 2018 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -20,10 +20,15 @@
1.13 """
1.14
1.15 from moinformat.parsers.manifest import parsers
1.16 +from moinformat.parsers.moin import MoinParser
1.17
1.18 # Top-level functions.
1.19
1.20 -def parse(s, formats=None):
1.21 - return parsers["moin"](formats).parse(s)
1.22 +def parse(s, parser=None):
1.23 +
1.24 + "Parse 's' with 'parser' or the Moin format parser if omitted."
1.25 +
1.26 + parser = parser or MoinParser(parsers)
1.27 + return parser.parse(s)
1.28
1.29 # vim: tabstop=4 expandtab shiftwidth=4