We had a regression because of introducing marked-linkify-it, which took
links for CONTRIBUTING.md or HACKING.md as domains of a new page instead
than files to be navigating to.
This commit sets the `fuzzyLink` option for marked-linkify-it to false,
which disables this behavior
Also tests that the browser tree expands itself when navigating to a
file inside a directory
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
We were always calling `replace` and not passing the desired action in
the `navigateInternalOnAnchor`, this was leading to the URL not updating
when e.g. clicking on file URLs in Markdown renders.
By passing the action to the `navigate` fn instead we can also take the
`push` action into account.
Test have been written to guarantee this works
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
Based on a new addition to marked, this commits replaces the imported
marked namespaces with a Marked class, that doesn't change when
`marked.use` introduces new options or extensions.
Also changes the naming slighty to use `markdown` as module, so it
sounds more generic.
Reference: https://github.com/markedjs/marked/pull/2831
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
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>
This improves UX making it easier to find the tab that I'm looking for
when I have multiple tabs open.
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
We don’t replace the path when we navigate internally. This means we
keep the hash part of the URL even if it is not part of the route and we
can remove the workaround for that.
This also means that we keep the original URL if the parsed route would
result in a different URL. This change is visible through a slight
adjustments in the tests.
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
We remove a couple of calls to `console.error()` in the code for the
local node connection. It’s not necessary to log errors that are
expected, for example, if the node is down.
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>
We only supported fetching the default httpd port (8080).
This commit removes navigation to `radicle.local` which represents
`0.0.0.0:8080`, and prepares the app for defining custom port.
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
By having different casings between heading and link ids we avoid
getting case mismatches on navigation.
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
Disables some of the deprecated options to avoid the console warnings.
Removes obfuscation of plain-text emails.
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
- Hide issue title edit button when not logged in
- Show Blob placeholder when empty file
- Allow selecting blob code without the lines
- Add Clipboard component to object id in CobHeader
- Add blockies to Patch and Issueteasers
- Reduce formatted object ids to 7 instead of 11 chars
- Remove line breaking on soft wraps from Markdown
- Reduce font size of code blocks in Markdown
- Improve margins in IssueTeaser
- Reduce font size in FileDiffs
- Improve teasers, assignees and tags highlighting
- Reduce font size of code
- Change commit teaser subtitle
- Show Clipboard in commit sha1
- Add blockies to PeerSelector
- Adjust commit view CSS
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
Adds a listitem renderer overwrite to marked which
wraps everything that is inside a <li> which isn't only single <p> tag
into a <div class="list-content"> which we give a margin: 1rem 0;
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>
Also moves the HASH_ROUTING env variable from being modified inside the
hashRouter.spec.ts into the webserver config in the
playwright.config.ipfs.ts
Signed-off-by: Sebastian Martinez <me@sebastinez.dev>