Copy link to clipboard
Copied
Saw a recent discussion here which showed errors in the html being highlighted by showing the line numbers in red. I have two syntax errors below but no red highlighting. I have "Enable code hints" checked.. Is there a setting/s I am missing? I am on 2017.5 I am working with a defined site and the Monaki theme. Is that green tick showing in the bottom-right corner of my screen suggesting all is ok?
thanks
Copy link to clipboard
Copied
I think your document is not saved. Please try saving document and then you should see line numbers in red.
Copy link to clipboard
Copied
Is your Linting turned on?
Go to Edit > Preferences > Linting to make sure the Enable Linting box is checked.
If it is checked, Inayal may be right...
In previous versions of DW where linting was available, it would fire on open, edit and save of the document. You would see your linting warnings in real time. The latest version of DW only fires on document save so you won't be warned about possible errors until after they're part of a saved document.
Copy link to clipboard
Copied
Oops, I didn't notice that first image you posted showed PHP in the language dropdown.
Linting is only available for .html, .css and .js file extensions. If you have a .php page, it won't work there.
Copy link to clipboard
Copied
https://forums.adobe.com/people/Jon+Fritz+II wrote
Oops, I didn't notice that first image you posted showed PHP in the language dropdown.
Linting is only available for .html, .css and .js file extensions. If you have a .php page, it won't work there.
That's why its mostly rubbish, most programs have poor support for code errors because linting is not supported fully in multi-language pages. Some have a stab at it and get bits right but you cant rely on it.
Copy link to clipboard
Copied
I haven't bothered with Linting since Adobe switched it to firing only on save.
If I'm being forced to save the document to see issues, I'd rather use actual validation tools that follow the specs than the Linter and its "not actually errors" error highlighting.
Copy link to clipboard
Copied
https://forums.adobe.com/people/Jon+Fritz+II wrote
I haven't bothered with Linting since Adobe switched it to firing only on save.
That would be annoying.
Copy link to clipboard
Copied
thanks everyone. I save all my files as .php so have never seen this highlighting!. I just saved one as .html and now I see the red highlighting OK. All my pages in my present site are saved as .php I did this because I always use <?php include... statements (to bring in common code), and, unless I am wrong, the includes will not work if they appear in a normal .html page many thanks, Dave
Copy link to clipboard
Copied
That is correct, unless you modify your server to parse php within .html pages, php scripts and includes won't work within a .html page.
If you're just looking for something that will list html errors in your final output page, use File > Validate > Current Document W3C, or enter your page address (or the full source code) into the form at http://validator.w3.org/nu
Copy link to clipboard
Copied
thanks John, yes I do use the W3C validation service. How would I go about "modify your server to parse php within .html pages"? Can do that with my xampp?
Copy link to clipboard
Copied
Can I parse Includes in ordinary .html files?
This varies by web host. Some shared hosting plans allow it but many do not. If you're on a dedicated or VPS hosting plan, it's likely that you can parse .html files as .php files by amending (or creating) an .htaccess file in your server's root folder. If unsure, check with your hosting provider.
Contents of .htaccess file:
AddType text/html .php
AddHandler server-parsed .php
Options Indexes FollowSymLinks Includes
AddHandler server-parsed .html
Copy link to clipboard
Copied
Thanks Nancy. My host is 1&1 - can I achieve what you suggest with the below options they provide; I see AddHandler is absent
thanks, Dave
Copy link to clipboard
Copied
You could try it but like I said above, many shared hosting plans don't allow it. Parsing every HTML file as PHP puts an extra load on the server.
Nancy