Sublime Forum

[BUG] HTML turns to PHP

#1

Hello,

Can someone tell me why when I turn on HTML syntax it automatically turns to PHP? Screen shot attached. I’m running portable version


0 Likes

#2

The first line of a file is used to predict what language the file is written in and is an HTML tag.

Perhaps the file extension should take precedence.

0 Likes

#3

File is saved as *.html
It did work okay at first, when I just launched ST2. Maybe it doesn’t work because of some packages?

0 Likes

#4

In your screenshot the file is bb.php. Though it is marked as unsaved, I assumed it was a php file.
I’m not sure what you’re asking now – if it is a *.html file, it will open as HTML.

Are you saying that immediately after manually changing the syntax scheme to PHP it returns to HTML?

0 Likes

#5

bb.php is the first file, my test.html file tab was behind that white pop-up, where you can see that syntax is checked HTML but in the right bottom corner is set to php (when I click on php in that corner, pop-up shows up, and even there HTML is checked, not php)

0 Likes

#6

Can you provide the file so we can test it ourselves?
Did you try it after disabling all installed packages?

0 Likes

#7

Tried. Nothing.
test.zip (198 Bytes)

0 Likes

#8

Well this is strange, I’m having the exact opposite result. Opening the file, the syntax is set to HTML. If I set it to PHP, the check displays next to the item in the syntax menu but the status bar text doesn’t update and the file continues to use the HTML.tmLanguage parser. Using build 2178 installed on Win7 x64.

[code]

Title text
<p>Hello</p>
[/code]

Perhaps a bug after all…

0 Likes

#9

Will the creator of sublime text see this topic and fix this?

Few more questions: now I downloaded and installed dev version, and since they come out quite often, how should I update editor? Remove old version and install new one, or … ?
And is there plugin that could close tags that I open? When I type I want sublime to add automatically. When II type I don’t look at screen a lot, so I don’t use this <hea thing that inserts and .
Thank you

0 Likes

#10

Alright, weird stuff is going on with build 2178. I have the stable 2165 and there, when I set syntax to be php in progress bar it still is HTML, no matter what I do. And I think it’s after I installed sublime-linter. I really don’t imagine PHP editor without highlighting syntax errors. So I keep 2165 (portable) in my usb memory stick. Today I downloaded 2178 and installed on my computer. And the problem is opposite: can’t turn on PHP, it’s always HTML in status bar.

0 Likes

#11

I think I get what you mean, if you have PHP selected as the syntax, it will show HTML in the bottom right.

From what I’ve been able to find there seems to be no difference between the PHP and HTML syntax options. I have a feeling they may be 2 labels for 1 option as PHP is HTML with extras and neither in syntax really affects the other.

I’m assuming that PHP is an alias for the HTML syntax option which includes PHP syntax support, hence why it shows HTML in the bottom right. However I can’t find where it affects usability?

0 Likes