diff --git a/bandit/core/docs_utils.py b/bandit/core/docs_utils.py index 6c2a6402..8f268e04 100644 --- a/bandit/core/docs_utils.py +++ b/bandit/core/docs_utils.py @@ -31,7 +31,16 @@ def get_url(bid): info = extension_loader.MANAGER.blacklist_by_id.get(bid, None) if info is not None: template = 'blacklists/blacklist_{kind}.html#{id}-{name}' + info['name'] = info['name'].replace('_', '-') + if info['id'].startswith('B3'): # B3XX + # Some of the links are combined, so we have exception cases + if info['id'] in ['B304', 'B305']: + info['id'] = 'b304-b305' + info['name'] = 'ciphers-and-modes' + elif info['id'] in ['B313', 'B314', 'B315', 'B316', 'B317', + 'B318', 'B319', 'B320']: + info['id'] = 'b313-b320' ext = template.format( kind='calls', id=info['id'], name=info['name']) else: