1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-12 21:30:39 +00:00

Internal link repair (#2828)

This commit is contained in:
杨顺强
2019-01-15 15:17:40 +08:00
committed by Daniel Pan
parent 9340d4af38
commit 3c1bc00d82
3 changed files with 29 additions and 17 deletions

View File

@@ -38,7 +38,17 @@ class MarkdownContentViewer extends React.Component {
onLinkClick = (event) => {
event.preventDefault();
this.props.onLinkClick(event);
let link = '';
if (event.target.tagName !== 'A') {
let target = event.target.parentNode;
while (target.tagName !== 'A') {
target = target.parentNode;
}
link = target.href;
} else {
link = event.target.href;
}
this.props.onLinkClick(link);
}
render() {