Benjamin-Dobell / react-native-markdown-view

MarkdownView for React Native
MIT License
190 stars 77 forks source link

Can't override render method for existing keys #47

Closed joelworsham closed 4 years ago

joelworsham commented 4 years ago

I want to overwrite the image render method, so it can also support videos and audio. This does not work, the method is never called:

<MarkdownView
  rules={{
    image: {
      render: (node, output, state, styles) => {
        console.log('oh...')
        return <Text>Test</Text>
      }
    }
  }}
>
  {article.content}
</MarkdownView>

Just trying to start by getting Test to appear on the page, but it does not, and that console is never logged.

joelworsham commented 4 years ago

I just realized that it was something in the matcher. I tried this for list and it worked 🤔