Open pretesnibi opened 9 years ago
i'm having the same problem. inline php in .html documents is not properly highlighted.
I tried moving the following from <mime-type type="text/html">
to <mime-type type="application/x-php">
in /usr/share/mime/packages/freedesktop.org.xml (then running update-mime-database /usr/share/mime):
`
<glob pattern="*.htm"/>`
Caja now recognizes files ending in .html or .htm as application/x-php, but Pluma still highlights as HTML.
By the way, original poster is correct that Pluma properly detects if the file is named anything not ending in .html or .htm, but only so long as the file starts with <?php
-- not if the PHP appears further along in the document.
Please update Pluma to respect Caja mime detection, or allow users to override Pluma's own automatic mime detection so that .html and .htm could e.g. be set to automatically enable PHP highlighting.
Any file ending in .html or .htm is assumed by Pluma to be an HTML document (type: text/html). This is unfortunate because most of the .html files I work with contain PHP, which Pluma is able to detect if the file is named anything not ending in .html
For example, take a text file with the following contents: <?php echo 'Hello, World!';?>
This is correctly detected by Pluma as PHP if the file is named any of the following: hello-world.php hello-world (with no file extension) hello-world.ext (with some other unrecognized extension)
But if it's named either of the following, Pluma thinks it's an HTML file: hello-world.html hello-world.htm
I believe this used to work better in Fedora 20.
It is frustrating that PHP syntax highlighting doesn't get applied to these files and I have to manually specify the highlight mode each time.
How can I force Pluma to sniff for the proper mime type rather than relying upon the .html extension?
I tried editing /usr/share/mime/packages/freedesktop.org.xml, removing the following lines within:
I then ran the following command: update-mime-database /usr/share/mime
The mime type is now correctly determined by the Mate file properties dialog, but Pluma apparently gets its settings from somewhere else...?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.