mirror of
https://github.com/wanderer-industries/wanderer
synced 2026-08-25 07:16:31 +00:00
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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user