View Issue Details

IDProjectCategoryView StatusLast Update
0022082LazarusPatchpublic2012-10-21 18:04
ReporterJanusz TomczakAssigned ToMartin Friebe 
PrioritynormalSeveritytweakReproducibilityN/A
Status closedResolutionfixed 
Product Version1.1 (SVN)Product Build 
Target VersionFixed in Version1.1 (SVN) 
Summary0022082: SynHighlighterHTML - formatting, fixed fSimpleTags, remove SYN_CPPB_1
DescriptionPlease commit the patch.
TagsNo tags attached.
Fixed in Revision37356
LazTarget1.2
Widgetset
Attached Files
  • synhighlighterhtml.pp.patch (8,497 bytes)
    Index: synhighlighterhtml.pp
    ===================================================================
    --- synhighlighterhtml.pp	(revision 37355)
    +++ synhighlighterhtml.pp	(working copy)
    @@ -155,6 +155,14 @@
         ('×'),             {   ×   }
         ('&divide'),             {   ÷   }
         ('€'),              {   €   }
    +    ('‰'),
    +    ('„'),
    +    ('”'),
    +    ('‘'),
    +    ('’'),
    +    ('–'),
    +    ('—'),
    +    ('•'),
         //used by very old HTML editors
         ('	'),                {  TAB  }
         (''),              {      }
    @@ -206,17 +214,8 @@
         ('½'),              {   ½   }
         ('¾'),              {   ¾   }
         ('¿'),              {   ¿   }
    -    ('×'),              {   Ô   }
    -    ('‰'),
    -    ('„'),
    -    ('”'),
    -    ('‘'),
    -    ('’'),
    -    ('–'),
    -    ('—'),
    -    ('•'));
    +    ('×'));             {   Ô   }
     
    -
     type
       TtkTokenKind = (tkAmpersand, tkASP, tkCDATA, tkComment, tkIdentifier, tkKey, tkNull,
         tkSpace, tkString, tkSymbol, tkText, tkUndefKey, tkValue);
    @@ -464,8 +463,7 @@
         function GetFoldConfigCount: Integer; override;
         function GetFoldConfigInternalCount: Integer; override;
       public
    -    {$IFNDEF SYN_CPPB_1} class {$ENDIF}                                         //mh 2000-07-14
    -    function GetLanguageName: string; override;
    +    class function GetLanguageName: string; override;
       public
         constructor Create(AOwner: TComponent); override;
         function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
    @@ -815,7 +813,6 @@
       end;
     end;
     
    -
     function TSynHTMLSyn.Func15: TtkTokenKind;
     begin
       if KeyComp('BDI') then begin
    @@ -988,7 +985,6 @@
       end;
     end;
     
    -
     function TSynHTMLSyn.Func34: TtkTokenKind;
     begin
       if KeyComp('RP') then begin
    @@ -1070,9 +1066,14 @@
         Result := tkKey;
         fSimpleTag := True;
       end
    -  else if KeyComp('WBR') Or KeyComp('MARK') then begin
    +  else if KeyComp('WBR') then begin
         Result := tkKey;
    -  end else begin
    +    fSimpleTag := True;
    +  end
    +  else if KeyComp('MARK') then begin
    +    Result := tkKey;
    +  end
    +  else begin
         Result := tkUndefKey;
       end;
     end;
    @@ -1208,12 +1209,12 @@
     begin
       if KeyComp('SPACER') then begin
         Result := tkKey;
    +    fSimpleTag := True;
       end else begin
         Result := tkUndefKey;
       end;
     end;
     
    -
     function TSynHTMLSyn.Func63: TtkTokenKind;
     begin
       if KeyComp('COMMAND') then begin
    @@ -1254,12 +1255,12 @@
     begin
       if KeyComp('KEYGEN') then begin
         Result := tkKey;
    +    fSimpleTag := True;
       end else begin
         Result := tkUndefKey;
       end;
     end;
     
    -
     function TSynHTMLSyn.Func68: TtkTokenKind;
     begin
       if KeyComp('ARTICLE') then begin
    @@ -1271,7 +1272,7 @@
     
     function TSynHTMLSyn.Func70: TtkTokenKind;
     begin
    -  if KeyComp('ADDRESS') Or KeyComp('APPLET') Or KeyComp('ILAYER') Or KeyComp('DETAILS')then begin
    +  if KeyComp('ADDRESS') Or KeyComp('APPLET') Or KeyComp('ILAYER') Or KeyComp('DETAILS') then begin
         Result := tkKey;
       end else begin
         Result := tkUndefKey;
    @@ -1280,9 +1281,14 @@
     
     function TSynHTMLSyn.Func76: TtkTokenKind;
     begin
    -  if KeyComp('NEXTID') Or KeyComp('TFOOT') then begin
    +  if KeyComp('NEXTID') then begin
         Result := tkKey;
    -  end else begin
    +    fSimpleTag := True;
    +  end else
    +  if KeyComp('TFOOT') then begin
    +    Result := tkKey;
    +  end
    +  else begin
         Result := tkUndefKey;
       end;
     end;
    @@ -1305,7 +1311,6 @@
       end;
     end;
     
    -
     function TSynHTMLSyn.Func80: TtkTokenKind;
     begin
       if KeyComp('INPUT') then  begin
    @@ -1332,10 +1337,10 @@
     
     function TSynHTMLSyn.Func82: TtkTokenKind;
     begin
    -  if KeyComp('BASEFONT') then begin
    +  if KeyComp('BASEFONT') Or KeyComp('BGSOUND') then begin
         Result := tkKey;
         fSimpleTag := True;
    -  end else if KeyComp('BGSOUND') Or KeyComp('STRIKE') then begin
    +  end else if KeyComp('STRIKE') then begin
         Result := tkKey;
       end else begin
         Result := tkUndefKey;
    @@ -1363,7 +1368,7 @@
     
     function TSynHTMLSyn.Func85: TtkTokenKind;
     begin
    -  if KeyComp('SCRIPT') Or KeyComp('HGROUP') Or KeyComp('SECTION')then begin
    +  if KeyComp('SCRIPT') Or KeyComp('HGROUP') Or KeyComp('SECTION') then begin
         Result := tkKey;
       end else begin
         Result := tkUndefKey;
    @@ -1478,7 +1483,6 @@
       end;
     end;
     
    -
     function TSynHTMLSyn.Func113: TtkTokenKind;
     begin
       if KeyComp('OUTPUT') then begin
    @@ -1488,7 +1492,6 @@
       end;
     end;
     
    -
     function TSynHTMLSyn.Func114: TtkTokenKind;
     begin
       if KeyComp('NOSCRIPT') then begin
    @@ -1509,8 +1512,12 @@
     
     function TSynHTMLSyn.Func121: TtkTokenKind;
     begin
    -  if KeyComp('BLOCKQUOTE') Or KeyComp('PLAINTEXT') then begin
    +  if KeyComp('PLAINTEXT') then begin
         Result := tkKey;
    +    fSimpleTag := True;
    +  end else
    +  if KeyComp('BLOCKQUOTE') then begin
    +    Result := tkKey;
       end else begin
         Result := tkUndefKey;
       end;
    @@ -1606,7 +1613,6 @@
       end;
     end;
     
    -
     function TSynHTMLSyn.Func137: TtkTokenKind;
     begin
       if KeyComp('/BDI') then begin
    @@ -1697,7 +1703,6 @@
       end;
     end;
     
    -
     function TSynHTMLSyn.Func152: TtkTokenKind;
     begin
       if KeyComp('/MAP') then begin
    @@ -1763,7 +1768,7 @@
     
     function TSynHTMLSyn.Func160: TtkTokenKind;
     begin
    -  if KeyComp('/THEAD') Or KeyComp('/TR') Or KeyComp('/ASIDE')Or KeyComp('/RT')then begin
    +  if KeyComp('/THEAD') Or KeyComp('/TR') Or KeyComp('/ASIDE')Or KeyComp('/RT') then begin
         Result := tkKey;
       end else begin
         Result := tkUndefKey;
    @@ -1853,7 +1858,7 @@
     
     function TSynHTMLSyn.Func172: TtkTokenKind;
     begin
    -  if KeyComp('/SPAN') Or KeyComp('/AUDIO')then begin
    +  if KeyComp('/SPAN') Or KeyComp('/AUDIO') then begin
         Result := tkKey;
       end else begin
         Result := tkUndefKey;
    @@ -1884,7 +1889,7 @@
     
     function TSynHTMLSyn.Func177: TtkTokenKind;
     begin
    -  if KeyComp('/FONT') Or KeyComp('/OBJECT') Or KeyComp('/VIDEO')then begin
    +  if KeyComp('/FONT') Or KeyComp('/OBJECT') Or KeyComp('/VIDEO') then begin
         Result := tkKey;
       end else begin
         Result := tkUndefKey;
    @@ -1918,7 +1923,6 @@
       end;
     end;
     
    -
     function TSynHTMLSyn.Func182: TtkTokenKind;
     begin
       if KeyComp('/CANVAS') then begin
    @@ -1937,7 +1941,6 @@
       end;
     end;
     
    -
     function TSynHTMLSyn.Func185: TtkTokenKind;
     begin
       if KeyComp('/COMMAND') then begin
    @@ -1967,7 +1970,7 @@
     
     function TSynHTMLSyn.Func188: TtkTokenKind;
     begin
    -  if KeyComp('/TBODY') Or KeyComp('/TITLE') Or KeyComp('/FIGURE')Or KeyComp('/RUBY')then begin
    +  if KeyComp('/TBODY') Or KeyComp('/TITLE') Or KeyComp('/FIGURE')Or KeyComp('/RUBY') then begin
         Result := tkKey;
       end else begin
         Result := tkUndefKey;
    @@ -1983,10 +1986,9 @@
       end;
     end;
     
    -
     function TSynHTMLSyn.Func192: TtkTokenKind;
     begin
    -  if KeyComp('/ADDRESS') Or KeyComp('/APPLET') Or KeyComp('/ILAYER') Or KeyComp('/DETAILS')then begin
    +  if KeyComp('/ADDRESS') Or KeyComp('/APPLET') Or KeyComp('/ILAYER') Or KeyComp('/DETAILS') then begin
         Result := tkKey;
       end else begin
         Result := tkUndefKey;
    @@ -2062,7 +2064,7 @@
     
     function TSynHTMLSyn.Func207: TtkTokenKind;
     begin
    -  if KeyComp('/SCRIPT') Or KeyComp('/HGROUP') Or KeyComp('/SECTION')then begin
    +  if KeyComp('/SCRIPT') Or KeyComp('/HGROUP') Or KeyComp('/SECTION') then begin
         Result := tkKey;
       end else begin
         Result := tkUndefKey;
    @@ -2186,7 +2188,6 @@
       end;
     end;
     
    -
     function TSynHTMLSyn.Func236: TtkTokenKind;
     begin
       if KeyComp('/NOSCRIPT') then begin
    @@ -2287,8 +2288,7 @@
       AddAttribute(fASPAttri);
     
       fCDATAAttri := TSynHighlighterAttributes.Create(SYNS_AttrCDATA, SYNS_XML_AttrCDATA);
    -  fCDATAAttri.Foreground := clBlack;
    -  fCDATAAttri.Background := clAqua;
    +  fCDATAAttri.Foreground := clGreen;
       AddAttribute(fCDATAAttri);
     
       fCommentAttri := TSynHighlighterAttributes.Create(SYNS_AttrComment, SYNS_XML_AttrComment);
    @@ -2385,8 +2385,6 @@
       end;
     end;
     
    -
    -
     procedure TSynHTMLSyn.SetMode(const AValue: TSynHTMLSynMode);
     begin
       if FMode = AValue then exit;
    @@ -2757,16 +2755,13 @@
       Result := ord(high(THtmlCodeFoldBlockType)) - ord(low(THtmlCodeFoldBlockType)) + 1;
     end;
     
    -{$IFNDEF SYN_CPPB_1} class {$ENDIF}                                             //mh 2000-07-14
    -function TSynHTMLSyn.GetLanguageName: string;
    +class function TSynHTMLSyn.GetLanguageName: string;
     begin
       Result := SYNS_LangHTML;
     end;
     
     initialization
       MakeIdentTable;
    -{$IFNDEF SYN_CPPB_1}                                                            //mh 2000-07-14
       RegisterPlaceableHighlighter(TSynHTMLSyn);
    -{$ENDIF}
    +
     end.
    -
    

