Class TTidy

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TTidy = class(TComponent)

Description

The main component of the TidyPas wrapper.

Provides for creation, initialization and destruction of the opaque TidyDoc object, properties for accessing TidyLib's configuration options, methods for loading the document and retrieving the output, and an event property to receive diagnostic and repair information.

Note to FreePascal users:
There exist two different versions of TTidy, one being a "real" component, suitable for use with the Lazarus IDE, and the other a lightweight "psuedo" component, better suited for use in console-style applications. If you need the Lazarus component, use the laztidy.pas unit, otherwise, the object in the tidyobj.pas unit can result in a much smaller executable in many cases.

Hierarchy

Overview

Methods

Public constructor Create(aOwner:tComponent); override;
Public destructor Destroy; override;
Public function LoadConfigFile(const aFilename:string):bool;
Public function SaveConfigFile(const aFilename:string):bool;
Public function ParseFile(const aFilename:string):string;
Public function ParseString(const aInputString:string):string;
Public function ParseBuffer(buf:pTidyBuffer):string;
Public class function ReleaseDate:string;

Properties

Public property AccessWarningCount: uint (read-only);
Public property AppData: pointer (read/write);
Public property BlockTags: string (read/write);
Public property BodyNode: pTidyNode (read-only);
Public property ConfigErrorCount: uint (read-only);
Public property CSSPrefix: string (read/write);
Public property Doctype: string (read-only);
Public property DoctypeMode: uint (read-only);
Public property EmptyTags: string (read/write);
Public property ErrorCount: uint (read-only);
Public property ErrorSummary: string (read-only);
Public property GeneralInfo: string (read-only);
Public property Handle: pTidyDoc (read-only);
Public property HeadNode: pTidyNode (read-only);
Public property HtmlNode: pTidyNode (read-only);
Public property InlineTags: string (read/write);
Public property InputCompleteCallback: tTidyInputCompleteCallback (read/write);
Public property NCR: bool (read/write);
Public property OutputBom: TidyTriState (read/write);
Public property ReportCallback: TidyReportFilter (read/write);
Public property RootNode: pTidyNode (read-only);
Public property Status: LongInt (read-only);
Public property Title: string (read-only);
Public property UserDoctype: string (read/write);
Public property WarningCount: uint (read-only);
Public property XmlDecl: string (read-only);
Published property AccessibilityCheckLevel: uint (read/write);
Published property AddXmlDecl: bool (read/write);
Published property AllowUnknownTags: boolean (read/write);
Published property AltText: string (read/write);
Published property AsciiChars: bool (read/write);
Published property BodyOnly: bool (read/write);
Published property BreakBeforeBR: bool (read/write);
Published property CharEncoding: TidyEncodingID (read/write);
Published property Congruent: Boolean (read/write);
Published property DropEmptyParas: bool (read/write);
Published property DropFontTags: bool (read/write);
Published property DropPropAttrs: bool (read/write);
Published property DuplicateAttrs: TidyDupAttrModes (read/write);
Published property Emacs: bool (read/write);
Published property EncloseBlockText: bool (read/write);
Published property EncloseBodyText: bool (read/write);
Published property ErrorFile: string (read/write);
Published property EscapeCdata: bool (read/write);
Published property FixBackslash: bool (read/write);
Published property FixComments: bool (read/write);
Published property FixUri: bool (read/write);
Published property ForceOutput: bool (read/write);
Published property HideComments: bool (read/write);
Published property HideEndTags: bool (read/write);
Published property InCharEncoding: TidyEncodingID (read/write);
Published property IndentAttributes: bool (read/write);
Published property IndentCdata: bool (read/write);
Published property Indent: Integer (read/write);
Published property JoinClasses: bool (read/write);
Published property JoinStyles: bool (read/write);
Published property LiteralAttribs: bool (read/write);
Published property LogicalEmphasis: bool (read/write);
Published property LowerLiterals: bool (read/write);
Published property MakeBare: bool (read/write);
Published property MakeClean: bool (read/write);
Published property Mark: bool (read/write);
Published property MergeDivs: uint (read/write);
Published property MergeOrphanForms: boolean (read/write);
Published property Newline: TidyLineEnding (read/write);
Published property NumEntities: bool (read/write);
Published property OnInputComplete: tTidyInputCompleteEvent (read/write);
Published property OnReport: tTidyReportEvent (read/write);
Published property OutCharEncoding: TidyEncodingID (read/write);
Published property OutputMode: TidyOutputMode (read/write) published property PreScanScripts:Boolean (read/write);
Published property PreTags: string (read/write);
Published property PunctWrap: bool (read/write);
Published property Quiet: bool (read/write);
Published property QuoteAmpersand: bool (read/write);
Published property QuoteMarks: bool (read/write);
Published property QuoteNbsp: bool (read/write);
Published property ReplaceColor: bool (read/write);
Published property ShowErrors: uint (read/write);
Published property ShowMarkup: bool (read/write);
Published property ShowWarnings: bool (read/write);
Published property TabSize: uint (read/write);
Published property UpperCaseAttrs: bool (read/write);
Published property UpperCaseTags: bool (read/write);
Published property VertSpace: bool (read/write);
Published property Word2000: bool (read/write);
Published property WrapAsp: bool (read/write);
Published property WrapAttVals: bool (read/write);
Published property WrapJste: bool (read/write);
Published property WrapLen: uint (read/write);
Published property WrapPhp: bool (read/write);
Published property WrapScriptlets: bool (read/write);
Published property WrapSection: bool (read/write);
Published property XmlAutoDetect: Boolean (read/write);
Published property XmlPIs: bool (read/write);
Published property XmlSpace: bool (read/write);
Published property XmlTags: bool (read/write);

Description

Methods

Public constructor Create(aOwner:tComponent); override;

Creates a new instance of tTidy, and intializes an instance of the library's TidyDoc object.

To create an instance of tTidy without a parent object, simply call: tTidy.Create(nil)

Public destructor Destroy; override;

Frees the memory allocated to the tTidy instance, and releases the TidyDoc from the library.

Public function LoadConfigFile(const aFilename:string):bool;

Reads the configuration property settings from a disk file.

Public function SaveConfigFile(const aFilename:string):bool;

Writes the configuration property settings to a disk file.

Returns TRUE if the file was successfullly saved to disk, or FALSE if an error occurred.

Settings are saved to a standard text file, in the format name: value

Consult the HTML-Tidy documentation for more information.

Public function ParseFile(const aFilename:string):string;

Tells the library to take its input from the file specified in aFilename.

If the aFilename argument is an empty string, TTidy will wait for input from the standard input console (stdin)

Normally, this function returns a string containing the repaired version of the file's contents.
In cases where TidyLib failed to repair the document, an empty string is returned.

Public function ParseString(const aInputString:string):string;

Tells the library to take its input from the string specified in aInputString.

Normally, this function returns a repaired version of the input string.
In cases where TidyLib failed to repair the document, an empty string is returned.

Public function ParseBuffer(buf:pTidyBuffer):string;

Tells the library to take its input from the tTidyBuffer pointed to by buf.

Normally, this function returns a string containing the repaired version of the buffer's contents.
In cases where TidyLib failed to repair the document, an empty string is returned.

Public class function ReleaseDate:string;

Returns a string representing the release date of the library.

Note that this a class function, which means that you can call TTidy.ReleaseDate directly, without having to create a TTidy object.

Properties

Public property AccessWarningCount: uint (read-only);

Returns the number of accessibility warnings that the library encountered while parsing the document.

Public property AppData: pointer (read/write);

A generic pointer you can set to anything you like. This might be useful e.g. to pass data to the ReportFilter callback.

Note that the this is not the same thing as the tidySetAppData / tidyGetAppData library functions.
TTidy reserves tidySetAppData() and tidyGetAppData() for its own internal use, and this property is provided as a substitute.

Public property BlockTags: string (read/write);

This option specifies new block-level tags. This option takes a space or comma separated list of tag names.

In order to process a document with previously unknown tags, you must either declare new tags, set ForceOutput to True, or set AllowUnknownTags to True.

Note you can't change the content model for elements such as <TABLE>, <UL>, <OL> and <DL>.

Public property BodyNode: pTidyNode (read-only);

Returns the <body> node of the parsed document.

Public property ConfigErrorCount: uint (read-only);

Returns the number of configuration errors that the library encountered, either from parsing the configuration file, or from invalid property settings.

Public property CSSPrefix: string (read/write);

This option specifies the prefix that Tidy uses for styles rules.

By default, "c" will be used.

Public property Doctype: string (read-only);

The text of the <!DOCTYPE> node, if any, of the parsed document.

To set the value of the doctype before parsing, see the TTidy.UserDocType property.

Public property DoctypeMode: uint (read-only);

Returns the mode that the library used to parse the document.

This property is read-only.

To manually set desired doctype of the output, use the UserDocType property.

Public property EmptyTags: string (read/write);

This option specifies new empty inline tags. Specify a space- or comma- separated list of tag names.

In order to process a document with previously unknown tags, you must either declare new tags, set ForceOutput to True, or set AllowUnknownTags to True.

Remember to also declare empty tags as either inline or blocklevel.

Public property ErrorCount: uint (read-only);

Returns the number of errors that the library encountered while parsing the document.

Public property ErrorSummary: string (read-only);

Returns a summary of the errors and warnings tidy encountered while parsing and reparing the document.

Public property GeneralInfo: string (read-only);

Returns a paragraph or so of text providing general suggestions and recommendations concerning the parsed document.

Public property Handle: pTidyDoc (read-only);

This property exposes the library's current TidyDoc instance, so you can call library functions directly.

Note that the value of the Handle property may change after each call to one of the ParseFile, ParseString, or ParseBuffer methods.

Warning:

DO NOT use the library's TidySetAppData() function on this handle!

TidySetAppData() and TidyGetAppData() are used internally by TTidy, and must NOT be modified!

If you need to pass application-specific data to a TTidy instance, use the AppData property instead.

Public property HeadNode: pTidyNode (read-only);

Returns the <head> node of the parsed document.

Public property HtmlNode: pTidyNode (read-only);

Returns the <html> node of the parsed document.

Public property InlineTags: string (read/write);

This option specifies new non-empty inline tags. This option takes a space or comma separated list of tag names.

In order to process a document with previously unknown tags, you must either declare new tags, set ForceOutput to True, or set AllowUnknownTags to True.

Public property InputCompleteCallback: tTidyInputCompleteCallback (read/write);

This callback will be called when TTidy completes loading the document, but before the parsing begins.

This can give you an opportunity to examine the document in its original state, before TidyLib repairs and reformats it.

It is mostly useful when reading from a file or stdin using the ParseFile() method.

Note that the InputCompleteCallback and the OnInputComplete event are mutually exclusive, that is, setting one will unset the other.

Public property NCR: bool (read/write);

This option specifies if Tidy should allow numeric character references.

Public property OutputBom: TidyTriState (read/write);

(Only for UTF-8 and UTF-16 output encodings.)

This option specifies if Tidy should write a Unicode Byte Order Mark character to the beginning of the output.

If set to TidyAuto, this option causes Tidy to write a BOM to the output only if a BOM was present at the beginning of the input.

A BOM is always written for XML/XHTML output using UTF-16 output encodings. (BOM; also known as Zero Width No-Break Space; has value of U+FEFF)

Public property ReportCallback: TidyReportFilter (read/write);

This function will be called whenever the library needs to display errors, warnings or other information while parsing the document.

Your callback function should match this prototype:

function( doc:TidyDoc; lvl:TidyReportLevel; line:uint; col:uint; mssg:ctmbstr ):Bool; cdecl;

Note:
TTidy assigns a "pointer-to-self" in the TidyDoc's opaque structure, using the library's tidySetAppData() function.
To retrieve the TTidy instance that invoked the callback, you can use:

  TTidy(tidyGetAppData(doc))

The ReportCallback property is generally useful for console-based applications.
If you need a component-based GUI-style event procedure, use the OnReport property instead.

Public property RootNode: pTidyNode (read-only);

Returns the root node of the parsed document.

Public property Status: LongInt (read-only);

Returns the error/warning state of the document after it has been parsed.

A value of zero means that TidyLib did not issue any errors or warnings, a value of one means there were warnings issued, and a value of two means that TidyLib issued error messages.

Public property Title: string (read-only);

The Text contained inside the <TITLE></TITLE> element of the parsed document.

Public property UserDoctype: string (read/write);

