diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-06-17 17:43:21 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2020-07-03 10:22:45 +0200 |
commit | 08769f1e0373691c6f67455ae7cbb60c17af57df (patch) | |
tree | 4fe3daed1adc7ba8e451fbaef80482b5c1118b0a /rtemsqual/sphinxcontent.py | |
parent | sphinxcontent: Optional wrap in add_definition_item() (diff) | |
download | rtems-central-08769f1e0373691c6f67455ae7cbb60c17af57df.tar.bz2 |
sphinxcontent: Fine tune _to_camel_case()
Diffstat (limited to '')
-rw-r--r-- | rtemsqual/sphinxcontent.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/rtemsqual/sphinxcontent.py b/rtemsqual/sphinxcontent.py index 95f8438c..15c7d3d4 100644 --- a/rtemsqual/sphinxcontent.py +++ b/rtemsqual/sphinxcontent.py @@ -42,9 +42,8 @@ _HEADER_LEVELS = ["#", "*", "=", "-", "^", "\""] def _to_camel_case(name: str) -> str: return name[0].upper() + re.sub( - r"[^a-zA-Z0-9]", "X", - re.sub(r"[ \n\t]+([a-zA-Z0-9])", lambda match: match.group(1).upper(), - name[1:])) + r"\s+(.)", lambda match: match.group(1).upper(), + re.sub(r"[^ \t\n\r\f\va-zA-Z0-9]", " ", name[1:].replace("+", "X"))) def get_reference(label: str, name: Optional[str] = None) -> str: |