TextWrangler does not highlight PHP & HTML codes properly - ide

TextWrangler for Mac (v5.0.2) sometimes cannot highlight HTML & PHP codes (mixed) properly, given that the syntax is perfectly correct.
How to resolve this issue?

You can select "PHP in HTML" option from footer/status bar in TextWrangler as shown in the image. Moreover make sure extension of the file is php.

This is a known issue for both TextWrangler and BBEdit. The work-around is to select another programming language on the bottom left, and then reselect PHP in HTML. It seems that some actions trigger this bug.

Related

UI Text not rendering properly with Intellij IDEA and MacType

I wanted to make Intellij IDEA on windows look like the one on OS X Because in
my opinion it looks much better, so I installed MacType, I was able to get the
editor font render correctly, but when I change the UI font to match OS X's UI
font, The text gets cut off in some places. The font I am trying to use is
Lucida Grande size 15. You can see it for yourself in the picture
below:
Intellij UI Text getting cut: https://i.stack.imgur.com/4jnda.png
But if I remove disable MacType rendering, everything works fine, but it looks bad.
Intellij UI Text without MacType rendering: https://i.stack.imgur.com/AJEUl.png
I've tried changing MacType's settings, but nothing works!
I am on Windows 10 Creators Update with Intellij IDEA 2017.2
Any help would be appreciated.
I found the answer myself! Apparently if you open the mactype profile you are using with notepad, and paste the following text at the end of the file:
[Experimental#idea64.exe]
ClipBoxFix=1
Then all the fonts will render correctly. Note, this does not only work for Intellij IDEA, but also all other java applications and a few others. To achieve this, all you have to do is replace "idea64.exe" with the name of the app executable. An example is for the 32-bit version of Intellij, you would replace "idea64.exe" with "idea.exe".
More information can be found here: https://github.com/snowie2000/mactype/wiki/ClipBoxFix

Sublime text 2 prints wrong comment block on shortcut

For some time now, when i hit cmd-/ (mac) in .php files it prints the comments for html,
and not for php.
so it does instead of //
the format is set to PHP, and it shows 'php' on the bottom right of the editor,
also all the syntax highlighting is fine.
any idea?
thanks :)
T
Sublime is decent, I prefer notepad++ and brackets for development. For your issue, uninstall than install Sublime in default, see if it works. If it does work, and you have custom plugins for it, add one at a time and test. To see what is causing the problem. If nothing is causing the problem and you have everything set to how you had it prior. I am guessing that some form of data corruption occured or the shortcut for a comment in php is mixed up with the comment in html. The text editor shouldn't be treating a completely different language as another. I hope this helped.
What commenting is done is based on the scoping rules. I'm not a PHP programmer so I might get some of the details wrong, but you should get the general idea. If I understand correctly, PHP files consist of a mix of HTML elements and PHP code blocks. ST allows for languages to be "embedded" within another file type (in this case, embedding HTML in the PHP syntax). If the cursor is in an html region, it will use HTML commenting. If it is a PHP region, it will use PHP commenting. I know there are some issues with edge cases, but try moving the cursor into the actual PHP code block, then using the comment command. You could probably find a modified language file that will just treat everything as PHP if you want.
To check the scopes begin applied, you can use the ScopeHunter plugin. Alternatively, you can use the ctrl+alt+shift+p in windows and linux or cmd+alt+p in osx to display the scope in the status bar.
I hope that helps clarify how commenting works. How you choose to actually "solve" this is up to you though, as it's more of a personal preference thing.

Webstorm: how to extend to handle PHP files or even just highlight code correctly?

I tried this IDE and I like it. Only problem is that if Im in a project that has some PHP in it, its confusing to see plain black text instead of correct PHP highlight.
I dont need brutal PHP autocomplete or so, but a syntax highlight. Is it possible to achieve in Webstorm?
Or the only option is to use PHPStorm?
Why not
File Menu > Settings > File Types > click 'PHP files' > click 'Add' in the bottom screen > enter '*.php'
(instead of html with .php)
Associate the .php file extension to HTML file cause the IDE highlight at least HTML code correctly.
File Menu > Settings > File Types > click 'HTML files' > click 'Add' in the bottom screen > enter '*.php'.
UPDATE: since TextMate bundles support was added to the IDE, you can add any language syntax highlighting to the IDE if there is TextMate bundle for it. See my reply about adding Ruby highlighting, it would be the same for PHP, just the different bundle.
Your best option is to use PhpStorm. Another option is to create your custom file type for basic syntax highlighting.
A late reply, but this worked for me:
use this textmate bundle: https://github.com/textmate/php.tmbundle
Then go to settings > File Types and associate *.php to PHP files.
Hope it helps.
I tried the textmate bundle but it seems that there is an issue. I wasn't able to get highlighting. I think it is an unsolved bug, so I wonder if someone figured out how to use it.
http://youtrack.jetbrains.com/issue/WEB-11065
http://youtrack.jetbrains.com/issue/RUBY-14273
So I think I have to use PHPStorm to get basic syntax highlighting. Thats sad :/
This questions describes how to install textmate plugin which gives you syntax highlighting:
Is it possible to get Ruby syntax highlighting in PHPStorm?
The only difference is that you want to use this bundle: https://github.com/textmate/php.tmbundle
(but maybe there are better ones)

Notepad++ stopped color-coding my source code... How to fix?

For no apparent reason, it just stopped. No more color-coding. Is there a mystery setting I accidentally turned off?
I had the same problem and discovered it was because I had enabled global foreground color under Global Styles.
Try out the following:
Select a language manually from the "Languages" menu.
In Settings/Preferences, check the File Associatons.
In worst case, reinstall.
In the Language menu select your corresponding language. For example H and then html
The solution for me was to go into the Style Configurator, select the 'Global Styles' from the Language selection box and uncheck the 'Enable global foreground colour' option. I am not sure why that was checked, but all of the code coloring worked after unchecking it. Thanks Richard!
Have a look in Settings -> Style Configurator. Maybe your styles got messed up somehow. You could try changing the selected style to see if it makes a difference.
I think the saved styles are stored in the "themes" directory under your Notepad++ installation directory, so you could also check that the files have not become corrupted in some way.
I had the same problem (I Googled "notepad++ file coloring quit" to find this discussion.) In my case the coloring quit mid file in a single file. I finally realized that adjacent string literals with one of them a macro was fooling Notepad++.
My code that broke it read:
Write_Supplemental_Configuration(privateData->new_config, FTP_ROOT_DIR"/lists.csv");
and the fix was to add a space after the macro:
Write_Supplemental_Configuration(privateData->new_config, FTP_ROOT_DIR "/lists.csv");
I tried replacing the macro FTP_ROOT_DIR with "foo" and the problem went away.
So in my case it was a macro that fooled the Notepad++ coloring.
watch out for the single quote that you copy from the web. if you get one of those "upper commas" instead of the tic mark it will confuse the code and kill the coloring (in SQL). just delete and replace.
Make sure that when you save the file it's saved as an .html instead of a .txt. This make a difference because the .html allows you to see the different colour codes whereas .txt doesn't.
Check, if you have saved the documents as .HTML and not as .txt
in the menu, choose Settings>Style configurator...
and in the list in the left pan select html, check if the colors for different tags are being shown in the color blocks. if yes, chosse a font and then save and exit.
Check only after you save the document in .html, whether it is working or not.
The language setting solved the issue for (all) 3 Javascript files (.js) which suffered from it, which previously were all recognized correctly as Javascript. For some reason it forgot they were Javascript files apparently!?
First type any thing and Save the file in any format you are working with (i-e; .cpp if c++, .js if JavaScript....etc)
And make sure global foreground color is disabled.
And it should work fine.
File > Save As > Format Type = Structured Query Language > Name the file with '*.sql'. THIS SHOULD BRING ALL THE COLOR CODES.....to differentiate your code and make it look pretty. J
If you want to display text in SQL format, then in menu select Language => S => SQL
Got to Setting -> Style Configuration and remove the global style checkbox
I just had the same thing happen to me. The only way I could fix it was to rename the file (I just added one character). Then open it with notepad++. The code was colored again. Then renamed the file back to the original name and it is still colored.
I have since found that if I close Notepad++ without closing the file first this happens. Try closing the file first then close Notepad++ then reopen the file.
This bug seems to be fixed as of version 7.8.6
If the coloring only stopped working for one file, you should check the extension name of your file. You might have accidentally saved the file as .txt
A couple years late here, but I'm pretty sure you're opening ".txt" files that contain your source code. Because the file doesn't have the language's extension, Notepad++ can't determine how to color-code it. You'll have to select the language under the "Language" tab.

