Skip to content

Conversation

XhmikosR
Copy link
Contributor

There's a bug somewhere which results in backslashes in paths when building on Windows.

Maybe the name should be normalize slashes or something? I just wanted to keep it short here.

Fixes #2396

@MylesBorins
Copy link
Contributor

Is there anyone with a windows box who can verify?

@XhmikosR
Copy link
Contributor Author

XhmikosR commented Aug 23, 2019

Here's the output without this patch (trimmed) to get an idea:

C:\Users\xmr\Desktop\nodejs.org>npm run test:html

> nodejs.org@ test:html C:\Users\xmr\Desktop\nodejs.org
> node scripts/vnu-jar.js

"file:/C:/Users/xmr/Desktop/nodejs.org/build/ar/docs/guides/abi-stability/index.html":32.3-32.80: error: Bad value "https://nodejs.org/ar/docs/guides\abi-stability/" for attribute "href" on element "link": Backslash ("\") used as path segment delimiter.
"file:/C:/Users/xmr/Desktop/nodejs.org/build/ar/docs/guides/anatomy-of-an-http-transaction/index.html":32.3-32.97: error: Bad value "https://nodejs.org/ar/docs/guides\anatomy-of-an-http-transaction/" for attribute "href" on element "link": Backslash ("\") used as path segment delimiter.
"file:/C:/Users/xmr/Desktop/nodejs.org/build/ar/docs/guides/debugging-getting-started/index.html":32.3-32.92: error: Bad value "https://nodejs.org/ar/docs/guides\debugging-getting-started/" for attribute "href" on element "link": Backslash ("\") used as path segment delimiter.
"file:/C:/Users/xmr/Desktop/nodejs.org/build/ar/docs/guides/getting-started-guide/index.html":32.3-32.88: error: Bad value "https://nodejs.org/ar/docs/guides\getting-started-guide/" for attribute "href" on element "link": Backslash ("\") used as path segment delimiter.
"file:/C:/Users/xmr/Desktop/nodejs.org/build/ar/docs/guides/index.html":32.3-32.66: error: Bad value "https://nodejs.org/ar/docs\guides/" for attribute "href" on element "link": Backslash ("\") used as path segment delimiter.
"file:/C:/Users/xmr/Desktop/nodejs.org/build/ar/docs/guides/publishing-napi-modules/index.html":32.3-32.90: error: Bad value "https://nodejs.org/ar/docs/guides\publishing-napi-modules/" for attribute "href" on element "link": Backslash ("\") used as path segment delimiter.
...

My main concern is that I don't know where this bug comes from. Is it from metalsmith itself?

There's a bug somewhere which results in backslashes in paths when building on Windows.
@SEWeiTung
Copy link
Contributor

@XhmikosR, Have you submitted test:html in the package.json?
捕获

@XhmikosR
Copy link
Contributor Author

XhmikosR commented Sep 3, 2019

@MaledongGit: what do you mean? If you mean the vnu addition, that's in #2469, which isn't ready yet.

@SEWeiTung
Copy link
Contributor

@XhmikosR :Well……I fetched the latest version of codes and I cannot use test:html, I want to know whether this is already added in the package.json or not. Otherwises I'll merge it into the repository ;)

@XhmikosR
Copy link
Contributor Author

XhmikosR commented Sep 3, 2019 via email

'use strict'

module.exports = function (str) {
return process.platform === 'win32' && str.replace(/\\/g, '/')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The process.platform check seems inconsistent now since in summary.js I don't do the same.

@SEWeiTung SEWeiTung merged commit 161df35 into nodejs:master Sep 3, 2019
@XhmikosR XhmikosR deleted the master-xmr-slashes branch September 4, 2019 06:25
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.

Wrong URLs on Windows
3 participants