Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.


  • In Gedit, open a new file and manually select the syntax highlighting language (at the bottom right) to PHP.
  • Write some javascript in <script> tags
  • Within the <script> tags, echo some XHTML with self-closing tags
  • Note that all of the code that follows is no longer syntax highlighted

Alternatively, paste this in:

    echo 'hello - this is still syntax highlighted! <span id="foo"></span>';

    myApp: {
        foobar: function() {
  'foo').set('html', '<hr />');
            alert('uh-oh, what happened to the syntax highlighting? This string is no longer coloured.');

    echo 'syntax highlighting returns after the closing </script> tag';

It's not a big deal, since I can work around it right now by replacing all self-closing tags with their HTML 4 equivalents (e.g. <input></input>), but I was wondering if anybody else dealt with this problem...

share|improve this question
Surely this belongs on Stack Overflow? – dmckee Apr 4 '12 at 14:26
Possibly - but since it's a Unixish question, and not really related to programming, I felt it belonged here. – Julian H. Lam Apr 4 '12 at 17:59
@dmckee Since it's about Gedit (yeah, it took me a while to figure that out, I've clarified the title), it's on-topic here. If the question had been about PHP, it would have been off-topic. – Gilles Apr 4 '12 at 23:41
Thanks @Gilles :) – Julian H. Lam Apr 5 '12 at 12:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.