0

I am creating an app with Laravel using Emacs and I can't get Emacs to highlight syntax using web-mode in blade with neither @php @endphp blocks or using <?php ?> blocks. I saw this question before but no one came with an answer. There is a way to do this with web-mode? Or should I choose another mode for editing blade templates.

MRE

In an Emacs buffer with web-mode and blade engine paste the following

@php
  switch ($type) {
    case 'Help':
      $variant = 'info';
      break;
    case 'Text':
      variant = 'success';
      break;
  }
@endphp

<?php
  switch ($type) {
    case 'Help':
      $variant = 'info';
      break;
    case 'Text':
      variant = 'success';
      break;
  }
?>

In neither case you get highlighting or indentation properly (in the image I do the intentation myself).

MRE screenshot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.