Skip to content

Modifying an element replaces new lines with spacesย #30

@confusedbuffalo

Description

@confusedbuffalo

See the minimal example below, specifically the inscription tag, which was untouched by the edit.

On the dev server:

await OSM.getFeatureAtVersion('node', 4360391004, 1);
{
    "type": "node",
    "id": 4360391004,
    "lat": 51.5067539,
    "lon": -0.1126324,
    "timestamp": "2025-11-19T04:25:50Z",
    "version": 1,
    "changeset": 503996,
    "user": "confusedbuffalo-dev",
    "uid": 22751,
    "tags": {
        "historic": "memorial",
        "inscription": "Line one\nLine two\nLine three",
        "memorial": "blue_plaque",
        "name": "Multiple lines"
    }
}
const features = await OSM.getFeature('node', 4360391004);
const feature = features[0];
feature.tags['name'] = 'New name';
await OSM.uploadChangeset({'comment': 'osm-api-js new line test'}, { create: [], modify: [feature], delete: [] });
await OSM.getFeatureAtVersion('node', 4360391004, 2);
{
    "type": "node",
    "id": 4360391004,
    "lat": 51.5067539,
    "lon": -0.1126324,
    "timestamp": "2025-11-19T04:31:37Z",
    "version": 2,
    "changeset": 503997,
    "user": "confusedbuffalo-dev",
    "uid": 22751,
    "tags": {
        "historic": "memorial",
        "inscription": "Line one Line two Line three",
        "memorial": "blue_plaque",
        "name": "New name"
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions