Bugs in PHP/HTML mix (color codings)


#1

Hey guys, I really love the software here but this is starting to become a common thing for me…while I know my code and how to work around it…would be nice for the highlighting to be there. :wink:

PS: I have only toggle soft wrap and PHP selected as Grammar (in regards to a “fresh install.”)

Here’s an image to describe what I’m talking about:

http://imgur.com/cPI5TGH


#2

Can you check the detected language in bottom left corner ?
I think php support fragment of HTML but not the other way arround.


#3

I have:

CRLF UTF-8 PHP


#4

Anyone care to throw me a bone on how I could fix this for everyone? I wouldn’t mind doing the man-hours for it. (Still in college courses until April lol.)

I’m guessing it’s a regex of some sort somewhere?


#5

It would most likely be in the language-php package that you would make the fix.


#6

You can place your cursor in a badly colored php section.

Then invoke:
Editor: Log Cursor Scope (cmd-shift-alt-p)

If It’s html then it has guessed to wrong language and we can continue from there.


As a separate route you may check if the first line of the file looks like php.
Maybe an empty php tag before the file


#7

Where an issue starts:

Scopes at Cursortext.html.php
meta.tag.inline.any.html
string.quoted.double.html
meta.embedded.block.php
source.phpstring.quoted.single.php
meta.string-contents.quoted.single.php
meta.embedded.block.php
source.php

I tried some mspaint skills but my graphic skills are epic stick figures as you can see. :wink:


#8

Little padding for the pics :wink:

These may be some better captures. Also, they are the first issues I see on the php page.

Thoughts:

Screen 1

  1. [No] Maybe I have to put a . ''; in order to make the software know? I think it may be looking for the second apostrophe, after the end of the $id statement.
  2. It seems it’s not coloring the <?php part of the echo $id statement. Maybe that’s the first culprit.

And here’s another screenshot of the cursor at the <?php part.


#9

If anyone would like to see some of the various php coding issues for themselves, I’m mostly running a vanilla install of Fluxbb software: http://fluxbb.org/downloads/ mostly every php file is like this.