Comments (6)
Hi @nathan-k! Do you have the same problem with the NPM package?
from react-native-simple-markdown.
@CharlesMangwa I've just tested it and where is no such problem in npm package.
from react-native-simple-markdown.
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.
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.
Similar case unfortunately with lists:
from react-native-simple-markdown.
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)
- 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.