Skip to content

Commit

Permalink
Don't strip people's metadata from files (fixes hackclub#933)
Browse files Browse the repository at this point in the history
  • Loading branch information
kognise committed Mar 10, 2023
1 parent 46bcc07 commit 2ab85ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/game-saving/extract-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ export const extractMetadata = (code: string): ExtractedMetadata => {
const name = code.match(nameRegex)?.[1] ?? null
const authorName = code.match(authorRegex)?.[1] ?? null
const cleanedCode = code
.replace(nameRegex, '')
.replace(authorRegex, '')
.replace(/^\/\*\n+(.+)?\n+\*\//s, '/*\n$1\n*/')
.replace(/^\/\*\s*\*\/\s*/s, '')
// .replace(nameRegex, '')
// .replace(authorRegex, '')
// .replace(/^\/\*\n+(.+)?\n+\*\//s, '/*\n$1\n*/')
// .replace(/^\/\*\s*\*\/\s*/s, '')
return { name, authorName, cleanedCode }
}

0 comments on commit 2ab85ea

Please sign in to comment.