You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-23 22:36:32 +02:00
Server: Resolves #5286: Set better filename and mime type for files downloaded via published notes
This commit is contained in:
@@ -15,6 +15,7 @@ describe('pathUtils', function() {
|
||||
['no space at the end ', 'no space at the end'],
|
||||
['nor dots...', 'nor dots'],
|
||||
[' no space before either', 'no space before either'],
|
||||
['no\nnewline\n\rplease', 'no_newline__please'],
|
||||
['thatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylong', 'thatsreallylongthatsreallylongthatsreallylongthats'],
|
||||
];
|
||||
|
||||
@@ -25,6 +26,11 @@ describe('pathUtils', function() {
|
||||
|
||||
expect(!!friendlySafeFilename('')).toBe(true);
|
||||
expect(!!friendlySafeFilename('...')).toBe(true);
|
||||
|
||||
// Check that it optionally handles filenames with extension
|
||||
expect(friendlySafeFilename(' testing.md', null, true)).toBe('testing.md');
|
||||
expect(friendlySafeFilename('testing.safe??ext##', null, true)).toBe('testing.safeext');
|
||||
expect(friendlySafeFilename('thatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylongthatsreallylong.md', null, true)).toBe('thatsreallylongthatsreallylongthatsreallylongthats.md');
|
||||
}));
|
||||
|
||||
it('should quote and unquote paths', (async () => {
|
||||
|
||||
Reference in New Issue
Block a user