Skip to content

Intercept urls from cms #75

@Alexnortung

Description

@Alexnortung

Purpose

  • New feature

Description

I think it should be possible to intercept urls, in case you use a CMS that provides the editorjs blocks. The idea is that a CMS might only give you a relative path to a given media resource, so the url would not be correct when rendering with this library.

I doesn't seem like there is a solution right now other than making a custom renderer.

Possible solution

A prop for a prefix for urls that starts with /
Or a prop for a function that can intercept the urls, example:

const getCmsUrl = (url: string) => {
  if (!url.startsWith('/') return url;
  return `${cmsUrl}${url}`;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions