소스 검색

* Improved whitespace handling (entity references as first child of an
element is now handled as indicator to stop the insertion of automatic
linefeeds. Until now this was only the case with text nodes.)

sg 25 년 전
부모
커밋
dca128133b
1개의 변경된 파일13개의 추가작업 그리고 3개의 파일을 삭제
  1. 13 3
      fcl/xml/htmwrite.pp

+ 13 - 3
fcl/xml/htmwrite.pp

@@ -167,6 +167,11 @@ begin
     wrt(c);
 end;
 
+function IsTextNode(Node: TDOMNode): Boolean;
+begin
+  Result := Node.NodeType in [TEXT_NODE, ENTITY_REFERENCE_NODE];
+end;
+
 
 // -------------------------------------------------------------------
 //   Node writers implementations
@@ -199,12 +204,12 @@ begin
   else
   begin
     SavedInsideTextNode := InsideTextNode;
-    if InsideTextNode or Child.InheritsFrom(TDOMText) then
+    if InsideTextNode or IsTextNode(Child) then
       wrt('>')
     else
       wrtln('>');
     repeat
-      if Child.InheritsFrom(TDOMText) then
+      if IsTextNode(Child) then
         InsideTextNode := True;
       WriteNode(Child);
       Child := Child.NextSibling;
@@ -370,7 +375,12 @@ end.
 
 {
   $Log$
-  Revision 1.1  2000-10-03 20:33:22  sg
+  Revision 1.2  2000-10-15 15:31:26  sg
+  * Improved whitespace handling (entity references as first child of an
+    element is now handled as indicator to stop the insertion of automatic
+    linefeeds. Until now this was only the case with text nodes.)
+
+  Revision 1.1  2000/10/03 20:33:22  sg
   * Added new Units "htmwrite" and "xhtml"
 
 }