Skip to content

Commit 2a09d3b

Browse files
committed
fixed issue where images would not render.
1 parent b0843f4 commit 2a09d3b

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

example/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
},
2323
"devDependencies": {
2424
"jest-expo": "~18.0.0",
25+
"markdown-it": "^8.4.0",
26+
"react-native-fit-image": "^1.5.4",
2527
"react-native-scripts": "0.0.50",
2628
"react-test-renderer": "16.0.0-alpha.12"
27-
2829
}
2930
}

example/src/copyAllCheckboxPlugin.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
const markdownText = `
2-
# Syntax __Support__
2+
## Images
3+
4+
![Minion](https://octodex.github.com/images/minion.png)
5+
![Stormtroopocat](https://octodex.github.com/images/stormtroopocat.jpg "The Stormtroopocat")
6+
7+
# Syntax __Support__
38
49
__Advertisement :)__
510

example/src/customMarkdownStyle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ const customMarkdownStyle = StyleSheet.create({
1717
},
1818
heading: {},
1919
heading1: {
20-
fontSize: 50,
20+
2121
backgroundColor: "#FFCC00"
2222
},
23-
text: {fontSize: 80,},
23+
text: {fontSize: 20,},
2424
strikethrough: {
2525
textDecorationLine: 'line-through',
2626
color: '#FF0000'

src/lib/parser.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import React from "react";
22
import { View } from "react-native";
33
import tokensToAST from "./util/tokensToAST";
4-
import removeInlineTokens from "./util/removeInlineTokens";
5-
import groupTextTokens from "./util/groupTextTokens";
6-
import getTokenTypeByToken from "./util/getTokenTypeByToken";
74
import { stringToTokens } from "./util/stringToTokens";
85
import { cleanupTokens } from "./util/cleanupTokens";
96

src/lib/renderRules.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ const renderRules = {
188188
},
189189
// li
190190
list_item: (node, children, parent, styles) => {
191-
if (hasParents(parent, "ul")) {
191+
if (hasParents(parent, "bullet_list")) {
192192
return (
193193
<View key={node.key} style={styles.listUnorderedItem}>
194194
<Text style={styles.listUnorderedItemIcon}>{"\u00B7"}</Text>
@@ -197,7 +197,7 @@ const renderRules = {
197197
);
198198
}
199199

200-
if (hasParents(parent, "ol")) {
200+
if (hasParents(parent, "ordered_list")) {
201201
return (
202202
<View key={node.key} style={styles.listOrderedItem}>
203203
<Text style={styles.listOrderedItemIcon}>{node.index + 1}</Text>
@@ -255,7 +255,7 @@ const renderRules = {
255255
<Text key={node.key}>{"\n"}</Text>
256256
),
257257
image: (node, children, parent, styles) => {
258-
return <FitImage key={node.key} source={{ uri: node.attributes.src }} />;
258+
return <FitImage key={node.key} style={{margin: 1}} source={{ uri: node.attributes.src }} />;
259259
}
260260
};
261261

0 commit comments

Comments
 (0)