Activities

2012-05-19 23:33

 

synhighlighterhtml.pp.patch (8,497 bytes)
Index: synhighlighterhtml.pp
===================================================================
--- synhighlighterhtml.pp	(revision 37355)
+++ synhighlighterhtml.pp	(working copy)
@@ -155,6 +155,14 @@
     ('×'),             {   ×   }
     ('&divide'),             {   ÷   }
     ('€'),              {   €   }
+    ('‰'),
+    ('„'),
+    ('”'),
+    ('‘'),
+    ('’'),
+    ('–'),
+    ('—'),
+    ('•'),
     //used by very old HTML editors
     ('	'),                {  TAB  }
     (''),              {      }
@@ -206,17 +214,8 @@
     ('½'),              {   ½   }
     ('¾'),              {   ¾   }
     ('¿'),              {   ¿   }
-    ('×'),              {   Ô   }
-    ('‰'),
-    ('„'),
-    ('”'),
-    ('‘'),
-    ('’'),
-    ('–'),
-    ('—'),
-    ('•'));
+    ('×'));             {   Ô   }
 
-
 type
   TtkTokenKind = (tkAmpersand, tkASP, tkCDATA, tkComment, tkIdentifier, tkKey, tkNull,
     tkSpace, tkString, tkSymbol, tkText, tkUndefKey, tkValue);
