** Description changed:

  [ Impact ]
  
  Colorer, the syntax highlighter used by FAR2L, incorrectly interprets
  Smarty template syntax. This leads to valid Smarty templates being
  displayed with syntax errors, hindering readability and development.
  This fix improves syntax highlighting accuracy for Smarty templates
  within far2l.
  
  [ Test Plan ]
  
  1. Install FAR2L with the updated Colorer schemes (from the PPA or after 
applying the patch).
  2. Create file test.tpl in editor with the following content:
  
  <script>
-     $(document).ready(function() { 
-         {if $test}
-             $('#action-pending').on('click', function(e) {
-                 // этот код не должен краситься как код smarty, а он красится!
-                 window.location = '?action=pending&list=' + list;
-                 return false;
-             });
-         {/if}
-     }); 
+     $(document).ready(function() {
+         $('#action-pending').on('click', function(e) {
+             // ...
+             window.location = '?action=pending&list=' + list;
+             return false;
+         });
+     });
  </script>
  
  <style>
-     .appeal-content {
-         background-color: #eee;
-         padding: 10px;
-     }
+     .appeal-content {
+         background-color: #eee;
+         padding: 10px;
+     }
  
-     table.tablesorter tr td table tr.monitor td {
-         border-bottom: 2px solid white;
-         color: white;
-         background-color: red;
-         cursor: pointer;
-     }
+     table.tablesorter tr td table tr.monitor td {
+         border-bottom: 2px solid white;
+         color: white;
+         background-color: red;
+         cursor: pointer;
+     }
  </style>
  
  3. Compare the highlighting with attached reference image
  
  Also compare the highlighting with the previous version where this
  snippet would show syntax errors.
  
  [ Where problems could occur ]
  
  The changes modify how Smarty templates are parsed. While targeted,
  regressions are possible, especially with more complex or edge-case
  Smarty syntax.  Testing several complex Smarty templates is recommended
  to ensure no unintended highlighting issues are introduced. Also the fix
  is already in 24.10 and in project's ppa, no problems were reported.
  
  [ Other Info ]
  
  This fix addresses the issues raised in the upstream Colorer project
  (see links above) and has been integrated into far2l via a pull request.
  It significantly improves Smarty template support within far2l without
  requiring broad changes to the highlighting engine. This enhances the
  editor's usability for web developers working with Smarty templates.
  This change is already in 24.10 and here is a patch adopting it for
  24.04.
  
  https://github.com/elfmz/far2l/issues/531
  https://github.com/colorer/Colorer-schemes/issues/75
  https://github.com/elfmz/far2l/pull/2198
  
  ProblemType: Bug
  DistroRelease: Ubuntu 24.04
  Package: far2l 2.6.0~beta+ds-1ubuntu0.1
  ProcVersionSignature: User Name 6.8.0-31.31-generic 6.8.1
  Uname: Linux 6.8.0-31-generic x86_64
  ApportVersion: 2.28.1-0ubuntu2
  Architecture: amd64
  CasperMD5CheckMismatches: ./boot/grub/grub.cfg
  CasperMD5CheckResult: fail
  CurrentDesktop: ubuntu:GNOME
  Date: Wed Oct  9 15:37:28 2024
  InstallationDate: Installed on 2024-04-29 (163 days ago)
  InstallationMedia: Ubuntu 24.04 LTS "Noble Numbat" - Release amd64 (20240424)
  ProcEnviron:
   LANG=en_US.UTF-8
   PATH=(custom, no user)
   SHELL=/bin/bash
   TERM=xterm-256color
   XDG_RUNTIME_DIR=<set>
  SourcePackage: far2l
  UpgradeStatus: No upgrade log present (probably fresh install)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2084094

Title:
  syntax highlighting problem with smarty php templates

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/far2l/+bug/2084094/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to