This option specifies the DOCTYPE declaration generated by Tidy.

  • If set to "omit" the output won't contain a DOCTYPE declaration.
  • If set to "auto" (the default) Tidy will use an educated guess based upon the contents of the document.
  • If set to "strict", Tidy will set the DOCTYPE to the strict DTD.
  • If set to "loose", the DOCTYPE is set to the loose (transitional) DTD.
Alternatively, you can supply a string for the formal public identifier (FPI).

For example:

    UserDoctype:='-//ACME//DTD HTML 3.14159//EN'

If you specify the FPI for an XHTML document, Tidy will set the system identifier to the empty string.

Tidy leaves the DOCTYPE for generic XML documents unchanged.

Public property WarningCount: uint (read-only);

Returns the number of warnings that the library encountered while parsing the document.

Public property XmlDecl: string (read-only);

Returns the XML declaration ( if found ) of the parsed document

Published property AccessibilityCheckLevel: uint (read/write);

Defines how strict the library will be when considering accessibility requirements for the document.

Acceptable values are 0, 1, 2, or 3, with zero being the "classic" mode that most veteran tidy users are accustomed to.

Higher settings will often reveal errors which require human intervention.

For example, there is no way that tidy can accurately generate header information for an html table.

Published property AddXmlDecl: bool (read/write);

This option specifies if Tidy should add the XML declaration when outputting XML or XHTML.

Note that if the input already includes an <?xml ... ?> declaration then this option will be ignored.

Published property AllowUnknownTags: boolean (read/write);

Setting this property to True will cause TTidy make a "first pass" over the document, storing a list of any tags that TidyLib does not recognize.

It will then add these to the list of tags that TidyLib will accept, and again try to parse the document.

Unknown tags found by this operation are considered inline, and are considered empty if no closing tag is found.

For greater control over the tags that tidy will accept, see the BlockTags, InlineTags and EmptyTags properties.

Published property AltText: string (read/write);

This option specifies the default "alt=" text Tidy uses for <IMG> attributes. This feature is dangerous as it suppresses further accessibility warnings.

You are responsible for making your documents accessible to people who can not see the images!

Published property AsciiChars: bool (read/write);

Can be used to modify behavior of the MakeClean property.

Defaults to True when using MakeClean.

If set to False, it will prevent converting &emdash;, &rdquo; and other named character entities to their ASCII equivalents.

Published property BodyOnly: bool (read/write);

This option specifies if Tidy should print only the contents of the body tag as an HTML fragment. Useful for incorporating existing whole pages as a portion of another page.

Published property BreakBeforeBR: bool (read/write);

This option specifies if Tidy should output a line break before each <BR> element.

Published property CharEncoding: TidyEncodingID (read/write);

This option specifies the character encoding Tidy uses for both the input and output.

  • For ascii, Tidy will accept Latin-1 (ISO-8859-1) character values, but will use entities for all characters whose value > 127.
  • For raw, Tidy will output values above 127 without translating them into entities.
  • For latin1, characters above 255 will be written as entities.
  • For utf8, Tidy assumes that both input and output is encoded as UTF-8.

You can use iso2022 for files encoded using the ISO-2022 family of encodings e.g. ISO-2022-JP. For mac and win1252, Tidy will accept vendor specific character values, but will use entities for all characters whose value > 127.

Acceptable values are:
TidyRaw, TidyASCII, TidyLatin1, TidyUTF8, TidyISO2022, TidyMacRoman, TidyWin1252, TidyUTF16le, TidyUTF16be, TidyUTF16, TidyBig5, TidyShiftJIS.

Published property Congruent: Boolean (read/write);

Setting Congruent to TRUE will cause TTidy to re-parse the output, in an attempt to make the output text consistent with the document tree.

This is needed to accurately reference the line and column index of the output text while traversing the nodes of the tree.

In the unlikely event that this fails, Congruent will be reset to FALSE.

Note that setting Congruent:=TRUE automatically sets Indent to Zero.

Published property DropEmptyParas: bool (read/write);

This option specifies if Tidy should discard empty paragraphs. If set to no, empty paragraphs are replaced by a pair of <BR> elements as HTML4 precludes empty paragraphs.

Published property DropFontTags: bool (read/write);

This option specifies if Tidy should discard <FONT> and <CENTER> tags rather than creating the corresponding style rules, but only if the clean option is also set to yes.

Published property DropPropAttrs: bool (read/write);

