Benjamin-Dobell / react-native-markdown-view

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

link text styling #48

Open connectdotz opened 4 years ago

connectdotz commented 4 years ago

hi, I was able to use the styles={{text: {color:xxx}} to change all text colors, which is very cool, however there is a problem for link, the color of link got override by the text styles above. Looking at the code textContentRenderer, it seems that you did try to provide some override with the "styleName2", however for link, a nested renderer, it renders the actual link text with the default textContentRenderer and thus lost the link's style...

To make a long story short, I see couple of issues here and wanted to check with you before submitting PR to address them:

  1. the "text" style should be added to styles.js so people know they can use it to pass text style.
  2. allow nested renderers such as the link to pass its style info to the child renderer (maybe through state?). So the link renderer can set styleName2='link', or something like that, in the state, and the text renderer can then use it to provider correct override

is this something you will consider accepting?