New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Colour hilighting absent in J! 3.8.4 when editing PHP files #19520
Comments
nothing to do with geshi lol |
OK, I'll have a look |
Got it. It seems like a bug in the meta.js file that codemirror uses to determine mode. See, what happens is, we know the "mode" we want by name so we use CodeMirror's {
name: "HTML",
mime: "text/html",
mode: "htmlmixed",
ext: ["html", "htm"],
alias: ["xhtml"]
} Or this: {
name: "JavaScript",
mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"],
mode: "javascript",
ext: ["js"],
alias: ["ecmascript", "js", "node"]
} Spot the difference? OK, so sometimes, there's 'mime' (string) and sometimes 'mimes' (array of strings). In case of 'mimes', CM will just set {
name: "PHP",
mime: ["application/x-httpd-php", "text/x-php"],
mode: "php",
ext: ["php", "php3", "php4", "php5", "php7", "phtml"]
} Obviously a typo, 'mime' should be 'mimes' so that CM can set mimes[0] as mime and we can use that value. Instead we're setting an array where we should be setting a string. So I'll put a workaround for this in our code and I'll also submit a fix to the codemirror project. Thanks for finding it! |
Ah, seems this is also fixed in the latest version of CodeMirror which was released a few days ago. |
Set to "closed" on behalf of @Quy by The JTracker Application at issues.joomla.org/joomla-cms/19520 |
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19520. |
Steps to reproduce the issue
In J! 3.8.3 the code in the template file editor is hilighted in colour when editing PHP files but in J! 3.8.4 the colour has disappeared. It doesn't make any difference to the actual code. When editing CSS files in J! 3.8.4 the code hilighting is still present.
Expected result
PHP file editing should retain the same code hilighting as for J! 3.8.3
Actual result
Colour code hilighting is absent on J! 3.8.4 when editing some files but the hilighting is retained when editing other files.
System information (as much as possible)
?GeShi
Additional comments
First reported https://forum.joomla.org/viewtopic.php?f=9&t=958741&p=3511589#p3511549
The text was updated successfully, but these errors were encountered: