Giter Club home page Giter Club logo

Comments (6)

CharlesMangwa avatar CharlesMangwa commented on July 30, 2024

Hi @nathan-k! Do you have the same problem with the NPM package?

from react-native-simple-markdown.

terrysahaidak avatar terrysahaidak commented on July 30, 2024

@CharlesMangwa I've just tested it and where is no such problem in npm package.

from react-native-simple-markdown.

terrysahaidak avatar terrysahaidak commented on July 30, 2024

It seems like the problem is here. If we'll replace Text by View it works well, I can submit a PR to fix that.

from react-native-simple-markdown.

CharlesMangwa avatar CharlesMangwa commented on July 30, 2024

I think I've already face this issue because it triggers an error on Android if I remember well. But if you can test the different cases of blockquotes (plain text, extract from an array/object, etc) and submit a PR, that would be 💯

from react-native-simple-markdown.

afilp avatar afilp commented on July 30, 2024

Similar case unfortunately with lists:

#90

from react-native-simple-markdown.

diolar avatar diolar commented on July 30, 2024

The issue with the list is that when the markdown file is parsed, the content of the list items is being wrapped inside p tags and that forces the list item to replace it with a View.
I order to avoid that i replaced the paragraph Views with Text.
A bit of styling for the list and everything looks as it should.

const markdownStyles = {
   listItem: {
      position: 'relative',
      paddingLeft: 24,
  },
   listItemBullet: {
      position: 'absolute',
      left: 8,
      top: 0,
  },
}

  <Markdown
    styles={markdownStyles}
    rules={{
      paragraph: {
        react: (node, output, state) => (
          <Text key={state.key}>
            {output(node.content, state)}
          </Text>
        ),
      },
    }}
  >
    {content}
  </Markdown>

Where <Text /> is a styled Text component in my case but it could as easily be a native Text with a style object.

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.