regex for finding :ref: labels was flawed

The regex to find labels inside of angle brackets was not detecting
anything before so I missed all of those.
* Fixed the regex in find-plugin-refs to take care of that.
* Fixed plugin_formatter to emit namespaced labels for the M() macro.
pull/38960/head
Toshio Kuratomi 6 years ago
parent a833281e22
commit f9d83944ec

@ -38,7 +38,7 @@ def plugin_names(topdir):
def process_refs(topdir, plugin_names):
REF_RE = re.compile(':ref:`([^`]*)`')
LABEL_RE = re.compile('<[^>]*>`$')
LABEL_RE = re.compile('<([^>]*)>$')
# Walk the whole docs tree looking for :ref:. Anywhere those are found, search for `([^`]*)`
for dirpath, dirnames, filenames in os.walk(topdir):

@ -91,7 +91,7 @@ def rst_ify(text):
try:
t = _ITALIC.sub(r"*\1*", text)
t = _BOLD.sub(r"**\1**", t)
t = _MODULE.sub(r":ref:`\1 <\1>`", t)
t = _MODULE.sub(r":ref:`\1 <\1_module>`", t)
t = _LINK.sub(r"`\1 <\2>`_", t)
t = _URL.sub(r"\1", t)
t = _CONST.sub(r"`\1`", t)

Loading…
Cancel
Save