@@ -464,8 +463,7 @@
     function GetFoldConfigCount: Integer; override;
     function GetFoldConfigInternalCount: Integer; override;
   public
-    {$IFNDEF SYN_CPPB_1} class {$ENDIF}                                         //mh 2000-07-14
-    function GetLanguageName: string; override;
+    class function GetLanguageName: string; override;
   public
     constructor Create(AOwner: TComponent); override;
     function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes;
@@ -815,7 +813,6 @@
   end;
 end;
 
-
 function TSynHTMLSyn.Func15: TtkTokenKind;
 begin
   if KeyComp('BDI') then begin
@@ -988,7 +985,6 @@
   end;
 end;
 
-
 function TSynHTMLSyn.Func34: TtkTokenKind;
 begin
   if KeyComp('RP') then begin
@@ -1070,9 +1066,14 @@
     Result := tkKey;
     fSimpleTag := True;
   end
-  else if KeyComp('WBR') Or KeyComp('MARK') then begin
+  else if KeyComp('WBR') then begin
     Result := tkKey;
-  end else begin
+    fSimpleTag := True;
+  end
+  else if KeyComp('MARK') then begin
+    Result := tkKey;
+  end
+  else begin
     Result := tkUndefKey;
   end;
 end;
@@ -1208,12 +1209,12 @@
 begin
   if KeyComp('SPACER') then begin
     Result := tkKey;
