Skip to content

fix(local-replica): sanitize invalid windows chars in project folder name#330

Open
astarforbae wants to merge 2 commits intooverleaf-workshop:masterfrom
astarforbae:issue-329
Open

fix(local-replica): sanitize invalid windows chars in project folder name#330
astarforbae wants to merge 2 commits intooverleaf-workshop:masterfrom
astarforbae:issue-329

Conversation

@astarforbae
Copy link

Fixes #329

Summary

  • sanitize invalid Windows folder-name characters when creating local replica folder from project
    title
  • apply sanitization only on Windows (win32) to preserve existing behavior on other platforms

Validation

  • manually verified in VS Code Extension Development Host
  • confirmed local replica creation works for project titles containing : on Windows

Copilot AI review requested due to automatic review settings February 13, 2026 14:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes issue #329 where users cannot create local replicas of Overleaf projects with invalid Windows filename characters (like colons) in their titles. The fix adds a sanitization function that replaces invalid characters with underscores, removes trailing dots/spaces, handles empty results, and avoids Windows reserved filenames (like "con", "aux", etc.), but only applies this sanitization on Windows to preserve existing behavior on other platforms.

Changes:

  • Added a private static method sanitizeProjectFolderName() that sanitizes project names for Windows filesystem compatibility
  • Modified validateBaseUri() to use the sanitized folder name instead of the raw project name when creating local replica directories
  • Platform-specific handling ensures sanitization only occurs on Windows (win32 platform)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

style(local-replica): align equality spacing in sanitizer

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to create local replica of overleaf projects whose title contains colons.

1 participant