Bug 344734

Summary: Incorrect syntax highlighting for css containing brackets
Product: [Applications] kate Reporter: joshua
Component: syntaxAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal CC: walch.martin
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description joshua 2015-03-02 09:37:22 UTC
This CSS:

@media (max-width: 1150px) {
}

Is valid according to The W3C CSS Validation Service. However, kate incorrectly marks it - and the entire rest of the file after it - as containing an error.

This appears to happen, because kate is not capable of handling brackets with spaces in them. For instance, this is not detected as an error: (max-width:1150px) - note that the space has been removed.

To fix: Kate needs to handle whitespace appropriately.

Reproducible: Always

Steps to Reproduce:
1. One a new document, and set the syntax highlighting to treat it as CSS

2. Enter the a line containing brackets with a space, for instance:

@media (max-width: 1150px) {

Actual Results:  
Everything from the closing bracket to the end of the file is now highlighted as as error.

Expected Results:  
It should have accepted it as valid css.

I am using the most recent version of kate available via apt.
kate -v reports this:

Qt: 4.8.6
KDE Development Platform: 4.13.3
Kate: 3.13.3
Comment 1 Martin Walch 2015-03-13 16:05:40 UTC
This looks the same as bug #335744 "Kate/KWrite CSS highlighting problems with media queries". It is fixed in KDE Applications >=4.14.0. The last few comments of that bug report explain how you can get the fix in your current installation.

*** This bug has been marked as a duplicate of bug 335744 ***