Cloudflare's single-page-application fallback percent-encodes the
path on a fresh load or reload, so `rad:z4V1...` arrives as
`rad%3Az4V1...` and leaks into links and the seed command.
Only identifiers are decoded: revision and path segments stay
encoded, because branch and tag lookups are keyed on the encoded
name.
The seed command needs a second fix: the repo path segment is an
alias when one was used, and `rad seed <alias>` is not valid, the
`rad seed` command only supports RIDs and not aliases.
Co-Authored-By: Guillaume <guillaume.alabre@gmail.com>
Image URLs pointing at a GitHub "blob" page, such as
https://github.com/<owner>/<repo>/blob/<ref>/<path>, serve an HTML
page rather than the raw image bytes, so they render as broken images
in markdown.
Add a canonicalizeGithubImageUrl helper that appends ?raw=true to such
URLs, which makes GitHub redirect to the raw content. URLs already
pointing at the raw content, via ?raw=true or raw.githubusercontent.com,
are left unchanged, as are non-GitHub and non-URL sources.
Wire the helper into the markdown image loop so external image URLs are
canonicalized while relative paths keep resolving against the repo's raw
endpoint.
Allow radicle-explorer to connect to a locally running radicle-httpd via
https://app.radicle.xyz/nodes/localhost. This was previously disabled to
encourage use of Radicle Desktop, but is now useful for testing the new
always-on node in local development environments.
Remove support for /nodes/radicle.local, an undocumented and unused convention.
Fix remote node loading when Cloudflare URL-encodes port separator (: → %3A).
We where using `sinon` in the `playwright` tests to simulate a different
time, which since `playwright@1.45.0` can be done with the Clock API
calling `page.clock.setFixedTime`.
And to test the mutex executor we can use the vitest utils spy function
`vi.fn()` instead of `sinon.spy()`
This new component doesn't rely on marked.js but escapes any special
characters and then replaces any backtick with a <code> HTML tag to
render any inline codeblocks in all titles.
Since the legacy config is being deprecated at the end of 2024, we
should start moving to the eslint flat config.
I avoided the tseslint config helper function so we avoid wrapping
magic.
This seems to have triggered more checking since any checks in svelte
files have appeared and the $$Generic type that is being deprecated had
to be rewritten.
Also fixes some any types that weren't caught previously
We still allow already published URLs with `/seeds/` in them to be
resolved.
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
We switch the test for `pathToRoute` from a paramterized test to regular
tests. I had a lot of trouble finding the right properties to change
when a test in this group failed. The line number was not helpful at all
and the test description was burried inside an object.
We also rename `pathToRoute` to `urlToRoute` because the function takes
a `URL` as an argument.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
We switch to a project route type that is just a union. This has the
following advantages
* It’s much easier to construct project routes. Fewer properties are
needed and there are no nested objects.
* We eliminate the implicitly shared properties `path`, `peer`,
`revision` and `route` which only belonged to the tree route.
* The structure of the project route is more regular and thus easier to
understand.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
We replace the tests for `routeToPath` with a test that calls
`pathToRoute(routeToPath(route))`. These test do not only cover the
assertions of the previous tests but also check an important invariant
for route parsing and building.
I’m not using `test.each` here because this makes the tests less
readable.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
To make the code easier to reason about we handle all app URL encoding
and decoding and the related seed BaseUrl extraction in a single place.
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>