From ee7c81842e62034ffb55ae07798b0a2dc108ad29 Mon Sep 17 00:00:00 2001 From: CrossNox Date: Mon, 6 Apr 2020 11:28:09 -0300 Subject: [PATCH] suffix arg removed from sphinx v3.0.0 --- m2r.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/m2r.py b/m2r.py index a4e43c2..58280e7 100644 --- a/m2r.py +++ b/m2r.py @@ -649,11 +649,11 @@ def setup(app): app.add_config_value('m2r_parse_relative_links', False, 'env') app.add_config_value('m2r_anonymous_references', False, 'env') app.add_config_value('m2r_disable_inline_math', False, 'env') - if hasattr(app, 'add_source_suffix'): + try: + app.add_source_parser('.md', M2RParser) # for older sphinx versions + except TypeError: app.add_source_suffix('.md', 'markdown') app.add_source_parser(M2RParser) - else: - app.add_source_parser('.md', M2RParser) app.add_directive('mdinclude', MdInclude) metadata = dict( version=__version__,