Repository navigation
fix: build !path geojson.io link as a base64 data URI - #20
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
!pathmap links still failed on geojson.io ("unterminated string in the json data") even after the slash-encoding fix (#19) — including paths with no/in any name.Diagnosis
Resolving a failing
da.gdlink showed the data arrives intact and parses as valid, complete JSON — so it's geojson.io's rewritten (early-2026) loader mishandling our percent-encoded inline#data=data:application/json,…form, not our data. Confirmed by testing the exact failing payload in several formats:data:application/json;base64,<b64>→ worksA fails while D (tiny) works ⇒ a size/encoding-bloat problem with the inline form (percent-encoding inflates the payload ~3×). Base64 (B) is reliable and ~20% shorter.
Fix
_geojson_io_urlnow base64-encodes the GeoJSON into a;base64,data URI. Dropped the unusedurllib.parseimport; addedbase64. This also subsumes the earlier slash issue — base64 has no characters that need escaping in a fragment.Verification
New format round-trips to valid JSON through base64 and through da.gd; tested with hop names containing
/,#, and emoji.py_compileclean.