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: When alias contains parameters, append ext error #1855

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

sy-records
Copy link
Member

Summary

As mentioned in #1854, if the URL used by the alias contains parameters, we will add the 'ext' configuration item incorrectly

What kind of change does this PR introduce?

Bugfix

For any code change,

  • Related documentation has been updated if needed
  • Related tests have been updated or tests have been added

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

Related issue, if any:

Fix #1854

Tested in the following browsers:

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

@vercel
Copy link

vercel bot commented Aug 12, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
docsify-preview ✅ Ready (Inspect) Visit Preview Aug 12, 2022 at 7:10AM (UTC)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 12, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 1c5a0cb:

Sandbox Source
docsify-template Configuration

Copy link
Member

@Koooooo-7 Koooooo-7 left a comment

Choose a reason for hiding this comment

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

LGTM.
In line 85, it seems a typo bug.

Koooooo-7
Koooooo-7 previously approved these changes Aug 12, 2022
test/unit/router-history-base.test.js Outdated Show resolved Hide resolved
@sy-records sy-records requested a review from a team August 13, 2022 02:38
: `${path}${ext}`;
: path.indexOf('?') === -1
? `${path}${ext}`
: path;
Copy link
Member

Choose a reason for hiding this comment

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

We need to handle all URLs the same with or without the query, just like regular HTML in a browser.

For example, /path/to/folder/?foo=123 has a query, and we still need to look for /path/to/folder/README.md?foo=123, but this skips anything with a query.

In the end, we need to operate on the path separately, and always send the query with the final result.

Choose a reason for hiding this comment

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

@trusktr, is there anything that could help push this along? I'm not that familiar with js but I am good with regular expressions. If you can provide a little more context on the issue perhaps I could put a little time into it, as fixing this would open up a lot of doors for those of us needing to federate markdown files from private repos/orgs on GitHub.

Copy link
Member

Choose a reason for hiding this comment

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

@vergilcw sorry for late reply. I think the solution should determine the fully qualified URL (f.e. anchor.href = partialUrlString; const fullyQualifiedUrl = anchor.href) and then use a new URL object to get all the pieces and use them correctly.

Copy link
Member

@trusktr trusktr left a comment

Choose a reason for hiding this comment

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

See comment. Basically this still has other problems. The solution is to handle paths and queries separately

@SumithChandran
Copy link

SumithChandran commented Sep 6, 2022

See comment. Basically this still has other problems. The solution is to handle paths and queries separately
Hi,
Any new updates on this issue.
We were working on federating multiple repo's readme.md files to a single documentation page.
Fixing this error would help a lot.

@trusktr
Copy link
Member

trusktr commented Jan 26, 2023

See comment. Basically this still has other problems. The solution is to handle paths and queries separately
Hi,
Any new updates on this issue.
We were working on federating multiple repo's readme.md files to a single documentation page.
Fixing this error would help a lot.

@SumithChandran hi, sorry for taking long. Did you find a solution? I commented on a direction we should look at. We just need to handle all the URL parts correctly, f.e. get all the parts of the URL, do what we need with only the path part, then put everything back together properly.

@SumithChandran
Copy link

See comment. Basically this still has other problems. The solution is to handle paths and queries separately
Hi,
Any new updates on this issue.
We were working on federating multiple repo's readme.md files to a single documentation page.
Fixing this error would help a lot.

@SumithChandran hi, sorry for taking long. Did you find a solution? I commented on a direction we should look at. We just need to handle all the URL parts correctly, f.e. get all the parts of the URL, do what we need with only the path part, then put everything back together properly.

@trusktr , no I haven't found anything solution.

@zomgbre
Copy link

zomgbre commented Jun 7, 2023

Any chance this will get done soon? I've actually never committed to a public repo, but this looks pretty straightforward. I'd be willing to try.

@trusktr
Copy link
Member

trusktr commented Sep 19, 2023

Any chance this will get done soon? I've actually never committed to a public repo, but this looks pretty straightforward. I'd be willing to try.

@zomgbre willing to take a stab at it? We haven't circled back yet

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.

.md getting appended while using alias
6 participants