local file link check only (/ vs \) absolute path

For technical support and bug reports for all editions of CSS HTML Validator, including htmlval for Linux and Mac.
equalizer
Rank 0 - Newcomer
Posts: 2
Joined: Wed Jul 19, 2017 9:37 am

local file link check only (/ vs \) absolute path

Post by equalizer »

Real simple task here: Just testing html validator for local technical pubs with no internet connection. Each pub has html links that may reference other html links (chapter 1, 2, etc) that may then link to hundreds of gifs or pdf files.

When I run link check only I get Error(s): invalid backslash ('\') character in path (should be '/')

Error computing path (subfolder1\fig1.gif). These are all local files so links are not absolute and because windows files, the path name are
in format:
C:\pub1\chp1\Diagrams\fig1.gif

Weblinks are in format htmlvalidator.com/CSEForum with forward slash, whereas Windows files are back slash \.

What options do I change to validate local links that ignores absolute path error and just confirms that local gifs or pdf files are actually present.
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: local file link check only (/ vs \) absolute path

Post by Albert Wiersch »

Hello,

Paths in HTML (like those specified by "href" and "src" attributes) should use the forward slash character. The browser will convert it to a backslash character if needed to access a local file.

If you change the backslash characters to forward slashes, then does it work and do your page links still work? I believe they should unless there is another issue.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
equalizer
Rank 0 - Newcomer
Posts: 2
Joined: Wed Jul 19, 2017 9:37 am

Re: local file link check only (/ vs \) absolute path

Post by equalizer »

Yes, that worked. However, we have hundreds of books with this html code and not going to change.
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: local file link check only (/ vs \) absolute path

Post by Albert Wiersch »

I could potentially add an option to address that in the link checker (but I wouldn't recommend it because it would better to fix the problem). Let me know if you would be interested in this approach.

You might also be able to use the Tidy tool to auto-fix that problem but I haven't tested it to see if it can fix that.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial