Skip to content

Support for linked images #24

Closed
Closed
@davidruisinger

Description

@davidruisinger

I have something like this in my markdown:

[![Linked image](http://example.com/image.png)](http://example.com/linkedpage.html)

Now I'm trying to have a switch in a custom renderer for link type:

  link: (node, children, parent, styles) => {
    const firstChild = node.children || [{}]
    if (firstChild.type === 'image') {
      return <Touchable>...</Touchable>
    } else {
      return (
        <Text
          key={node.key}
          style={styles.link}
          onPress={() => console.log('OPEN LINK: ', node.attributes.href)}>
          {children}
        </Text>
      )
    }
  },

But unfortunately all links are treated as inline text (see src/lib/util/getIsInlineTextType.js which is why I think the children array is always empty for links.

Any plans on adding support for that as well?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions