Menu

Syntax Highlighter Quirk

2002-10-29
2002-11-01
  • Tim Constantine

    Tim Constantine - 2002-10-29

    A single quote outside of any brackets messes with the syntax color codes.

    Copy and paste this code in the editor to see what I mean:

    ...<td><a href="/Newsletter/index.php">Nancy's News Archive</a> -

    <?php
    $sql = "SELECT MAX(IssueDate) FROM newsletters";
    $result = mysql_query($sql, $db);
    If ($result)...

    Can the program be changed to ignore quotes outside of <>'s?

     
    • Leonardo García

      i know that, but i still cannot figure out how to make the TSynMultiSyn component accept the
      <?php ?> tags.
      If anybody knows how to do it, let me know.

       
    • Urs Mäder

      Urs Mäder - 2002-10-30

      you can take the &#060 code

      ><a href="/Newsletter/index.php">Nancy&#060s News Archive</a> -

      the modifiying of the synedit highlighter i will posting here soon.

       
    • Urs Mäder

      Urs Mäder - 2002-10-30

      error ---- mea culpa :)

      better:
      you can take the &#039 code

      ><a href="/Newsletter/index.php">Nancy&#039s News Archive</a> -

      the modifiying of the synedit highlighter i will posting here soon.

      the code &#039 is for the "<"

       
    • Urs Mäder

      Urs Mäder - 2002-10-30

      here is the patch

      Change in file SynHiglighterphp.pas the procedure String39Proc. This work's not perfect, but much better.

      procedure TSynPHPSyn.String39Proc;
      begin
        fTokenID := tkString;
        case FLine[Run] of
          #0:
            begin
              NullProc;
              exit;
            end;
          #10:
            begin
              LFProc;
              exit;
            end;
          #13:
            begin
              CRProc;
              exit;
            end;
        end;

        while FLine[Run] <> #0 do
          case FLine[Run] of
            #39,#60:                    //// here is the new thing !!!!!!
              begin
                inc(Run);
                fRange := rsUnKnown;
                break;
              end;
            #10: break;
            #13: break;
          else inc(Run);
          end;
      end;

       
    • Leonardo García

      hey dude, i can't send you any mail.. my server gives an error.

       

Log in to post a comment.

MongoDB Logo MongoDB