mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 21:46:00 +02:00

that descendent classes can override the NodeName properly * Fixed an AV when GetNodeName is called and there is no NodeName set * Removed the THtmlCustomElement.NodeName property and override the GetNodeName method instead. The hashtable of TDOMNode_NS is not used because THtmlCustomElement uses a faster lookupsystem for tag/node-names * Added a basic test for the htmlwriter unit git-svn-id: trunk@12732 -
27 lines
514 B
ObjectPascal
27 lines
514 B
ObjectPascal
program TestHtmlWriter;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
uses
|
|
Classes, SysUtils, htmlwriter, htmlelements;
|
|
|
|
var hwriter: THtmlWriter;
|
|
hdoc : THTMLDocument;
|
|
begin
|
|
hdoc := THTMLDocument.Create;
|
|
hwriter := THTMLwriter.create(hdoc);
|
|
hwriter.Starthtml;
|
|
hwriter.Starthead;
|
|
hwriter.title('Test website');
|
|
hwriter.Endhead;
|
|
hwriter.Startbody;
|
|
hwriter.paragraph('test line 1');
|
|
hwriter.paragraph('test line 2');
|
|
hwriter.Endbody;
|
|
hwriter.Endhtml;
|
|
hwriter.Free;
|
|
writeln(hdoc.Asstring);
|
|
hdoc.Free;
|
|
end.
|
|
|