Giter Club home page Giter Club logo

Comments (14)

CharlesMangwa avatar CharlesMangwa commented on June 28, 2024

Hi! Can you show me your code plz? I have an idea about what could be the problem.

from react-native-simple-markdown.

ssmlee04 avatar ssmlee04 commented on June 28, 2024
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.

CharlesMangwa avatar CharlesMangwa commented on June 28, 2024

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.

ssmlee04 avatar ssmlee04 commented on June 28, 2024

It's a typo. I just edited it. Sorry..

from react-native-simple-markdown.

CharlesMangwa avatar CharlesMangwa commented on June 28, 2024

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:
capture d ecran 2016-10-10 a 15 03 58
With the contain prop you have this huge margin depending on the size of the picture:
capture d ecran 2016-10-10 a 15 00 59
What do you think about it?

from react-native-simple-markdown.

ssmlee04 avatar ssmlee04 commented on June 28, 2024

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.

CharlesMangwa avatar CharlesMangwa commented on June 28, 2024

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.

ssmlee04 avatar ssmlee04 commented on June 28, 2024

I was kind of thinking maybe something like {resizeMode==='contain' && <Image resizeMode={'contain'} /> || <Image resizeMode={'cover'} />}.

from react-native-simple-markdown.

CharlesMangwa avatar CharlesMangwa commented on June 28, 2024

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.

ssmlee04 avatar ssmlee04 commented on June 28, 2024

For those images whose height is greater than width the output seems to be weird..

from react-native-simple-markdown.

CharlesMangwa avatar CharlesMangwa commented on June 28, 2024

Your image seems to be the same here:

and here:

Where's the differences plz?

from react-native-simple-markdown.

ssmlee04 avatar ssmlee04 commented on June 28, 2024

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.

CharlesMangwa avatar CharlesMangwa commented on June 28, 2024

Your welcome!

from react-native-simple-markdown.

CharlesMangwa avatar CharlesMangwa commented on June 28, 2024

Closing issue #8

from react-native-simple-markdown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.