Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit 5786932

Browse files
committed
Make filenames truncate at 200 characters (#768)
Fixes #766
1 parent ebdd6a9 commit 5786932

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sidebar/app/utils/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function getFirstNonEmptyElement(parentElement) {
3131
/**
3232
* Formats the filename for the "Export as HTML..." menu option.
3333
* Whitespace and illegal filename characters are removed, and
34-
* the length is shortened if longer than 250 characters.
34+
* the length is shortened if longer than 200 characters.
3535
* @param {string} filename
3636
* @returns {string}
3737
*/
@@ -41,8 +41,8 @@ function formatFilename(filename) {
4141
formattedFilename = formattedFilename.trim();
4242
// remove illegal filename characters
4343
formattedFilename = formattedFilename.replace(/[~#%{}[\]:\\<>/!@&?"*.+|\n\r\t]/g, '');
44-
if (formattedFilename.length > 250) { // 255 bytes (filesystem max) - 5 for ".html" extension
45-
formattedFilename = formattedFilename.substring(0, 250);
44+
if (formattedFilename.length > 200) { // 200 bytes (close to filesystem max) - 5 for ".html" extension
45+
formattedFilename = formattedFilename.substring(0, 200);
4646
}
4747
return `${formattedFilename}.html`;
4848
}

0 commit comments

Comments
 (0)