[rtems-central commit] glossary: Canonicalize terms

Sebastian Huber sebh at rtems.org
Tue May 9 13:45:26 UTC 2023


Module:    rtems-central
Branch:    master
Commit:    18e54908b4d9f6cf267d52ebcf7a849e9b154f40
Changeset: http://git.rtems.org/rtems-central/commit/?id=18e54908b4d9f6cf267d52ebcf7a849e9b154f40

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri May  5 14:41:19 2023 +0200

glossary: Canonicalize terms

---

 rtemsspec/glossary.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rtemsspec/glossary.py b/rtemsspec/glossary.py
index 1396346d..205d9ceb 100644
--- a/rtemsspec/glossary.py
+++ b/rtemsspec/glossary.py
@@ -68,6 +68,7 @@ def _generate_glossary_content(terms: ItemMap, header: str, target: str,
 
 _TERM = re.compile(r":term:`([^`]+)`")
 _TERM_2 = re.compile(r"^[^<]+<([^>]+)>")
+_SPACE = re.compile(r"\s+")
 
 
 def _find_glossary_terms(path: str, document_terms: ItemMap,
@@ -80,6 +81,7 @@ def _find_glossary_terms(path: str, document_terms: ItemMap,
                 match = _TERM_2.search(term)
                 if match:
                     term = match.group(1)
+                term = _SPACE.sub(" ", term)
                 item = glossary.term_to_item[term]
                 document_terms[item.uid] = item
 



More information about the vc mailing list