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

Warn user when see \ in local link #193

Open
Sorokin-Anton opened this issue Oct 13, 2022 · 2 comments
Open

Warn user when see \ in local link #193

Sorokin-Anton opened this issue Oct 13, 2022 · 2 comments
Labels

Comments

@Sorokin-Anton
Copy link
Contributor

Clarification and motivation

Currently a\b.md is threated as file in . that has backslash in name, and that is correct (e.g. GitHub understand it this way). Windows users can write this meaning file b.md in dir a. I think we should write them something like '\' is not threated as path separator here, maybe you mean "a/b.md"? instead of just reporting a\b.md as unexisting file.
Inverse slashes in filenames are unsupported in Windows, but supported in Linux, so we shouldn't forbid them at all.
I suggest to write message about path separators only when there really is a file with such path (a/b.md in my example)

Acceptance criteria

  • If I write [foo](a\b.md) and file a/b.md exists, xrefcheck prints useful message
  • I still can use links to files with name like a\b.md
@Martoon-00
Copy link
Member

I agree with the idea of the dedicated error message, but don't fully agree with throwing it only when the filepath is itself correct.

It makes a point, but what I worry about is: if I have a file both with \ and with a typo in filename, fixing that would require two check-edit iterations which some users will find unpleasant, and there is no actual need for this.

We could, for instance, report two different errors for such links.

But that's arguable indeed.

@Sorokin-Anton
Copy link
Contributor Author

@Martoon-00 Ok but in this case there should be a way to disable this error for users who actually use \ as a part of file name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants