mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-23 16:49:40 +02:00
Don't clean description/note/fixme values (closes #2659)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user