Leading/trailing white-space trimming in URLs for Addon Manager

In a comment troubleshooting Project entries for the Addon Manager in @ztlxltl 's FTV GitHub issues, the error messages that were pasted indicate a space (or other non-printable character) at the end of their Isotammi Project URL. The user probably picked up an extra character using copy’n’paste from the wiki docs.

Does the Addon Manager module trim the URLs entered into the interface?

In a related question…
Does the project editing validate for percent-encoding of Unicode in URLs? (urlencode ?)

I think there is no cleanup:

By the way, the cause of the issue you mentioned also seems to be a whitespace character. There seems to be an extra space at the beginning of the url pointing to FTV’s packages, not just at the end of the url pointing to the Isotammi project.

Yes, and unlike the trailing space failure (that pipes actionable error messages to the console), leading spaces cause a silent failure with no message

There are other data-entry field where Gramps was enhanced to automatically trim leading and trailing whitespace. (Like the Event description fields.) The URL field just needs the same enhancement

See

  • 0004566: Please remove trailing spaces on items on input.
  • 0010845: Non-printable control characters cause invisible data flaws

the wiki would probably benefit from explaining the regular GitHub and the raw version:

Perplexity draft … wikified for public editing:

When browsing the Gramps project’s files on GitHub at https://github.com/gramps-project, you’re seeing a nicely formatted web page with revision control of the contents. Think of it like browsing a table of contents and summaries of the Gramps project’s different parts. You can click on folders and see the files inside, read descriptions, identify recent changes and generally explore the structure of the project.

However, for Gramps (the software) to actually use those files, it needs the raw, unformatted content of the files themselves. It doesn’t need the web page with the table of contents; it needs the plain text or data inside the file.

That’s where raw.githubusercontent.com comes in. It’s a special way to access the direct content of the files stored on GitHub, stripping away all the extra webpage formatting.

For example, the Gramps Addon Manager uses raw.githubusercontent.com to download the list of available addons. Gramps needs that list as a plain JSON file, not as a web page. That’s why the Addon Manager uses the “raw” URL.

So, while the standard GitHub page is great for browsing and exploring, the raw.githubusercontent.com address is essential for Gramps to access and use the actual data and code files it needs to function.

Citations:
[1] Gramps Project · GitHub

See PR #1981 PR #1991 pushed to 6.0 on 19 Feb 2025.
It may be too late for gramps 6.0 though.

2 Likes