Skip to content

Instantly share code, notes, and snippets.

@Wolfr
Created February 23, 2012 12:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wolfr/1892600 to your computer and use it in GitHub Desktop.
Save Wolfr/1892600 to your computer and use it in GitHub Desktop.
// Old:
var fileNameBody = exportInfo.fileNamePrefix;
fileNameBody += "_" + zeroSuppress(compsIndex, 4);
fileNameBody += "_" + compRef.name;
if (null != compRef.comment) fileNameBody += "_" + compRef.comment;
fileNameBody = fileNameBody.replace(/[:\/\\*\?\"\<\>\|\\\r\\\n]/g, "_"); // '/\:*?"<>|\r\n' -> '_'
if (fileNameBody.length > 120) fileNameBody = fileNameBody.substring(0,120);
// New:
var fileNameBody = exportInfo.fileNamePrefix;
fileNameBody += "_" + compRef.name;
if (null != compRef.comment) fileNameBody += "_" + compRef.comment;
fileNameBody = fileNameBody.replace(/[:\/\\*\?\"\<\>\|\\\r\\\n]/g, "_"); // '/\:*?"<>|\r\n' -> '_'
if (fileNameBody.length > 120) fileNameBody = fileNameBody.substring(0,120);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment