MathHubInfo / mhd

The implementation of MathDataHub powered by Django + React.
https://data.mathhub.info
GNU General Public License v3.0
1 stars 1 forks source link

Newlines break imports #75

Closed jO-Osko closed 2 years ago

jO-Osko commented 2 years ago

Nonempty string values with newline character \n break importing.

The problem arises because the string is directly copied to csv file and the newline character breaks the format.

Metadata file:

{
    "displayName": "Newline example",
    "slug": "newline",
    "description": "",
    "url": "nope",
    "metadata": {
        "uri": ""
    },
    "properties": [
        {
            "slug": "text",
            "displayName": "text",
            "codec": "StandardString",
            "metadata": {
                "uri": "nope"
            }
        }
    ]
}

Data file

[
  [
    "Some text\nafter newline"
  ]
]
tkw1536 commented 2 years ago

I believe this was fixed in https://github.com/MathHubInfo/mhd/commit/444533d8dca7c6f7e007c4e101d4a285c9f68eac