feat(gpx): metadata name/desc fallback + <cmt> merge
Task group 4 of gpx-parser-robustness. Many apps put the only human-readable title on the <trk>/<rte>, not in <metadata>. - name/description now fall back to the first <trk>/<rte>'s <name>/<desc> when <metadata> lacks them (<metadata> still wins when present). - that track/route's <cmt> is appended to the description (blank-line separated) when present and not already identical (OM BuildDescription dedup); used as the description outright when there's no <desc>. `directChildText` reads direct-child text without relying on `:scope` (portable across the jsdom + linkedom paths). No GpxData shape change; well-formed files with metadata are unaffected. Verified: gpx typecheck+lint clean, 87/87; full `pnpm test` 11/11; journal + planner typecheck unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
7c0fa60ae2
commit
b7b8906ce9
3 changed files with 83 additions and 4 deletions
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
## 4. Metadata fallback
|
||||
|
||||
- [ ] 4.1 Fall back to first `<trk>`/`<rte>` `<name>`/`<desc>` when `<metadata>` lacks them; merge distinct `<cmt>` into description with blank-line separator, dedup identical
|
||||
- [ ] 4.2 Unit tests: track-name fallback, metadata precedence, cmt merge, identical cmt deduped
|
||||
- [x] 4.1 Fall back to first `<trk>`/`<rte>` `<name>`/`<desc>` when `<metadata>` lacks them; merge distinct `<cmt>` into description with blank-line separator, dedup identical
|
||||
- [x] 4.2 Unit tests: track-name fallback, metadata precedence, cmt merge, identical cmt deduped
|
||||
|
||||
## 5. Fixture corpus
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue