Skip to content

Commit

Permalink
feat(image): add resizeMode to Markdown styles prop
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesMangwa committed Oct 10, 2016
1 parent 5b2833e commit c84ee99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Example:
- `hr` (`<View>`)
- `heading` (`<Text>`) - Also `heading1` through `heading6`
- `inlineCode` (`<Text>`)
- `image` (`<Image>`) - Supports `.jpg`, `.png`, `.gif`, etc
- `image` (`<Image>`) - You can use `resizeMode` in `<Markdown />` styles prop to set a resizeMode
- `link` (`Text`)
- `list` (`<View>`) - Also `listItem` (`<View>`), `listItemBullet` (`<Text>`), `listItemNumber` (`<Text>`) and `listItemText` (`<Text>`)
- `mailTo` (`Text`)
Expand Down
4 changes: 2 additions & 2 deletions rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ export default (styles) => ({
react: (node, output, state) => {
return createElement(Image, {
key: state.key,
resizeMode: 'contain',
resizeMode: styles.resizeMode ? styles.resizeMode : 'contain',
source: { uri: node.target },
style: node.target.match(/youtube/) ? styles.video : styles.image
style: node.target.match(/youtu/) ? styles.video : styles.image
})
}
},
Expand Down

0 comments on commit c84ee99

Please sign in to comment.