GoFiler Legato Script Reference
Legato v 1.5b Application v 5.24b
|
Table of Contents | < < Previous | Next >> |
Chapter Eleven — SGML Functions (continued)
Overview
The HTMLTidyCode function takes an input stream of HTML code and tidies the code for spacing and replacing tags.
Syntax/Parameters
Syntax
string = HTMLTidyCode ( handle hData | string data, dword options], [handle log] );
Parameters
hData or data
A handle to a SGML Object, Mapped Text or Edit Object. Or,
A string containing HTML code;
options
An optional dword specifying conformance flags. The default value is 0x00000000, see Remarks.
log
An optional handle to a Log Object to receive any errors or warnings.
Return Value
A string containing the conformed code, a message or an empty string on error. Use the GetLastError function to retrieve a formatted error code.
Remarks
The HTMLTidyCode function takes a source HTML code base and cleans it up. this is useful for code that is bunched up or basically a mess and not human readable. Tags can also be cleaned up and bad data removed. The function reads each tag and character entity and then optionally writes an adjusted version back to the output string. In addition, the code can be tidied for conformed line endings and width.
Errors are reported and optionally normalized. If a log is provided, errors and warnings are dumped to the log.
Flags are as follows:
SDK Definition | Bitwise | Description | |||||
General | |||||||
HTC_ALL_OPTIONS | 0x0000FFFF | All Options On | |||||
Tidy | |||||||
HTC_TIDY_CODE_BREAKS | 0x00000001 | Tidy Code Breaks (blocks) | |||||
HTC_TIDY_CODE_LINE_ENDINGS | 0x00000002 | Tidy Code Line Endings | |||||
HTC_TIDY_CODE_WRAP | 0x00000004 | Wrap the Code | |||||
HTML Errors | |||||||
HTC_REPORT_TAG_ERRORS | 0x00000010 | Report Tag Errors to Log | |||||
HTC_REPORT_CSS_ERRORS | 0x00000020 | Report CSS Errors to Log | |||||
HTML | |||||||
HTC_REWRITE_CODE | 0x00000040 | Rewrites Corrected Tags | |||||
HTC_REWRITE_CHAR_ENTITIES | 0x00000080 | Rewrite Character Entities | |||||
HTC_REWRITE_CASE_MASK | 0x00000300 | Tag Case Mask Tags | |||||
HTC_REWRITE_CASE_DTD | 0x00000000 | Case Matches DTD | |||||
HTC_REWRITE_CASE_UPPER | 0x00000100 | Case to Upper | |||||
HTC_REWRITE_CASE_LOWER | 0x00000200 | Case to Lower |
The DTD is read from the source file. If a DTD DOCTYPE is not present, the default is HTML 5.
Note that is the DTD is XML, tag case is determined by the DTD.
Related Functions
Platform Support
Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL
Legato IDE, Legato Basic
Table of Contents | < < Previous | Next >> |
© 2012-2024 Novaworks, LLC. All rights reserved worldwide. Unauthorized use, duplication or transmission prohibited by law. Portions of the software are protected by US Patents 10,095,672, 10,706,221 and 11,210,456. GoFiler™ and Legato™ are trademarks of Novaworks, LLC. EDGAR® is a federally registered trademark of the U.S. Securities and Exchange Commission. Novaworks is not affiliated with or approved by the U.S. Securities and Exchange Commission. All other trademarks are property of their respective owners. Use of the features specified in this language are subject to terms, conditions and limitations of the Software License Agreement.