Skip to content

Fix richtext img url converting when branch name has a slash#329

Closed
nyany wants to merge 1 commit into
hunvreus:developmentfrom
nyany:issue/img-url-richtext-fix
Closed

Fix richtext img url converting when branch name has a slash#329
nyany wants to merge 1 commit into
hunvreus:developmentfrom
nyany:issue/img-url-richtext-fix

Conversation

@nyany

@nyany nyany commented Nov 9, 2025

Copy link
Copy Markdown

The issue:

the "raw.githubusercontent" url is not replaced with the config's "output" property. Happens only with slash-containing branches like feature/onetwothree

Try to save this:

image

The result:

instead of url in format of $output/$relativeUrl it's https://raw.github...../$relativeUrl

image

Reproduction steps:

  1. use a branch containing a slash (e.g. feature/foobar). Branches like develop or feature_one-123 are fine.
  2. edit rich-text body field of either a collection or a single md. It must be a body field. It doesn't affect the rich-text when used in a block field.
  3. add an image to the body.
  4. save
  5. the non-converted URL is committed.

Fix:

githubImage.ts already has encodePath function which seems to handle this problem.

commit: 3b735b0 seems to fix some bug (but doesn't say what that is). Is there a reason why it's specifically encodeURIComponent and not the encodePath function that was already there?

Shouldn't encodePath be used everywhere in githubImage.ts instead of encodeURIComponent?

@hunvreus

Copy link
Copy Markdown
Owner

There's a brand new editor in 2.0.0, with a different model for all the conversions.

@hunvreus hunvreus closed this Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants