The formatBookmarkName helper function has been updated to preserve leading spaces from the input format string. The whitespace cleanup logic now extracts and retains original leading spaces, and handles whitespace-only format strings directly.

- fix(mapper): Preserve leading spaces in `formatBookmarkName` output
This commit is contained in:
Drew Bonasera
2026-07-06 20:31:14 -04:00
parent bdb1016698
commit d1c11d630e
@@ -357,7 +357,18 @@ export const formatBookmarkName = (
result = result.replace(/\{description\}/g, () => signature.description || '');
// Cleanup whitespace
return result.trim().replace(/\s+/g, ' ');
if (/^\s*$/.test(formatStr)) {
return formatStr;
}
const leadingSpaces = formatStr.match(/^\s+/)?.[0] || '';
const cleaned = result.trim().replace(/\s+/g, ' ');
if (cleaned === '') {
return leadingSpaces;
}
return `${leadingSpaces}${cleaned}`;
};
export const copyToClipboard = async (text: string) => {