Comments (14)
Hi! Can you show me your code plz? I have an idea about what could be the problem.
from react-native-simple-markdown.
var str = "![](https://d1rnv32spgedkm.cloudfront.net/image%2Fde3%2Fa6b%2F650%2Fe26cf40afb5ded4.jpg)
return (<Markdown>
{ str }
</Markdown>)
And I think that's basically it.
from react-native-simple-markdown.
You're displaying content
but it doesn't correspond to the variable str
which contains the URL. Maybe that's where your error come from.
from react-native-simple-markdown.
It's a typo. I just edited it. Sorry..
from react-native-simple-markdown.
OK I got it: the issue is on my side. I have to set the resizeMode
prop of the Image
element, and I think it will between cover
or contain
.
The problem is the margin though. With cover
you have no margin, but the image is cropped:
With the contain
prop you have this huge margin depending on the size of the picture:
What do you think about it?
from react-native-simple-markdown.
I think it's all fine depends on the use case. However do you think maybe pass something like image style into <Markdown >
is a good idea?
from react-native-simple-markdown.
Well it wouldn't work though because resizeMode
is handle by <Image />
props, not by its style. And there's no style property for this use case in RN I think.
from react-native-simple-markdown.
I was kind of thinking maybe something like {resizeMode==='contain' && <Image resizeMode={'contain'} /> || <Image resizeMode={'cover'} />}
.
from react-native-simple-markdown.
Oh ok! Sorry I didn't get you. For the time being, it seems to be a good idea: I just implemented it, you can update with a npm i react-native-simple-markdown
. Tell me if it's ok!
from react-native-simple-markdown.
For those images whose height is greater than width the output seems to be weird..
from react-native-simple-markdown.
Your image seems to be the same here:
and here:
Where's the differences plz?
from react-native-simple-markdown.
I think normally markdown images wouldn't have anything to do with alignments but I guess I can do something from my side anyways. :) thanks!
from react-native-simple-markdown.
Your welcome!
from react-native-simple-markdown.
Closing issue #8
from react-native-simple-markdown.
Related Issues (20)
- Simple Markdown fails with `Unexpected view type nested under text node` HOT 7
- Single line break not working HOT 4
- is a way exists to use an anchors system ?
- Import markdown from a file ?
- Dependency (simple-markdown fork) not available in tagged versions HOT 2
- Link not clickable on IOS
- callback when the markdown is rendered
- Rendering problem after ". "
- Emojis are placed too low down
- Error: Nesting of View within Text is not supported HOT 2
- How can I set the default text size HOT 2
- Android error: Cannot add a yoga node to a parent without a measure function!
- How to get proper markdown with the list?
- Can't seem to center align text HOT 1
- New release that doesn't require git HOT 2
- Error in jest Cannot use import statement outside a module
- Setting text fontSize does nothing
- rules.js matching `heading X` instead of `headingX`
- Insert blank line? HOT 2
- allowFontScaling HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-simple-markdown.