jsdf / react-native-htmlview

A React Native component which renders HTML content as native views
ISC License
2.7k stars 466 forks source link

Inline Style not working #314

Open gowdruNikhil opened 3 years ago

gowdruNikhil commented 3 years ago

<p> Add <span style="color:green">₹56</span> more to cart for <span style="color:green">FREE</span> Delivery</p>

the color green is not applying on the span tagged elements

rianfloo commented 2 years ago

Not very elegant but I tricked it by recreating a custom node with the data inside.

Hope it will help few other like me :)

 if (node.name == 'span') {
      const data = node.children[0].data;
      const width = Dimensions.get('window').width;
      return (
          <View key={index} style={{ backgroundColor: 'red', borderRadius: 12, padding: 14, width: width - 24 }}>
              <Text style={{color: '#FFFFFF', fontSize: 14, lineHeight: 24}} >
                  {data}
              </Text>
          </View>
      )
} 
KarthikBaleneni commented 1 year ago

Please provide an version update with this Fix.

tuanphamhnl commented 1 year ago

Do we have any updates? Please