问题
I've hunted around everywhere for this error fix, but no luck.
Using Dreamweaver, when i put the PHP code bracketing into an html file such as <?php echo 'Why does it not work?'; ?>
or something similar, I always get an error "Special characters must be escaped". I can't stand it anymore!
Any help would be soooo much appreciated. I've tried to change the code type at the bottom so it recognises it as PHP and doesn't give me grief about the brackets, but nothing.
I've modified the .htaccess file on the server so I've got no problems running php code in a html file.
回答1:
- Go to Edit -> Preferences
- in left panel highlight linting
- then in edit rule set highlight html, click edit and apply changes, scroll down to where it says
"spec-char-escape": true
, and change it tofalse
, edit your page - click save
You should no longer see errors
回答2:
I thought I'd put the answer here in case anyone else has a similar problem. The validation I was talking about is called "linting" in DW. I edited the linting HTML file from inside DW: Edit > Preferences > Linting > Select code type then Edit & Apply changes. In my case I set escape special characters to false in the file. Voila!
Here's the linting specs: https://github.com/yaniswang/HTMLHint/wiki/Rules
来源:https://stackoverflow.com/questions/45401229/dreamweaver-php-special-characters-must-be-escaped-error