]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
Utils: fix help section normalization
authorAaron Lauterer <a.lauterer@proxmox.com>
Tue, 10 Nov 2020 09:34:13 +0000 (10:34 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 10 Nov 2020 10:53:29 +0000 (11:53 +0100)
We need to replace all occurences when normalizing underscores or
dashes.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
src/Utils.js

index 7710e39d084f78237ef344af618dc277084a687c..781c95d7fc79ce25a31d936b82e172f6387b0695 100644 (file)
@@ -777,11 +777,11 @@ utilities: {
        }
        // try to normalize - and _ separators, to support asciidoc and sphinx
        // references at the same time.
-       let section_minus_normalized = section.replace(/_/, '-');
+       let section_minus_normalized = section.replaceAll('_', '-');
        if (helpMap[section_minus_normalized]) {
            return helpMap[section_minus_normalized];
        }
-       let section_underscore_normalized = section.replace(/-/, '_');
+       let section_underscore_normalized = section.replaceAll('-', '_');
        return helpMap[section_underscore_normalized];
     },