+    fSimpleTag := True;
   end else begin
     Result := tkUndefKey;
   end;
 end;
 
-
 function TSynHTMLSyn.Func63: TtkTokenKind;
 begin
   if KeyComp('COMMAND') then begin
@@ -1254,12 +1255,12 @@
 begin
   if KeyComp('KEYGEN') then begin
     Result := tkKey;
+    fSimpleTag := True;
   end else begin
     Result := tkUndefKey;
   end;
 end;
 
-
 function TSynHTMLSyn.Func68: TtkTokenKind;
 begin
   if KeyComp('ARTICLE') then begin
@@ -1271,7 +1272,7 @@
 
 function TSynHTMLSyn.Func70: TtkTokenKind;
 begin
-  if KeyComp('ADDRESS') Or KeyComp('APPLET') Or KeyComp('ILAYER') Or KeyComp('DETAILS')then begin
+  if KeyComp('ADDRESS') Or KeyComp('APPLET') Or KeyComp('ILAYER') Or KeyComp('DETAILS') then begin
     Result := tkKey;
   end else begin
     Result := tkUndefKey;
@@ -1280,9 +1281,14 @@
 
 function TSynHTMLSyn.Func76: TtkTokenKind;
 begin
-  if KeyComp('NEXTID') Or KeyComp('TFOOT') then begin
+  if KeyComp('NEXTID') then begin
     Result := tkKey;
