Skip to content

Commit

Permalink
fix(md): Play nice with anchors (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
machour authored and Houssein Djirdeh committed Oct 11, 2017
1 parent 04a51c2 commit 1fb5165
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/github-htmlview.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,18 @@ export class GithubHtmlView extends Component {
);
},
a: (node, index, siblings, parent, defaultRenderer) => {
if (typeof node.children[0] === 'undefined') {
// Probably a named anchor, ignore it for now & avoid extra space.
return null;
}

return (
<Text
key={index}
style={styles.strong}
onPress={() => onLinkPress(node)}
>
{node.children[0].data}
{defaultRenderer(node.children, node)}
</Text>
);
},
Expand Down

0 comments on commit 1fb5165

Please sign in to comment.