SEO issue red characters in source code? > Why? Syntax highlighting? browser source code?

SEO issue red characters
Hi all
I'm building webstes using dreamweaver, but when I look at the source code it is red for " characters. I'm told anything appearing in red puts off Google's seo. Does anyone know why this appears in red?
For example when I view code source on the site i get the gt; in red
Find out more>></span>
</div>
Thanks for your help
Regards
Judi
I'm told anything appearing in red puts off googles seo.
That is garbage.
Does anyone know why this appears in red?
Probably because it is an entity and has been marked by the syntax highlighter so you can spot in amongst literals.
Google SEO aside, it's important to understand that there's a world of difference between using CSS to control the colour of text, and the syntax highlighting done by the DreamWeaver editor.
Colours seen when you are viewing the HTML source of your page in a tool like Dreamweaver have nothing to do with the colours seen when viewing your page in a browser.
All that's happening is that Dreamweaver is syntax colouring HTML escape characters in red, I am pretty sure that you have nothing to worry about.
Edit
You clarified that in fact you're not viewing the HTML source in Dreamweaver.
Are you viewing source from Firefox?
Firefox syntax colours HTML in its "source of" viewer. HTML escape codes are shown in red (Firefox 3.6, Windows). The point still stands however that this is just syntax colouring and has nothing to do with how your page gets rendered by the browser, or anything to go with Google SEO.
This might be a bit off topic and of course no-brainer for you guys, but anyway:
Firefox highlights all open lines as red. If you have for example:
meta content="text...
and there is no /> at the end of the line, then Firefox makes that line appear red when you use "view page source".
Though that's not the reason for red highlight in your case.
I can view source in Firefox 11 (Win) and see bolded and non-bolded red highlighted markup. If I hover over the bolded red markup, I see a pop-up description of the problem Firefox is finding with the HTML source. For example:
Start tag seen without seeing a doctype first. Expected "<!DOCTYPE html>"
Start tag "div" seen in "table"
Stray end tag "table"
Stray end tag "div"
In non-bolded red highlighted syntax I see entities such as:
, &, >
Firefox 11 allows you to configure and use an external application to View Source. It also has several configuration values in about:config ("view_source.syntax.highlight" for example) that control how the feature is delivered.
The bolded red source highlighting in Firefox View Source may or may not cause issues with SEO. It's an indication that the browser is finding an issue with the HTML markup in the page you're viewing.
The issue of how much invalid HTML harms you with respect to SEO is debated. (And as pointed out in a separate answer, also depends on where the invalid markup appears.) This youtube video discusses HTML validation and Google SEO: http://www.youtube.com/watch?v=2XlKn6I9rSc.
I'm told anything appearing in red puts off googles seo
No. Just no. Google's SEO works on a text-basis, it ignores any colouring or formatting within a page.
The colour of the text in the source code is simply based on DreamWeaver's syntax highlighting - if you run and view your page in a browser, it shouldn't be this colour (assuming you aren't actually setting the colour of this to red).
Google will check for color on same color text and background to make sure hidden keywords aren't being used on the page. To google, white on white text is a no-no.
In Dreamweaver, syntax highlight of HTML entities does not translate into a bad 'mark' in the SEO book.
Now on the other hand, if you have key phrases in your link text that includes (>)'s, then your SEO work for the key phrase is shot because the >'s are counted as part of the key phrase.
You can probably turn red highlighting of entities off in Dreamweaver's preferences....