From a2241f6a2721cfe131346b2357283d9ebfd0af4e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 22 Aug 2019 22:20:39 +0200 Subject: [PATCH] m.dox: minor cleanup. --- plugins/m/dox.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/m/dox.py b/plugins/m/dox.py index 2ce5ec71..be765c64 100644 --- a/plugins/m/dox.py +++ b/plugins/m/dox.py @@ -36,7 +36,7 @@ import logging logger = logging.getLogger(__name__) -# Modified from __init__ to add support for queries and hashes +# Modified from abbr / gh / gl / ... to add support for queries and hashes link_regexp = re.compile(r'(?P.*) <(?P<link>[^?#]+)(?P<hash>[?#].+)?>') def parse_link(text): @@ -51,8 +51,6 @@ def parse_link(text): return title, link, hash def init(tagfiles, input): - rst.roles.register_local_role('dox', dox) - global symbol_mapping, symbol_prefixes, tagfile_basenames # Pre-round to populate subclasses. Clear everything in case we init'd @@ -171,6 +169,8 @@ def dox(name, rawtext, text, lineno, inliner: Inliner, options={}, content=[]): return [node], [] def register_mcss(mcss_settings, **kwargs): + rst.roles.register_local_role('dox', dox) + init(input=mcss_settings['INPUT'], tagfiles=mcss_settings.get('M_DOX_TAGFILES', [])) -- 2.30.2