This option specifies if Tidy should strip out proprietary attributes, such as MS data binding attributes.

Published property DuplicateAttrs: TidyDupAttrModes (read/write);

This option specifies if Tidy should keep the first or last attribute, if an attribute is repeated, e.g. has two align attributes.

Published property Emacs: bool (read/write);

This option specifies if Tidy should change the format for reporting errors and warnings to a format that is more easily parsed by GNU Emacs.

Published property EncloseBlockText: bool (read/write);

This option specifies if Tidy should insert a <P> element to enclose any text it finds in any element that allows mixed content for HTML transitional but not HTML strict.

Published property EncloseBodyText: bool (read/write);

This option specifies if Tidy should enclose any text it finds in the body element within a <P> element. This is useful when you want to take existing HTML and use it with a style sheet.

Published property ErrorFile: string (read/write);

This option specifies the error file Tidy uses for errors and warnings.

Published property EscapeCdata: bool (read/write);

This option specifies if Tidy should convert <![CDATA[]]> sections to normal text.

Published property FixBackslash: bool (read/write);

This option specifies if Tidy should replace backslash characters "\" in URLs by forward slashes "/".

Published property FixComments: bool (read/write);

This option specifies if Tidy should replace unexpected hyphens with "=" characters when it comes across adjacent hyphens. The default is yes. This option is provided for users of Cold Fusion which uses the comment syntax: <!— —>

Published property FixUri: bool (read/write);

This option specifies if Tidy should check attribute values that carry URIsfor illegal characters and if such are found, escape them as HTML 4 recommends.

Published property ForceOutput: bool (read/write);

This option specifies if Tidy should produce output even if errors are encountered.

Use this option with care - if Tidy reports an error, this means Tidy was not able to, or is not sure how to, fix the error, so the resulting output may not reflect your intention.

Published property HideComments: bool (read/write);

This option specifies if Tidy should print out comments.

Published property HideEndTags: bool (read/write);

This option specifies if Tidy should omit optional end-tags when generating the pretty printed markup.

This option is ignored if you are outputting to XML.

Published property InCharEncoding: TidyEncodingID (read/write);

This option specifies the character encoding Tidy uses for the input.

See the CharEncoding property for more info.

Published property IndentAttributes: bool (read/write);

This option specifies if Tidy should begin each attribute on a new line.

Published property IndentCdata: bool (read/write);

This option specifies if Tidy should indent <![CDATA[]]> sections.

Published property Indent: Integer (read/write);

This option specifies how many spaces TidyLib should indent block-level tags.

If set to zero, the output will not be indented.

If set to a positive value , TidyLib will decide if it should indent content of tags such as TITLE, H1, LI, TD, or P, depending on whether or not the content includes a block-level element.

Setting to a negative value will force TidyLib to unconditionally indent content, but this might expose layout bugs in some browsers.

Published property JoinClasses: bool (read/write);

This option specifies if Tidy should combine class names to generate a single new class name, if multiple class assignments are detected on an element.

Published property JoinStyles: bool (read/write);

This option specifies if Tidy should combine styles to generate a single new style, if multiple style values are detected on an element.

Published property LiteralAttribs: bool (read/write);

This option specifies if Tidy should ensure that whitespace characters within attribute values are passed through unchanged.

Published property LogicalEmphasis: bool (read/write);

This option specifies if Tidy should replace any occurrence of <I> by <EM> and any occurrence of <B> by <STRONG>. In both cases, the attributes are preserved unchanged. This option can be set independently of the clean and drop-font-tags options.

Published property LowerLiterals: bool (read/write);

This option specifies if Tidy should convert the value of an attribute that takes a list of predefined values to lower case.

This is required for XHTML documents.

Published property MakeBare: bool (read/write);

This option specifies if Tidy should strip Microsoft specific HTML from Word 2000 documents, and output spaces rather than non-breaking spaces where they exist in the input.

Published property MakeClean: bool (read/write);

This option specifies if Tidy should strip out surplus presentational tags and attributes replacing them by style rules and structural markup as appropriate. It works well on the HTML saved by Microsoft Office products.

Published property Mark: bool (read/write);

This option specifies if Tidy should add a meta element to the document head to indicate that the document has been tidied. Tidy won't add a meta element if one is already present.

Published property MergeDivs: uint (read/write);

