Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

Commit

Permalink
Fix Bug: support or \n in variable type (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
yannanwang1 authored and bianliu1013 committed Oct 30, 2017
1 parent 2943686 commit 73d8e3c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion docfx_yaml/monkeypatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,18 @@ def extract_exception_desc(field_object):
_data = make_param(_id=_id, _type=_para_types, _description=_description)
data['parameters'].append(_data)
if fieldtype.name == 'variable':
_para_types.append(_type)
if _type:
# Support or in variable type
for _s_type in re.split('[ \n]or[ \n]', _type):
_s_type, _added_reference = resolve_type(_s_type)
if _added_reference:
if len(data['references']) == 0:
data['references'].append(_added_reference)
elif any(r['uid'] != _added_reference['uid'] for r in data['references']):
data['references'].append(_added_reference)

_para_types.append(_s_type)

_data = make_param(_id=_id, _type=_para_types, _description=_description)
data['variables'].append(_data)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setup(
name='sphinx-docfx-yaml',
version='1.2.25',
version='1.2.26',
author='Eric Holscher',
author_email='eric@ericholscher.com',
url='https://github.com/ericholscher/sphinx-docfx-yaml',
Expand Down

0 comments on commit 73d8e3c

Please sign in to comment.