-  end else begin
+    fSimpleTag := True;
+  end else
+  if KeyComp('TFOOT') then begin
+    Result := tkKey;
+  end
+  else begin
     Result := tkUndefKey;
   end;
 end;
@@ -1305,7 +1311,6 @@
   end;
 end;
 
-
 function TSynHTMLSyn.Func80: TtkTokenKind;
 begin
   if KeyComp('INPUT') then  begin
@@ -1332,10 +1337,10 @@
 
 function TSynHTMLSyn.Func82: TtkTokenKind;
 begin
-  if KeyComp('BASEFONT') then begin
+  if KeyComp('BASEFONT') Or KeyComp('BGSOUND') then begin
     Result := tkKey;
     fSimpleTag := True;
-  end else if KeyComp('BGSOUND') Or KeyComp('STRIKE') then begin
+  end else if KeyComp('STRIKE') then begin
     Result := tkKey;
   end else begin
     Result := tkUndefKey;
@@ -1363,7 +1368,7 @@
 
 function TSynHTMLSyn.Func85: TtkTokenKind;
 begin
-  if KeyComp('SCRIPT') Or KeyComp('HGROUP') Or KeyComp('SECTION')then begin
+  if KeyComp('SCRIPT') Or KeyComp('HGROUP') Or KeyComp('SECTION') then begin
     Result := tkKey;
   end else begin
     Result := tkUndefKey;
@@ -1478,7 +1483,6 @@
   end;
 end;
 
-
 function TSynHTMLSyn.Func113: TtkTokenKind;
 begin
   if KeyComp('OUTPUT') then begin
@@ -1488,7 +1492,6 @@
   end;
 end;
 
-
 function TSynHTMLSyn.Func114: TtkTokenKind;
 begin
   if KeyComp('NOSCRIPT') then begin
@@ -1509,8 +1512,12 @@
 
 function TSynHTMLSyn.Func121: TtkTokenKind;
 begin
-  if KeyComp('BLOCKQUOTE') Or KeyComp('PLAINTEXT') then begin
+  if KeyComp('PLAINTEXT') then begin
     Result := tkKey;
+    fSimpleTag := True;
+  end else
+  if KeyComp('BLOCKQUOTE') then begin
+    Result := tkKey;
   end else begin
     Result := tkUndefKey;
   end;
@@ -1606,7 +1613,6 @@
   end;
 end;
 
-
 function TSynHTMLSyn.Func137: TtkTokenKind;
 begin
   if KeyComp('/BDI') then begin
@@ -1697,7 +1703,6 @@
   end;
 end;
 
-
 function TSynHTMLSyn.Func152: TtkTokenKind;
 begin
   if KeyComp('/MAP') then begin
@@ -1763,7 +1768,7 @@
 
 function TSynHTMLSyn.Func160: TtkTokenKind;
 begin
-  if KeyComp('/THEAD') Or KeyComp('/TR') Or KeyComp('/ASIDE')Or KeyComp('/RT')then begin
+  if KeyComp('/THEAD') Or KeyComp('/TR') Or KeyComp('/ASIDE')Or KeyComp('/RT') then begin
     Result := tkKey;
   end else begin
     Result := tkUndefKey;
@@ -1853,7 +1858,7 @@
 
 function TSynHTMLSyn.Func172: TtkTokenKind;
 begin
-  if KeyComp('/SPAN') Or KeyComp('/AUDIO')then begin
+  if KeyComp('/SPAN') Or KeyComp('/AUDIO') then begin
     Result := tkKey;
   end else begin
     Result := tkUndefKey;
@@ -1884,7 +1889,7 @@
 
 function TSynHTMLSyn.Func177: TtkTokenKind;
 begin
-  if KeyComp('/FONT') Or KeyComp('/OBJECT') Or KeyComp('/VIDEO')then begin
+  if KeyComp('/FONT') Or KeyComp('/OBJECT') Or KeyComp('/VIDEO') then begin
     Result := tkKey;
   end else begin
     Result := tkUndefKey;
@@ -1918,7 +1923,6 @@
   end;
 end;
 
-
 function TSynHTMLSyn.Func182: TtkTokenKind;
 begin
   if KeyComp('/CANVAS') then begin
@@ -1937,7 +1941,6 @@
   end;
 end;
 
