From 6e27b55061ffbd68f5ab5efba34b945c6372c800 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Tue, 26 May 2015 11:18:09 -0400 Subject: [PATCH] Don't clean description/note/fixme values (closes #2659) --- js/id/ui/entity_editor.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/js/id/ui/entity_editor.js b/js/id/ui/entity_editor.js index 381a205d4..e7a784a32 100644 --- a/js/id/ui/entity_editor.js +++ b/js/id/ui/entity_editor.js @@ -133,16 +133,20 @@ iD.ui.EntityEditor = function(context) { } function clean(o) { - function isOpeningHours(k) { - return _.any(['opening_hours', 'service_times', 'collection_times', - 'operating_times', 'smoking_hours', 'happy_hours'], function(s) { - return k.indexOf(s) !== -1; - }); - } + function cleanVal(k, v) { + function keepSpaces(k) { + var whitelist = ['opening_hours', 'service_times', 'collection_times', + 'operating_times', 'smoking_hours', 'happy_hours']; + return _.any(whitelist, function(s) { return k.indexOf(s) !== -1; }); + } + + var blacklist = ['description', 'note', 'fixme']; + if (_.any(blacklist, function(s) { return k.indexOf(s) !== -1; })) return v; + var cleaned = v.split(';') .map(function(s) { return s.trim(); }) - .join(isOpeningHours(k) ? '; ' : ';'); + .join(keepSpaces(k) ? '; ' : ';'); // The code below is not intended to validate websites and emails. // It is only intended to prevent obvious copy-paste errors. (#2323)