-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Description
A simple example to reproduce:
>>> text = """
... Spam.
...
... :param eggs: bacon.
... "
>>> import docstring_to_markdown
>>> docstring_to_markdown.looks_like_rst(text)
False
The reason is that the regex search in docstring_to_markdown.looks_like_rst()
does not use the eventual flags from the directive. In the above example, the responsible directive has the multiline flag set:
docstring-to-markdown/docstring_to_markdown/rst.py
Lines 131 to 135 in cceaeab
Directive( | |
pattern=r'^\s*:({}) (?P<param>\S+):'.format('|'.join(SPHINX_PARAM)), | |
replacement=r'- `\g<param>`:', | |
flags=re.MULTILINE | |
), |
but the function never uses it:
docstring-to-markdown/docstring_to_markdown/rst.py
Lines 341 to 342 in cceaeab
for directive in RST_DIRECTIVES: | |
if re.search(directive.pattern, value): |
Metadata
Metadata
Assignees
Labels
No labels