sphinx-contrib / matlabdomain

A Sphinx extension for documenting Matlab code
http://sphinxcontrib-matlabdomain.readthedocs.io/
Other
69 stars 45 forks source link

fix autolink error that occurs when "See Also" line is succeeded by "--------" #197

Closed luhuhis closed 1 year ago

luhuhis commented 1 year ago

This usually happens when using numpy syntax docstrings, i.e.

    % See Also
    % --------
    % some text here

The errors looks like this:

File "/home/luis/.local/lib/python3.10/site-packages/sphinxcontrib/mat_documenters.py", line 206, in auto_link_see_also
    entries_str = match.group(2)  # the entries
AttributeError: 'NoneType' object has no attribute 'group'

The fix looks like this (line 206 is new):

https://github.com/sphinx-contrib/matlabdomain/blob/f52ccbaa3e22117ebb9f4975624357db5fb37acf/sphinxcontrib/mat_documenters.py#L206-L207