From f9d83944ecc3f76505307c954964337647b8f629 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 18 Apr 2018 07:28:31 -0700 Subject: [PATCH] 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. --- docs/bin/find-plugin-refs.py | 2 +- docs/bin/plugin_formatter.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/bin/find-plugin-refs.py b/docs/bin/find-plugin-refs.py index 427c1cbbf87..dee8ce68c9c 100755 --- a/docs/bin/find-plugin-refs.py +++ b/docs/bin/find-plugin-refs.py @@ -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): diff --git a/docs/bin/plugin_formatter.py b/docs/bin/plugin_formatter.py index 12a034f62e9..62c42ca70eb 100755 --- a/docs/bin/plugin_formatter.py +++ b/docs/bin/plugin_formatter.py @@ -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)