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 relative url #2144

Merged
merged 3 commits into from
Jan 17, 2019
Merged

fix relative url #2144

merged 3 commits into from
Jan 17, 2019

Conversation

economicstudio
Copy link
Collaborator

@economicstudio economicstudio commented Dec 30, 2018

Fixes #2105

Changes

  • Fix the relative url issues. "/@user" and "/@user/permlink" now work!

Test plan

I made a post for testing. It has various links for testing.

@anpigon
Copy link

anpigon commented Jan 8, 2019

good fixed. I nedd it.

@Sekhmet Sekhmet changed the base branch from master to develop January 17, 2019 10:47
@Sekhmet Sekhmet temporarily deployed to busy-develop-pr-2144 January 17, 2019 10:54 Inactive
@Sekhmet Sekhmet temporarily deployed to busy-develop-pr-2144 January 17, 2019 12:42 Inactive
if (!/^[\w.-]+:(\/\/)?/.test(url)) {
child.setAttribute('href', `https://${url}`);
}
if (/^\//.test(url)) child.setAttribute('href', `https://busy.org${url}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't use hardcoded https://busy.org URL. It won't work on localhost, preview apps, beta version and forks.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks for your comment. I've removed it now.

Copy link
Contributor

@Sekhmet Sekhmet left a comment

Choose a reason for hiding this comment

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

Thanks!

@Sekhmet Sekhmet merged commit de2cf28 into busyorg:develop Jan 17, 2019
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.

3 participants