Can be used to modify behavior of the MakeClean option.

This option specifies if Tidy should merge nested <div> tags such as <div><div>...</div></div>.

If set to 0, the <div> tags will not be merged.

If set to 1, the attributes of the inner <div> are discarded with the exception of "class" and "style".

If set to 2, the attributes of the inner <div> are moved to the outer one. As well, nested <div> with ID attributes are not merged.

Published property MergeOrphanForms: boolean (read/write);

This property is used to control the way TTidy handles badly-nested form elements.

When the parent container of a <FORM> is closed before the form itself is closed, TidyLib will normally insert an implicit </FORM> tag to close the form, but this can sometimes result in some of the form's children becoming removed from the form.

When TidyLib later encounters these "orphaned" elements, such as <INPUT> tags, it will create a new <FORM> to adopt them.

This is contrary to the way most web browsers handle the same situation, and can sometimes result in a document which doesn't submit all the required data.

Setting MergeOrphanForms to True will cause TTidy to re-order and re-parse the document, in an attempt to re-unite the stray form elements with their original parent.

Published property Newline: TidyLineEnding (read/write);

This option controls the way TidyLib outputs line endings.

The default is system-dependent, but may be overridden by one of the following values:

  • TidyLF (Unix)
  • TidyCRLF (DOS)
  • TidyCR (Mac)

 

Published property NumEntities: bool (read/write);

This option specifies if Tidy should output entities other than the built-in HTML entities ( &amp; &lt; &gt; &quot; ) in the numeric rather than the named entity form.

Published property OnInputComplete: tTidyInputCompleteEvent (read/write);

This event will be fired when TTidy completes loading the document, but before the parsing begins.

This can give you an opportunity to examine the document in its original state, before TidyLib repairs and reformats it.

It is mostly useful when reading from a file or stdin using the ParseFile() method.

( If you use the ParseString() method, you will, of course, already know what the input looks like! )

Note that the OnInputComplete event and the InputCompleteCallback are mutually exclusive, that is, setting one will unset the other.

Published property OnReport: tTidyReportEvent (read/write);

This event will be fired whenever the library needs to display errors, warnings or other information while parsing the document.

This property is generally useful for component-based GUI-style applications.

If you need a console-based C-Style callback, use the ReportCallback property.

Published property OutCharEncoding: TidyEncodingID (read/write);

This option specifies the character encoding Tidy uses for the output.

May only be different from input-encoding for Latin encodings (ascii, latin1, mac, win1252).

See the CharEncoding property for more info.

Published property OutputMode: TidyOutputMode (read/write) published property PreScanScripts:Boolean (read/write);

This property specifies the type of output desired. The value should be set to one of:

  • omHTML: Output is HTML. This also causes Tidy to set the DOCTYPE as appropriate to the detected HTML version. The case of tags and attributes will be formatted according to the UpperCaseTags and UpperCaseAttrs properties.

  • omXML: Output is generic XML. Any entities not defined in XML 1.0 will be written as numeric entities to allow them to be parsed by a XML parser. The original case of tags and attributes will be preserved, regardless of other options.

  • omXHTML: Output is XHTML. This also causes Tidy to set the DOCTYPE and default namespace as appropriate to XHTML. If a DOCTYPE or namespace is given they will checked for consistency with the content of the document. In the case of an inconsistency, the corrected values will appear in the output. For XHTML, entities can be written as named or numeric entities according to the setting of the "numeric-entities" option. The original case of tags and attributes will be preserved, regardless of other options.

  • omAuto: The input will be pre-scanned in an attempt to determine the type of document, and the output will set to one of the modes described above. If the type of document cannot be determined, it will default to omHTML.

 

Published property PreTags: string (read/write);

This option specifies new tags that are to be processed in exactly the same way as an html <PRE> element.

This option takes a space or comma separated list of tag names.

In order to process a document with previously unknown tags, you must either declare new tags, set ForceOutput to True, or set AllowUnknownTags to True.

Note you can not as yet add new CDATA elements (similar to <SCRIPT>).

Published property PunctWrap: bool (read/write);

This option specifies if Tidy should line wrap after some Unicode or Chinese punctuation characters.

Published property Quiet: bool (read/write);

This option specifies if Tidy should output the summary of the numbers of errors and warnings, or the welcome or informational messages.

