Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix line breaks for li #166

Merged
merged 4 commits into from
Oct 16, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions __tests__/HTMLView-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,7 @@ describe('<HTMLView/>', () => {

function renderNode(node, index) {
if (node.name == 'thing') {
return (
<Text key={index}>
{node.attribs.b}
</Text>
);
return <Text key={index}>{node.attribs.b}</Text>;
}
}

Expand Down
4 changes: 0 additions & 4 deletions __tests__/__snapshots__/HTMLView-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -826,8 +826,6 @@ exports[`<HTMLView/> should render ol numbers 1`] = `
>
b
</Text>


</Text>
</Text>
</View>
Expand Down Expand Up @@ -1274,8 +1272,6 @@ exports[`<HTMLView/> should render ul bullets 1`] = `
>
b
</Text>


</Text>
</Text>
</View>
Expand Down
4 changes: 1 addition & 3 deletions example/Example.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ function renderNode(node, index) {
if (node.name == 'iframe') {
return (
<View key={index} style={{width: 200, height: 200}}>
<Text>
{node.attribs.src}
</Text>
<Text>{node.attribs.src}</Text>
</View>
);
}
Expand Down
4 changes: 3 additions & 1 deletion htmlToElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ export default function htmlToElement(rawHtml, customOpts = {}, done) {
{opts.bullet}
</TextComponent>);
}
linebreakAfter = opts.lineBreak;
if (opts.addLineBreaks && index < list.length - 1) {
linebreakAfter = opts.lineBreak;
}
}

const {NodeComponent, styles} = opts;
Expand Down