feat(url_for): convert backward to forward slash#228
Open
curbengh wants to merge 1 commit intohexojs:masterfrom
Open
feat(url_for): convert backward to forward slash#228curbengh wants to merge 1 commit intohexojs:masterfrom
curbengh wants to merge 1 commit intohexojs:masterfrom
Conversation
- to deal with Windows path
Contributor
Author
|
Alternatively, we could also convert in doesn't work quite well in |
2 tasks
Member
|
|
Contributor
Author
|
const { format } = require('url');
const lorem = new URL('http://ipsum.com/foo\\bar/baz\\dolor')
console.log(format(lorem))
// http://ipsum.com/foo/bar/baz/dolor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
to deal with Windows path, see https://github.com/hexojs/hexo/pull/4479/files#r470968350
url_for()deals with relative URLs, which should never have backward slash.full_url_for()doesn't need to update becauseencodeURL()already have conversion in place (via URL API).I'm assuming no one uses backward slash "%5C" in urls.