| Summary: | syntax highlighting not working when PHP inset is in JS function | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-syntax-highlighting | Reporter: | Steve V. <blauesnichts> |
| Component: | syntax | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | minor | CC: | gszymaszek, ilmari.lauhakangas |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
Screenshot of syntax highlighting with the error
Screenshot of syntax highlighting with PHP inset commented out |
||
Created attachment 97752 [details]
Screenshot of syntax highlighting with the error
Created attachment 97753 [details]
Screenshot of syntax highlighting with PHP inset commented out
I confirm the result when using HTML highlighting. Arch Linux 64-bit Kate 16.04.2 KDE Frameworks 5.23.0 Qt 5.7 xcb wm I cannot reproduce this bug (i.e. syntax highlighting works correctly) under Frameworks 5.51 (Debian testing) and 5.54, using Qt 5.11.3 in both cases. It’s probably fixed, though I don’t know the exact commit. (In reply to gszymaszek from comment #4) > I cannot reproduce this bug (i.e. syntax highlighting works correctly) under > Frameworks 5.51 (Debian testing) and 5.54, using Qt 5.11.3 in both cases. > It’s probably fixed, though I don’t know the exact commit. Did you set highlighting to "HTML"? I still repro on Arch Linux. Kate 18.12.1 KDE Frameworks 5.53.0 Qt 5.12.0 No, I use “PHP (HTML)”. And it probably should be used in this case. KWrite may choose wrong language if the extension is html (not php/phtml). (In reply to gszymaszek from comment #6) > No, I use “PHP (HTML)”. And it probably should be used in this case. KWrite > may choose wrong language if the extension is html (not php/phtml). Ok, then it was a user error. Closing. |
As soon as I put a PHP inset into a javascript function the syntax highlighting breaks from this point on downwards, screwing the syntax highligting for the rest of the file. Reproducible: Always Steps to Reproduce: Minimum example: <!DOCTYPE html> <html> <head> <script> function someJSFunc() { <?php $var1 = 1; ?> } </script> </head> </html> Actual Results: The opening tag <?php is not recognised in syntax highlighting and the rest down is not recognised either in the minimal example, probably as a result of the first missed <?php tag. For the part above tag <?php syntax highlighting is working normally. As soon as the PHP-inset is deleted or commented out the syntax highlighting is again working. Expected Results: The PHP-inset should be detected and syntax highlighting working. Happens for KWrite Version 4.14.3 Under KDE 4.14.9 OS: OpenSuse 13.2, 64 bit Does not occur for OpenSuse 13.1 and KWrite version 4.11.5