From 08fc4a02b4df7f4a53b375e37820c88b375fe9a8 Mon Sep 17 00:00:00 2001 From: John McFarland Date: Sat, 25 May 2019 14:33:41 -0500 Subject: [PATCH] Eliminate extra newlines around doxygen python block math Eliminate extra leading and trailing newlines around the \f[ and \f{ block math commands for doxygen comment translation for python. Update tests accordingly. --- .../test-suite/python/doxygen_translate_all_tags_runme.py | 4 ---- Source/Doxygen/pydoc.cxx | 3 --- 2 files changed, 7 deletions(-) diff --git a/Examples/test-suite/python/doxygen_translate_all_tags_runme.py b/Examples/test-suite/python/doxygen_translate_all_tags_runme.py index 7cf09fb56..78bf73870 100644 --- a/Examples/test-suite/python/doxygen_translate_all_tags_runme.py +++ b/Examples/test-suite/python/doxygen_translate_all_tags_runme.py @@ -90,13 +90,10 @@ r""":raises: SuperError :math:`\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}` - .. math:: \sqrt{(x_2-x_1)^2+(y_2-y_1)^2} - - .. math:: \sqrt{(x_2-x_1)^2+(y_2-y_1)^2} @@ -111,7 +108,6 @@ r""":raises: SuperError - This will only appear in hmtl""") comment_verifier.check(inspect.getdoc(doxygen_translate_all_tags.func05), diff --git a/Source/Doxygen/pydoc.cxx b/Source/Doxygen/pydoc.cxx index 31ec972d6..688318dd9 100644 --- a/Source/Doxygen/pydoc.cxx +++ b/Source/Doxygen/pydoc.cxx @@ -446,7 +446,6 @@ void PyDocConverter::handleMath(DoxygenEntity &tag, std::string &translatedComme indent.Init(translatedComment, m_indent); trimWhitespace(translatedComment); - translatedComment += '\n'; const string formulaIndent = indent.getFirstLineIndent(); translatedComment += formulaIndent; @@ -480,8 +479,6 @@ void PyDocConverter::handleMath(DoxygenEntity &tag, std::string &translatedComme if (inlineFormula) { translatedComment += "`"; - } else { - translatedComment += '\n'; } }