Skip to content

Commit 952f8ac

Browse files
committed
fixing issue where hardbreak will crash android app. #56
1 parent afc328d commit 952f8ac

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

example/react-native-markdown-renderer/lib/util/cleanupTokens.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export function cleanupTokens(tokens) {
66
tokens.forEach(token => {
77
token.type = getTokenTypeByToken(token);
88

9-
if (token.type === 'image') {
9+
// set image and hardbreak to block elements
10+
if (token.type === 'image' || token.type === 'hardbreak') {
1011
token.block = true;
1112
}
1213
});

src/lib/util/cleanupTokens.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export function cleanupTokens(tokens) {
66
tokens.forEach(token => {
77
token.type = getTokenTypeByToken(token);
88

9-
if (token.type === 'image') {
9+
// set image and hardbreak to block elements
10+
if (token.type === 'image' || token.type === 'hardbreak') {
1011
token.block = true;
1112
}
1213
});

0 commit comments

Comments
 (0)