Skip to content

Support for LinkBlock similar to ImageBlock? #458

Open
@stern-shawn

Description

@stern-shawn

Hi! I see in the isHikeElement check (source) that paragraph and image nodes are supported and have types exported as well, but links/anchors are not.

In a PoC that I'm building with Code Hike I'm trying to let users declare a custom button, say a call to action that should be styled nicely based on the page template, so I'd want a template something like this:

<PageWrapper>
  Some content

  [!cta Do an action](/link-to-action)
</PageWrapper>

Right now this doesn't work and the wrapper component will just receive children as props. If I change the node to an image, it works, but that'd be a weird syntax to communicate to authors.

eg this is functional and usable, but not syntactically ideal for authors:

<PageWrapper>
  Some content

  ![!cta Do an action](/link-to-action)
</PageWrapper>

I have viable alternatives in terms of passing props directly to the component, etc, but this could be a nice addition if support wasn't omitted for functional reasons 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions