Sublime Forum

Syntax Highlighting Bug (PHP/CSS)

#1

The CSS syntax highlighting stops working when a multi-line PHP code block is inserted into CSS code.

This only happens if the CSS is inside of a PHP function.

Screenshot:

Code sample:

<?php
function foo(){ //only happens within a function body
  ?>
  <style>
    .bar {
      color: black;

      <?php /* single line PHP statements do not cause problems */ ?>

      line-height: 110%;

      <?php 
      echo 'font-weight:bold;'
      //remaining CSS is not colored
      ?>

      width: 100%;
      margin-bottom: 10px;
    }

    .baz {
      background-color: white;
    }
  </style>
  ?>
}
0 Likes

#2

This seems to be an open issue with the PHP syntax: https://github.com/sublimehq/Packages/issues/1168

0 Likes