Revert "Fix the chat context menu removing UTF8 characters causing pure UTF8 character filenames not to display in the menu (#1145)"

This reverts commit 1f2acc519b.
This commit is contained in:
Saoud Rizwan committed 2025-01-09 12:46:23 -08:00
1 parent 1f2acc519b
commit e0b90b2ea5
3 files changed
+6 -6

No files matched your search

@@ -20,7 +20,7 @@ We need to remove leading non-alphanumeric characters from the path in order for
[^a-zA-Z0-9]+: Matches one or more characters that are not alphanumeric.
The replace method removes these matched characters, effectively trimming the string up to the first alphanumeric character.
*/
export const cleanPathPrefix = (path: string): string => path.replace(/^[^\u4e00-\u9fa5a-zA-Z0-9]+/, "")
export const removeLeadingNonAlphanumeric = (path: string): string => path.replace(/^[^a-zA-Z0-9]+/, "")
const CodeAccordian = ({
code,
@@ -90,7 +90,7 @@ const CodeAccordian = ({
direction: "rtl",
textAlign: "left",
}}>
{cleanPathPrefix(path ?? "") + "\u200E"}
{removeLeadingNonAlphanumeric(path ?? "") + "\u200E"}
</span>
</>
)}