From e79b3fda1418889b9c0f14039eeb756ff804d03f Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Tue, 14 Mar 2023 10:48:14 +0100 Subject: [PATCH] pandoc: disable "smart" option only for version 2.0+ --- src/nbsphinx/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nbsphinx/__init__.py b/src/nbsphinx/__init__.py index 4c968afc..ad7ebf5e 100644 --- a/src/nbsphinx/__init__.py +++ b/src/nbsphinx/__init__.py @@ -1010,10 +1010,11 @@ def filter_func(text): input_format = 'markdown' input_format += '-implicit_figures' - input_format += '-smart' # Smart quotes etc. are handled by Sphinx v = nbconvert.utils.pandoc.get_pandoc_version() if nbconvert.utils.version.check_version(v, '1.13'): input_format += '-native_divs+raw_html' + if nbconvert.utils.version.check_version(v, '2.0'): + input_format += '-smart' # Smart quotes etc. are handled by Sphinx rststring = pandoc(text, input_format, 'rst', filter_func=filter_func) rststring = re.sub(