From 42f2b305791507e6bfe9507832daefc5071969cd Mon Sep 17 00:00:00 2001 From: Rob Ruana Date: Sun, 3 May 2015 16:28:39 -0700 Subject: [PATCH] Closes #1831: [Napoleon] Makes google type regex greedy to consume entire type, even if it contains colons --- sphinx/ext/napoleon/docstring.py | 24 +++++++------- tests/test_ext_napoleon_docstring.py | 47 ++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 12 deletions(-) diff --git a/sphinx/ext/napoleon/docstring.py b/sphinx/ext/napoleon/docstring.py index e893226dc..1ac7d869f 100644 --- a/sphinx/ext/napoleon/docstring.py +++ b/sphinx/ext/napoleon/docstring.py @@ -23,8 +23,8 @@ from sphinx.util.pycompat import UnicodeMixin _directive_regex = re.compile(r'\.\. \S+::') -_google_untyped_arg_regex = re.compile(r'\s*(.+?)\s*:\s*(.*)') -_google_typed_arg_regex = re.compile(r'\s*(.+?)\s*\(\s*(.+?)\s*\)\s*:\s*(.*)') +_google_untyped_arg_regex = re.compile(r'(.+)\s*(?