PHPStorm does not recognize certain HTML/CSS syntax (like data-attributes, the <time> element and the <meta charset> syntax)

I am using PHPStorm 3.0.3.

I have a PHP file and inside that file I have code like this:

<meta charset="utf-8">

<div data-foo="bar">

<time>...</time>

In all the above cases, PHPStorm reports warnings ("unknown HTML tag", "not allowed", etc.).

Also in my CSS file I have:

border-color: rgba(0,119,204,0.5);

box-shadow: 0 0 2px #bbb;

word-wrap: break-word;

for which PHPStorm reports warnings too.

Why doesn't PHPStorm recognize these things? The meta charset syntax and the data-attributes have been around for ages. The RGBA value notation too....

---

BTW, I had troubles logging in. It seems that your system does not  accept my e-mail address as the username, which means that I have to  remember the exact username for my account. Guys, this is 2012, not  1999. Please enable e-mails as usernames. This is rediculous.

Also,  the "Remember me" functionality does not seem to work properly as I  have to constanly manually log in every time. It works for the other  services I use (Facebook, Gmail, StackOverflow), so I assume the problem  is with your web-site. You have to understand that it is in your  interest to keep users logged in. I mean, I have been permanently logged  in on Facebook for years. With you guys, on the other hand, every time I  want to ask a question regarding PHPStorm, I have to first figure out  how to log in (reseting the password, figuring out my stupid username). Please fix this!

0
4 comments

Hi there,

1) Settings | Schemas & DTDs | Default HTML language level -->.HTML 5

2) You may want to disable "W3C CSS Validator Inspection" in Settings | Inspections | CSS -- "      This inspection validates the CSS with W3C CSS validator library." Other than that -- you may want to create a ticket on Issue Tracker: http://youtrack.jetbrains.com/issues/WI

3) My personal opinion:

BTW, I had troubles logging in. It seems that your system does not   accept my e-mail address as the username, which means that I have to   remember the exact username for my account. Guys, this is 2012, not   1999. Please enable e-mails as usernames. This is rediculous.

It's a old version of forum (portal ?) software. IMHO this is not ridiculous -- it trains your memory (yeah, I know -- it's very hard to remember one nickname/login name .. unless for "privacy" (or whatever other) purposes you have it unique for each site (but then .. you will have to have separate emails as well .. otherwise you can be easily traced...)). Although I have to agree that since login name is not used anywhere (Display name is used instead) having email address to identify user will be much better.

Also,  the "Remember me" functionality does not seem to work properly as I  have to constanly manually log in every time.

It does remember me for 4 weeks (or so) since the login date. Works as described here. But yeah -- still having to re-login every 4 weeks, if I'm using this site virtually every day, is a bit annoying.

figuring out my stupid username

Choose proper name then .. or make a note of your username somewhere (simple text file .. or use services like RoboForm, 1Password, LastPass -- very handy indeed).

0

1) I did that and now there is no longer a warning on the <meta charset> and <time> tags. However, there is still a warning on the data-attributes:

    <div data-foo="bar"> ..... Warning: Attribute data-foo is not allowed here

Is there a way to tell PHPStorm that data-attributes are part of the HTML standard? It is strange that PHPStorm does not recognize them, since they have been part of the standard for quite some time, and more importantly, they are pretty common and their specification is stable.


2) I'm not sure that I want to disable the "W3C CSS Validator Inspection" alltogether. Currently, I see warnings for rgba() values, and the word-wrap property. I guess, I'll just ignore those warnings (and hope that version 4 brings an updated version of the CSS validator). Allthough, I would love to have a "Add to validataor" option (just like MS Word has "Add to dictionary"), where I could define the unrecognized properties/values manually... That would be cool.


3) 4 weeks, I see. Well, I come here less often, so I do have to log in everytime :) BTW, my user-name is proper, it's actually my real name - "Šime Vidas". The thing is that I'm never quite sure whether it's "simevidas", or "sime.vidas", or "Šime", etc, so it's a bit annoying.

0

1) Works fine for me in upcoming v4 (latest RC3 build) -- no warnings on data attributes (maybe I have something else turned off as well -- but I just do not remember any extra option for this). Try closing/restarting PhpStorm (or even File | Invalidate caches).

2) http://jigsaw.w3.org/css-validator/
Use this service (the same that PhpStorm uses, just web based). For your examples it produced the same warnings as PhpStorm.

I would love to have a "Add to validataor" option (just like MS Word has "Add to dictionary"), where I could define the unrecognized properties/values manually...

Settings | Inspections | CSS | Unknown CSS property -- but I do not think that it will work just like that as it is different to W3C CSS Validator inspection

0

I did the "Invalidate and restart" thing - it even resulted with a couple of error alert boxes on the next restart :) - but still no change. It seems that data-attributes are just unrecognized in version 3. Glad to hear that version 4 fixed this.

Yes, I tried to add "word-wrap" as an "Unknown CSS property" but the warning is still there (even after a restart), so I'll just live with that.

Thanks for all the help.

0

Please sign in to leave a comment.