diff --git a/src/util/config.spec.ts b/src/util/config.spec.ts
index fcb93944a..882eb8c99 100644
--- a/src/util/config.spec.ts
+++ b/src/util/config.spec.ts
@@ -81,7 +81,7 @@ describe("toConfigFields and replaceDocLinks", () => {
);
expect(result).toBe(
- 'Specify a Pongo2 template string that represents the snapshot name.
This template is used for scheduled snapshots and for unnamed snapshots.
See instance options snapshots names for more information.',
+ 'Specify a Pongo2 template string that represents the snapshot name.
This template is used for scheduled snapshots and for unnamed snapshots.
See Automatic snapshot names for more information.',
);
});
diff --git a/src/util/config.tsx b/src/util/config.tsx
index 8b61f7c96..e54d0db92 100644
--- a/src/util/config.tsx
+++ b/src/util/config.tsx
@@ -58,7 +58,13 @@ export const configDescriptionToHtml = (
return;
}
const docPath = line.split(": ")[1];
- const linkText = token.replaceAll("-", " ");
+ const linkTextCandidate = line
+ .split(":")[0]
+ .replace(/\s\s+/g, " ")
+ .trim();
+ const linkText = linkTextCandidate.includes(" ") // some lines in the object.inv.txt file have a description before the : and a link after
+ ? linkTextCandidate.substring(linkTextCandidate.indexOf(" ") + 1)
+ : token.replaceAll("-", " ");
const link = `${linkText}`;
result = result.replaceAll(tag, link);