mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 13:06:54 +00:00
80bb06c84f
A list could leave the instance as a TREK file, which only another TREK reads. Export now asks for a format, and GPX is the second one: the places as waypoints, for OsmAnd, Organic Maps, a Garmin or gpx.studio. Import takes a GPX in the same dialog as a list file. Asked for in discussion #2301. The GPX is written from the very list file the JSON export returns, so what may leave the instance is still decided in one place. Name, description and address, notes, website and category go into GPX's own elements, where every app shows them. Labels, status, phone and the rest travel in a TREK extension namespace, so a GPX made by TREK comes back as the same list. A place without coordinates cannot be a waypoint; it is left out and the export says how many were. A GPX is read on the server, sent as text, with the XML library the trip importer already uses. A document with a DOCTYPE is refused before parsing, which closes both external entities and entity expansion. Size is capped like the list file, and the element count is capped before a tree is built. The reader only turns the GPX into a list file: the browser previews it and imports it through the existing route, so one contract, one transaction and one skipped counter cover both formats. Waypoints and named route points become places; tracks and unnamed route points are counted in the preview and not imported. The two list-file routes get a body ceiling of twice the file limit. The global 100 kB cap refused most real favourites files, and it already refused list files well under the megabyte the contract allows.
31 lines
666 B
Plaintext
31 lines
666 B
Plaintext
# Normalize line endings to LF on commit
|
|
* text=auto eol=lf
|
|
# Explicitly enforce LF for source files
|
|
*.ts text eol=lf
|
|
*.tsx text eol=lf
|
|
*.js text eol=lf
|
|
*.jsx text eol=lf
|
|
*.json text eol=lf
|
|
*.css text eol=lf
|
|
*.html text eol=lf
|
|
*.md text eol=lf
|
|
*.yml text eol=lf
|
|
*.yaml text eol=lf
|
|
*.py text eol=lf
|
|
*.sh text eol=lf
|
|
# Binary files — no line ending conversion
|
|
*.png binary
|
|
*.webp binary
|
|
*.jpg binary
|
|
*.jpeg binary
|
|
*.gif binary
|
|
*.ico binary
|
|
*.woff binary
|
|
*.woff2 binary
|
|
*.ttf binary
|
|
*.eot binary
|
|
*.pdf binary
|
|
*.zip binary
|
|
# A GPX fixture whose byte-order mark and CRLF line endings are what it tests
|
|
server/tests/fixtures/gpx/bom-crlf.gpx -text
|