Utils: fix help section normalization

We need to replace all occurences when normalizing underscores or
dashes.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
This commit is contained in:
Aaron Lauterer 2020-11-10 10:34:13 +01:00 committed by Thomas Lamprecht
parent 5efbff97f8
commit f7b816a399

View 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];
},