From 20e294884a2059a6878566987f3374a3b7e3e239 Mon Sep 17 00:00:00 2001 From: John Keeping Date: Wed, 8 Jul 2015 16:24:06 +0100 Subject: [PATCH] Add trailing newline to exported rules file According to POSIX a text file is "a file that contains characters organized into zero or more lines" [1] and a line is "a sequence of zero or more non- characters plus a terminating character" [2]. Since we are claiming to produce a text file, it should have a trailing newline. [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_397 [2] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 --- src/js/user-rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/user-rules.js b/src/js/user-rules.js index e1476c6..426767a 100644 --- a/src/js/user-rules.js +++ b/src/js/user-rules.js @@ -198,7 +198,7 @@ var startImportFilePicker = function() { function exportUserRulesToFile() { vAPI.download({ - 'url': 'data:text/plain,' + encodeURIComponent(rulesFromHTML('#diff .left li')), + 'url': 'data:text/plain,' + encodeURIComponent(rulesFromHTML('#diff .left li') + '\n'), 'filename': uDom('[data-i18n="userRulesDefaultFileName"]').text() }); }