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

ChartView: Skip comments and render hash links #1476

Merged
merged 2 commits into from
Jan 23, 2020
Merged

Conversation

andresmgot
Copy link
Contributor

@andresmgot andresmgot commented Jan 22, 2020

Description of the change

Ignore comments and fix hash links in the ChartView.

Apparently React-Router doesn't play well with hash links so I had to add a new dependency:
remix-run/react-router#394 (comment)

Tested with the ChartMuseum chart. This is before the change:

Screencast2020-01-22172036

And this is with this fix, the comment is removed and the link works:

Screencast2020-01-22171757

Applicable issues

if (props.href.startsWith("#")) {
return <Link to={props.href}>{props.children}</Link>;
}
return <a href={props.href}>{props.children}</a>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we use the normal Link here from react-router-dom that we use elsewhere? Ah, because this LinkRenderer is only being used for rendering the README, so it will never contain internal application links - got it. Not sure if it's worth a comment, up to you.

@andresmgot andresmgot merged commit b97cbd8 into master Jan 23, 2020
@andresmgot andresmgot deleted the readmeLinks branch January 29, 2020 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Markup is not rendered correctly issues with comments and links
2 participants