Published property QuoteAmpersand: bool (read/write);

This option specifies if Tidy should output unadorned & characters as &amp;.

Published property QuoteMarks: bool (read/write);

This option specifies if Tidy should output " characters as &quot; as is preferred by some editing environments.

The apostrophe character ' is written out as &#39; since many web browsers don't yet support &apos;.

Published property QuoteNbsp: bool (read/write);

This option specifies if Tidy should output non-breaking space characters as entities, rather than as the Unicode character value 160 (decimal).

Published property ReplaceColor: bool (read/write);

This option specifies if Tidy should replace numeric values in color attributes by HTML/XHTML color names where defined, e.g. replace #FFFFFF with "white".

Published property ShowErrors: uint (read/write);

This option specifies the number Tidy uses to determine if further errors should be shown. If set to 0, then no errors are shown.

Published property ShowMarkup: bool (read/write);

This option specifies if Tidy should generate a pretty printed version of the markup. Note that Tidy won't generate a pretty printed version if it finds significant errors (see force-output).

Published property ShowWarnings: bool (read/write);

This option specifies if Tidy should suppress warnings. This can be useful when a few errors are hidden in a flurry of warnings.

Published property TabSize: uint (read/write);

This option specifies the number of columns that Tidy uses between successive tab stops. It is used to map tabs to spaces when reading the input.

Tidy never outputs tabs.

Published property UpperCaseAttrs: bool (read/write);

This option specifies if Tidy should output attribute names in upper case.

The default is no, which results in lower case attribute names, except for XML input, where the original case is preserved.

Published property UpperCaseTags: bool (read/write);

This option specifies if Tidy should output tag names in upper case.

The default is no, which results in lower case tag names, except for XML input, where the original case is preserved.

Published property VertSpace: bool (read/write);

This option specifies if Tidy should add some empty lines for readability.

Published property Word2000: bool (read/write);

This option specifies if Tidy should go to great pains to strip out all the surplus stuff Microsoft Word 2000 inserts when you save Word documents as "Web pages".

Doesn't handle embedded images or VML.

Published property WrapAsp: bool (read/write);

This option specifies if Tidy should line wrap text contained within ASP pseudo elements, which look like: <% ... %>.

Published property WrapAttVals: bool (read/write);

This option specifies if Tidy should line wrap attribute values, for easier editing.

This option can be set independently of wrap-script-literals.

Published property WrapJste: bool (read/write);

This option specifies if Tidy should line wrap text contained within JSTE pseudo elements, which look like: <# ... #>.

Published property WrapLen: uint (read/write);

This option specifies the right margin Tidy uses for line wrapping. Tidy tries to wrap lines so that they do not exceed this length.

Set wrap to zero if you want to disable line wrapping.

Published property WrapPhp: bool (read/write);

This option specifies if Tidy should line wrap text contained within PHP pseudo elements, which look like: <?php ... ?>.

Published property WrapScriptlets: bool (read/write);

This option specifies if Tidy should line wrap string literals that appear in script attributes.

Tidy wraps long script string literals by inserting a backslash character before the line break.

Published property WrapSection: bool (read/write);

This option specifies if Tidy should line wrap text contained within <![ ... ]> section tags.

Published property XmlAutoDetect: Boolean (read/write);

This property controls whether TTidy should examine the document before handing it over to TdyLib, to try and determine if the document is XML, HTML, or XHTML. The heuristics it uses are documented at length in the GuessMarkupLanguage() function in the TidyPas sources.

Note that only works on plain ASCII documents.

Published property XmlPIs: bool (read/write);

This option specifies if Tidy should change the parsing of processing instructions to require ?> as the terminator rather than >.

This option is automatically set if the input is in XML.

Published property XmlSpace: bool (read/write);

This option specifies if Tidy should add xml:space="preserve" to elements such as <PRE>, <STYLE> and <SCRIPT> when generating XML.

This is needed if the whitespace in such elements is to be parsed appropriately without having access to the DTD.

Published property XmlTags: bool (read/write);

This option specifies if Tidy should use the XML parser rather than the error correcting HTML parser.


Generated by PasDoc 0.10.0 on 2005-12-23 21:07:56

Support This Project  
Get CurlPas and TidyPas at SourceForge.net. Fast, secure and Free Open Source software downloads