-
 function TSynHTMLSyn.Func185: TtkTokenKind;
 begin
   if KeyComp('/COMMAND') then begin
@@ -1967,7 +1970,7 @@
 
 function TSynHTMLSyn.Func188: TtkTokenKind;
 begin
-  if KeyComp('/TBODY') Or KeyComp('/TITLE') Or KeyComp('/FIGURE')Or KeyComp('/RUBY')then begin
+  if KeyComp('/TBODY') Or KeyComp('/TITLE') Or KeyComp('/FIGURE')Or KeyComp('/RUBY') then begin
     Result := tkKey;
   end else begin
     Result := tkUndefKey;
@@ -1983,10 +1986,9 @@
   end;
 end;
 
-
 function TSynHTMLSyn.Func192: TtkTokenKind;
 begin
-  if KeyComp('/ADDRESS') Or KeyComp('/APPLET') Or KeyComp('/ILAYER') Or KeyComp('/DETAILS')then begin
+  if KeyComp('/ADDRESS') Or KeyComp('/APPLET') Or KeyComp('/ILAYER') Or KeyComp('/DETAILS') then begin
     Result := tkKey;
   end else begin
     Result := tkUndefKey;
@@ -2062,7 +2064,7 @@
 
 function TSynHTMLSyn.Func207: TtkTokenKind;
 begin
-  if KeyComp('/SCRIPT') Or KeyComp('/HGROUP') Or KeyComp('/SECTION')then begin
+  if KeyComp('/SCRIPT') Or KeyComp('/HGROUP') Or KeyComp('/SECTION') then begin
     Result := tkKey;
   end else begin
     Result := tkUndefKey;
@@ -2186,7 +2188,6 @@
   end;
 end;
 
-
 function TSynHTMLSyn.Func236: TtkTokenKind;
 begin
   if KeyComp('/NOSCRIPT') then begin
@@ -2287,8 +2288,7 @@
   AddAttribute(fASPAttri);
 
   fCDATAAttri := TSynHighlighterAttributes.Create(SYNS_AttrCDATA, SYNS_XML_AttrCDATA);
-  fCDATAAttri.Foreground := clBlack;
-  fCDATAAttri.Background := clAqua;
+  fCDATAAttri.Foreground := clGreen;
   AddAttribute(fCDATAAttri);
 
   fCommentAttri := TSynHighlighterAttributes.Create(SYNS_AttrComment, SYNS_XML_AttrComment);
@@ -2385,8 +2385,6 @@
   end;
 end;
 
-
-
 procedure TSynHTMLSyn.SetMode(const AValue: TSynHTMLSynMode);
 begin
   if FMode = AValue then exit;
@@ -2757,16 +2755,13 @@
   Result := ord(high(THtmlCodeFoldBlockType)) - ord(low(THtmlCodeFoldBlockType)) + 1;
 end;
 
-{$IFNDEF SYN_CPPB_1} class {$ENDIF}                                             //mh 2000-07-14
-function TSynHTMLSyn.GetLanguageName: string;
+class function TSynHTMLSyn.GetLanguageName: string;
 begin
   Result := SYNS_LangHTML;
 end;
 
 initialization
   MakeIdentTable;
-{$IFNDEF SYN_CPPB_1}                                                            //mh 2000-07-14
   RegisterPlaceableHighlighter(TSynHTMLSyn);
-{$ENDIF}
+
 end.
-

Issue History

Date Modified Username Field Change
2012-05-19 23:33 Janusz Tomczak New Issue
2012-05-19 23:33 Janusz Tomczak File Added: synhighlighterhtml.pp.patch
2012-05-19 23:53 Martin Friebe Status new => assigned
2012-05-19 23:53 Martin Friebe Assigned To => Martin Friebe
2012-05-20 00:27 Martin Friebe Fixed in Revision => 37356
2012-05-20 00:27 Martin Friebe LazTarget => 1.2
2012-05-20 00:27 Martin Friebe Status assigned => resolved
2012-05-20 00:27 Martin Friebe Fixed in Version => 1.1 (SVN)
2012-05-20 00:27 Martin Friebe Resolution open => fixed
2012-10-21 18:04 Janusz Tomczak Status resolved => closed