Modify

Opened 4 years ago

Closed 4 years ago

#12499 closed enhancement (fixed)

Detect and fix names with multiple spaces

Reported by: naoliv Owned by: team
Priority: normal Milestone: 16.02
Component: Core validator Version:
Keywords: space Cc:

Description (last modified by naoliv)

Sometimes I see objects with multiple spaces at the middle of their names.
For example, something like name=Foo␣␣Bar (two spaces between the words)

Could JOSM detect and remove them, please?

Attachments (0)

Change History (8)

comment:1 Changed 4 years ago by mdk

Sorry - missunderstanding. You want to replace repeated spaces in a word. This sound useful.

Will this not automatically done by XMLparser?

Last edited 4 years ago by mdk (previous) (diff)

comment:2 Changed 4 years ago by naoliv

Exactly, repeated and sequential whitespaces (ie, name=A␣␣B␣␣␣C)
And I don't know about XMLparser.

comment:3 Changed 4 years ago by mdk

And I don't know about XMLparser.

The default behavior of a XML parser is replacing all whitespace sequences (space, tab, cr, ...) by a single space. If you want to preserve multiple whitespaces, you need a CDATA block or some parsers allow a special mode to prevent this behavior.

On upload (and parsing on the server) there is a good chance that this is automatically "correctd".

Are you able to upload a name with multiple sequential whitespaces?

comment:4 Changed 4 years ago by naoliv

I can't create and upload it, but I see data in OSM with multiple spaces.
If I download one area with objects like this I would like to have them detected and fixed.

Sometimes I am able to indirectly locate them because JOSM detects similar names. For example, name=Street␣A␣B␣C and name=Street␣A␣␣B␣C.

So what I would like to have is similar to what the validator already does when a value starts or ends with a whitespace: it gives a warning and offers to fix it.

Last edited 4 years ago by naoliv (previous) (diff)

comment:5 Changed 4 years ago by naoliv

Description: modified (diff)

comment:6 Changed 4 years ago by Don-vip

Keywords: space added
Milestone: 16.02

comment:7 Changed 4 years ago by Don-vip

We already have part of the solution since r6699 :)

comment:8 Changed 4 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 9744/josm:

fix #12499 - detect and fix multiple spaces in tag values

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.