fix(studio): share safe media path cleanup

This commit is contained in:
ukimsanov
2026-07-06 14:35:41 -07:00
parent e0090efbf6
commit 04f96da169
3 changed files with 11 additions and 9 deletions
@@ -10,6 +10,14 @@ export type {
PropertyPanelProps,
} from "./propertyPanelTypes";
export function stripQueryAndHash(value: string): string {
const queryIndex = value.indexOf("?");
const hashIndex = value.indexOf("#");
if (queryIndex < 0) return hashIndex < 0 ? value : value.slice(0, hashIndex);
if (hashIndex < 0) return value.slice(0, queryIndex);
return value.slice(0, Math.min(queryIndex, hashIndex));
}
/* ------------------------------------------------------------------ */
/* Font types & constants (shared by font and section modules) */
/* ------------------------------------------------------------------ */