diff --git a/Balthisar Tidy 0.60 Notes.txt b/Balthisar Tidy 0.60 Notes.txt new file mode 100644 index 00000000..d3689f3a --- /dev/null +++ b/Balthisar Tidy 0.60 Notes.txt @@ -0,0 +1,39 @@ +Version 0.60 - Universal Binary +19-November-2007 + + +CHANGES: +-------- +* I've hidden the Batch Mode window, since I've not implemented it yet anyway. +* I've added a text to the Batch button in the preferences window to indicate + that it doesn't really do anything yet. +* Upgrade the project file from "Project Builder" to "XCode 3.0." Yeah, + Balthisar Tidy really *is* that old, and yeah, I really *have* neglected it + for that much time. +* Compiled as a Universal Binary. + + +KNOWN ISSUES: +------------- +* I've not tested this extensively, so for guaranteed quality, stick with + the previous version 0.50. It's PPC only, but c'mon, it's small and runs + at virtually native speeds being that it's a pure Cocoa application. +* For some reason, typing into a blank source box will crash Balthisar Tidy. + You can still paste text into it, though. Honestly, because I've not gotten + batch mode working or written a service for Balthisar Tidy, pasting in the + old and copying the Tidy'd version is my personal preference. I'll consider + fixing this as time permits, because it's nice being able to type a single + word and having a full formed document appear! +* For some reason, Save As… for newly created documents (such as those pasted- + in) doesn't seem to do anything. If you open a document into Tidy, though, + it will Save As… okay. +* For some reason, Balthisar Tidy doesn't respect UTF-8 and maybe other text + encodings when opening a file. It does swell when you paste into the Tidy + source box, though. Honestly I don't know if this is new bad behavior or + if it's like this in version 0.50. I've learned a lot about file encodings + since then, so I'll get around to fixing it. In any case, if you use numeric + entities for all but the 7-bit ASCII set, you won't be affected. Personally, + I like UTF-8's ability to use my native Mac character set, and be assured that + the characters work on all platforms' browsers. + + diff --git a/Balthisar Tidy.pbproj/project.pbxproj b/Balthisar Tidy.pbproj/project.pbxproj deleted file mode 100755 index 667e0daa..00000000 --- a/Balthisar Tidy.pbproj/project.pbxproj +++ /dev/null @@ -1,1362 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 38; - objects = { - 080E96DAFE201CDB7F000001 = { - fileRef = 2A37F4B6FDCFA73011CA2CEA; - isa = PBXBuildFile; - settings = { - }; - }; - 080E96DBFE201CDB7F000001 = { - fileRef = 2A37F4B4FDCFA73011CA2CEA; - isa = PBXBuildFile; - settings = { - }; - }; - 089C165FFE840EACC02AAC07 = { - children = ( - 089C1660FE840EACC02AAC07, - ); - isa = PBXVariantGroup; - name = InfoPlist.strings; - refType = 4; - }; - 089C1660FE840EACC02AAC07 = { - fileEncoding = 10; - isa = PBXFileReference; - name = English; - path = English.lproj/InfoPlist.strings; - refType = 4; - }; - 089C1661FE840EACC02AAC07 = { - fileRef = 089C165FFE840EACC02AAC07; - isa = PBXBuildFile; - settings = { - }; - }; -//080 -//081 -//082 -//083 -//084 -//100 -//101 -//102 -//103 -//104 - 1058C7A6FEA54F5311CA2CBB = { - children = ( - 1058C7A7FEA54F5311CA2CBB, - ); - isa = PBXGroup; - name = "Linked Frameworks"; - refType = 4; - }; - 1058C7A7FEA54F5311CA2CBB = { - isa = PBXFrameworkReference; - name = Cocoa.framework; - path = /System/Library/Frameworks/Cocoa.framework; - refType = 0; - }; - 1058C7A8FEA54F5311CA2CBB = { - children = ( - 2A37F4C5FDCFA73011CA2CEA, - 2A37F4C4FDCFA73011CA2CEA, - ); - isa = PBXGroup; - name = "Other Frameworks"; - refType = 4; - }; - 1058C7A9FEA54F5311CA2CBB = { - fileRef = 1058C7A7FEA54F5311CA2CBB; - isa = PBXBuildFile; - settings = { - }; - }; -//100 -//101 -//102 -//103 -//104 -//170 -//171 -//172 -//173 -//174 - 1758732AFF379DA111CA2CBB = { - isa = PBXApplicationReference; - path = "Balthisar Tidy.app"; - refType = 3; - }; -//170 -//171 -//172 -//173 -//174 -//190 -//191 -//192 -//193 -//194 - 19C28FB0FE9D524F11CA2CBB = { - children = ( - 1758732AFF379DA111CA2CBB, - ); - isa = PBXGroup; - name = Products; - refType = 4; - }; -//190 -//191 -//192 -//193 -//194 -//2A0 -//2A1 -//2A2 -//2A3 -//2A4 - 2A37F4A9FDCFA73011CA2CEA = { - buildStyles = ( - 4A9504D0FFE6A4CB11CA0CBA, - 4A9504D1FFE6A4CB11CA0CBA, - ); - isa = PBXProject; - mainGroup = 2A37F4AAFDCFA73011CA2CEA; - projectDirPath = ""; - targets = ( - 2A37F4C6FDCFA73011CA2CEA, - ); - }; - 2A37F4AAFDCFA73011CA2CEA = { - children = ( - 2A37F4ABFDCFA73011CA2CEA, - 2A37F4AFFDCFA73011CA2CEA, - 2A37F4B8FDCFA73011CA2CEA, - 2A37F4C3FDCFA73011CA2CEA, - 19C28FB0FE9D524F11CA2CBB, - ); - isa = PBXGroup; - name = "Balthisar Tidy"; - path = ""; - refType = 4; - }; - 2A37F4ABFDCFA73011CA2CEA = { - children = ( - F5BD14FD0368BA4E01A80166, - F5BD14FE0368BA4E01A80166, - F5FE7E94037595EB01A80165, - F5FE7E95037595EB01A80165, - 2A37F4AEFDCFA73011CA2CEA, - F5BD15110368C33901A80166, - F5FE7E90037595DC01A80165, - F5FE7E91037595DC01A80165, - F5CCB4830364D33301A80165, - F5CCB4840364D33301A80165, - F5CEFEC3037B441A01A80166, - F5CEFEC4037B441A01A80166, - F5E425A8039A983701A80165, - F5E425A9039A983701A80165, - ); - isa = PBXGroup; - name = Classes; - path = ""; - refType = 4; - }; - 2A37F4AEFDCFA73011CA2CEA = { - fileEncoding = 30; - isa = PBXFileReference; - name = MyDocument.h; - path = Classes/MyDocument.h; - refType = 4; - }; - 2A37F4AFFDCFA73011CA2CEA = { - children = ( - F5CCB4250364D26D01A80165, - 2A37F4B0FDCFA73011CA2CEA, - ); - isa = PBXGroup; - name = "Other Sources"; - path = ""; - refType = 4; - }; - 2A37F4B0FDCFA73011CA2CEA = { - fileEncoding = 30; - isa = PBXFileReference; - path = main.m; - refType = 4; - }; - 2A37F4B4FDCFA73011CA2CEA = { - children = ( - 2A37F4B5FDCFA73011CA2CEA, - ); - isa = PBXVariantGroup; - name = MyDocument.nib; - path = ""; - refType = 4; - }; - 2A37F4B5FDCFA73011CA2CEA = { - isa = PBXFileReference; - name = English; - path = English.lproj/MyDocument.nib; - refType = 4; - }; - 2A37F4B6FDCFA73011CA2CEA = { - children = ( - 2A37F4B7FDCFA73011CA2CEA, - ); - isa = PBXVariantGroup; - name = MainMenu.nib; - path = ""; - refType = 4; - }; - 2A37F4B7FDCFA73011CA2CEA = { - isa = PBXFileReference; - name = English; - path = English.lproj/MainMenu.nib; - refType = 4; - }; - 2A37F4B8FDCFA73011CA2CEA = { - children = ( - F56A531C0378639001A80165, - F5FE7EAB03759E8D01A80165, - F57707310371F19101A80165, - 2A37F4B6FDCFA73011CA2CEA, - 2A37F4B4FDCFA73011CA2CEA, - F5D1B574036AF40C01A80165, - F5D1B577036AF44801A80165, - 089C165FFE840EACC02AAC07, - ); - isa = PBXGroup; - name = Resources; - path = ""; - refType = 4; - }; - 2A37F4C3FDCFA73011CA2CEA = { - children = ( - 1058C7A6FEA54F5311CA2CBB, - 1058C7A8FEA54F5311CA2CBB, - ); - isa = PBXGroup; - name = Frameworks; - path = ""; - refType = 4; - }; - 2A37F4C4FDCFA73011CA2CEA = { - isa = PBXFrameworkReference; - name = AppKit.framework; - path = /System/Library/Frameworks/AppKit.framework; - refType = 0; - }; - 2A37F4C5FDCFA73011CA2CEA = { - isa = PBXFrameworkReference; - name = Foundation.framework; - path = /System/Library/Frameworks/Foundation.framework; - refType = 0; - }; - 2A37F4C6FDCFA73011CA2CEA = { - buildPhases = ( - 2A37F4C7FDCFA73011CA2CEA, - 2A37F4C9FDCFA73011CA2CEA, - 2A37F4CEFDCFA73011CA2CEA, - 2A37F4D1FDCFA73011CA2CEA, - ); - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ""; - HEADER_SEARCH_PATHS = ""; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ""; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - PRODUCT_NAME = "Balthisar Tidy"; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; - WRAPPER_EXTENSION = app; - }; - dependencies = ( - ); - isa = PBXApplicationTarget; - name = "Balthisar Tidy"; - productInstallPath = "$(HOME)/Applications"; - productName = "Balthisar Tidy"; - productReference = 1758732AFF379DA111CA2CBB; - productSettingsXML = " - - - - CFBundleDevelopmentRegion - English - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - html - HTML - - CFBundleTypeIconFile - iconhtml - CFBundleTypeName - HTML File - CFBundleTypeOSTypes - - TEXT - - CFBundleTypeRole - Editor - NSDocumentClass - MyDocument - - - CFBundleTypeExtensions - - htm - HTM - - CFBundleTypeIconFile - iconhtm - CFBundleTypeName - HTM File (DOS extension) - CFBundleTypeOSTypes - - TEXT - - CFBundleTypeRole - Editor - NSDocumentClass - MyDocument - - - CFBundleTypeExtensions - - php - PHP - - CFBundleTypeIconFile - iconphp - CFBundleTypeName - PHP File (PHP HTML File) - CFBundleTypeOSTypes - - TEXT - - CFBundleTypeRole - Editor - NSDocumentClass - MyDocument - - - CFBundleExecutable - Balthisar Tidy - CFBundleGetInfoString - Balthisar Tidy - CFBundleHelpBookFolder - Balthisar Tidy Help - CFBundleHelpBookName - Balthisar Tidy Help - CFBundleIconFile - iconbroom - CFBundleIdentifier - com.balthisar.balthisartidy - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Balthisar Tidy - CFBundlePackageType - APPL - CFBundleShortVersionString - v0.1 (0100) - CFBundleSignature - WWS2 - CFBundleVersion - 0100 - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - -"; - shouldUseHeadermap = 1; - }; - 2A37F4C7FDCFA73011CA2CEA = { - buildActionMask = 2147483647; - files = ( - 2A37F4C8FDCFA73011CA2CEA, - F5CCB4580364D26D01A80165, - F5CCB4590364D26D01A80165, - F5CCB45A0364D26D01A80165, - F5CCB45B0364D26D01A80165, - F5CCB45C0364D26D01A80165, - F5CCB45E0364D26D01A80165, - F5CCB4630364D26D01A80165, - F5CCB4660364D26D01A80165, - F5CCB4680364D26D01A80165, - F5CCB46A0364D26D01A80165, - F5CCB46C0364D26D01A80165, - F5CCB46F0364D26D01A80165, - F5CCB4710364D26D01A80165, - F5CCB4730364D26D01A80165, - F5CCB4750364D26D01A80165, - F5CCB4770364D26D01A80165, - F5CCB47A0364D26D01A80165, - F5CCB47B0364D26D01A80165, - F5CCB47E0364D26D01A80165, - F5CCB4800364D26D01A80165, - F5CCB4850364D33301A80165, - F5BD14FF0368BA4E01A80166, - F5FE7E92037595DC01A80165, - F5FE7E96037595EB01A80165, - F5CEFEC5037B441A01A80166, - F504CED603AFF8E701A80166, - ); - isa = PBXHeadersBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 2A37F4C8FDCFA73011CA2CEA = { - fileRef = 2A37F4AEFDCFA73011CA2CEA; - isa = PBXBuildFile; - settings = { - }; - }; - 2A37F4C9FDCFA73011CA2CEA = { - buildActionMask = 2147483647; - files = ( - 080E96DAFE201CDB7F000001, - 080E96DBFE201CDB7F000001, - 089C1661FE840EACC02AAC07, - F5D1B576036AF40C01A80165, - F5D1B579036AF44801A80165, - F5BBA0420371F6C401A80165, - F5BBA0430371F6C401A80165, - F5BBA0440371F6C401A80165, - F5BBA0450371F6C401A80165, - F5FE7EAE03759E8D01A80165, - F56A531E0378639001A80165, - ); - isa = PBXResourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 2A37F4CEFDCFA73011CA2CEA = { - buildActionMask = 2147483647; - files = ( - F5CCB45D0364D26D01A80165, - F5CCB45F0364D26D01A80165, - F5CCB4600364D26D01A80165, - F5CCB4610364D26D01A80165, - F5CCB4620364D26D01A80165, - F5CCB4640364D26D01A80165, - F5CCB4650364D26D01A80165, - F5CCB4670364D26D01A80165, - F5CCB4690364D26D01A80165, - F5CCB46B0364D26D01A80165, - F5CCB46D0364D26D01A80165, - F5CCB46E0364D26D01A80165, - F5CCB4700364D26D01A80165, - F5CCB4720364D26D01A80165, - F5CCB4740364D26D01A80165, - F5CCB4760364D26D01A80165, - F5CCB4780364D26D01A80165, - F5CCB4790364D26D01A80165, - F5CCB47C0364D26D01A80165, - F5CCB47D0364D26D01A80165, - F5CCB47F0364D26D01A80165, - F5CCB4860364D33301A80165, - F5BD15000368BA4E01A80166, - F5BD15120368C33901A80166, - F5FE7E93037595DC01A80165, - F5FE7E97037595EB01A80165, - F5CEFEC6037B441A01A80166, - F561F6B903A6B34B01A80166, - F504CED703AFF8E801A80166, - ); - isa = PBXSourcesBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; - 2A37F4D1FDCFA73011CA2CEA = { - buildActionMask = 2147483647; - files = ( - 1058C7A9FEA54F5311CA2CBB, - ); - isa = PBXFrameworksBuildPhase; - runOnlyForDeploymentPostprocessing = 0; - }; -//2A0 -//2A1 -//2A2 -//2A3 -//2A4 -//4A0 -//4A1 -//4A2 -//4A3 -//4A4 - 4A9504D0FFE6A4CB11CA0CBA = { - buildRules = ( - ); - buildSettings = { - COPY_PHASE_STRIP = NO; - OPTIMIZATION_CFLAGS = "-O0"; - }; - isa = PBXBuildStyle; - name = Development; - }; - 4A9504D1FFE6A4CB11CA0CBA = { - buildRules = ( - ); - buildSettings = { - COPY_PHASE_STRIP = YES; - }; - isa = PBXBuildStyle; - name = Deployment; - }; -//4A0 -//4A1 -//4A2 -//4A3 -//4A4 -//F50 -//F51 -//F52 -//F53 -//F54 - F504CED603AFF8E701A80166 = { - fileRef = F5E425A8039A983701A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F504CED703AFF8E801A80166 = { - fileRef = F5E425A9039A983701A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F561F6B903A6B34B01A80166 = { - fileRef = 2A37F4B0FDCFA73011CA2CEA; - isa = PBXBuildFile; - settings = { - }; - }; - F56A531C0378639001A80165 = { - children = ( - F56A531D0378639001A80165, - ); - isa = PBXVariantGroup; - name = Localizable.strings; - path = ""; - refType = 4; - }; - F56A531D0378639001A80165 = { - fileEncoding = 10; - isa = PBXFileReference; - name = English; - path = English.lproj/Localizable.strings; - refType = 4; - }; - F56A531E0378639001A80165 = { - fileRef = F56A531C0378639001A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F57707310371F19101A80165 = { - children = ( - F5BBA03E0371F6C401A80165, - F5BBA03F0371F6C401A80165, - F5BBA0400371F6C401A80165, - F5BBA0410371F6C401A80165, - ); - isa = PBXGroup; - name = icons; - refType = 4; - }; - F5BBA03E0371F6C401A80165 = { - isa = PBXFileReference; - name = iconbroom.icns; - path = "Graphics, Included/iconbroom.icns"; - refType = 4; - }; - F5BBA03F0371F6C401A80165 = { - isa = PBXFileReference; - name = iconhtm.icns; - path = "Graphics, Included/iconhtm.icns"; - refType = 4; - }; - F5BBA0400371F6C401A80165 = { - isa = PBXFileReference; - name = iconhtml.icns; - path = "Graphics, Included/iconhtml.icns"; - refType = 4; - }; - F5BBA0410371F6C401A80165 = { - isa = PBXFileReference; - name = iconphp.icns; - path = "Graphics, Included/iconphp.icns"; - refType = 4; - }; - F5BBA0420371F6C401A80165 = { - fileRef = F5BBA03E0371F6C401A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5BBA0430371F6C401A80165 = { - fileRef = F5BBA03F0371F6C401A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5BBA0440371F6C401A80165 = { - fileRef = F5BBA0400371F6C401A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5BBA0450371F6C401A80165 = { - fileRef = F5BBA0410371F6C401A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5BD14FD0368BA4E01A80166 = { - isa = PBXFileReference; - name = AppController.h; - path = Classes/AppController.h; - refType = 4; - }; - F5BD14FE0368BA4E01A80166 = { - isa = PBXFileReference; - name = AppController.m; - path = Classes/AppController.m; - refType = 4; - }; - F5BD14FF0368BA4E01A80166 = { - fileRef = F5BD14FD0368BA4E01A80166; - isa = PBXBuildFile; - settings = { - }; - }; - F5BD15000368BA4E01A80166 = { - fileRef = F5BD14FE0368BA4E01A80166; - isa = PBXBuildFile; - settings = { - }; - }; - F5BD15110368C33901A80166 = { - isa = PBXFileReference; - name = MyDocument.m; - path = Classes/MyDocument.m; - refType = 4; - }; - F5BD15120368C33901A80166 = { - fileRef = F5BD15110368C33901A80166; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4250364D26D01A80165 = { - children = ( - F5CCB4270364D26D01A80165, - F5CCB42A0364D26D01A80165, - F5CCB4300364D26D01A80165, - ); - isa = PBXGroup; - path = "tidylib-src"; - refType = 4; - }; - F5CCB4270364D26D01A80165 = { - children = ( - F5CCB4280364D26D01A80165, - F5CCB4290364D26D01A80165, - ); - isa = PBXGroup; - path = console; - refType = 4; - }; - F5CCB4280364D26D01A80165 = { - isa = PBXFileReference; - path = tab2space.c; - refType = 4; - }; - F5CCB4290364D26D01A80165 = { - isa = PBXFileReference; - path = tidy.c; - refType = 4; - }; - F5CCB42A0364D26D01A80165 = { - children = ( - F5CCB42B0364D26D01A80165, - F5CCB42C0364D26D01A80165, - F5CCB42D0364D26D01A80165, - F5CCB42E0364D26D01A80165, - F5CCB42F0364D26D01A80165, - ); - isa = PBXGroup; - path = include; - refType = 4; - }; - F5CCB42B0364D26D01A80165 = { - isa = PBXFileReference; - path = buffio.h; - refType = 4; - }; - F5CCB42C0364D26D01A80165 = { - isa = PBXFileReference; - path = fileio.h; - refType = 4; - }; - F5CCB42D0364D26D01A80165 = { - isa = PBXFileReference; - path = platform.h; - refType = 4; - }; - F5CCB42E0364D26D01A80165 = { - isa = PBXFileReference; - path = tidy.h; - refType = 4; - }; - F5CCB42F0364D26D01A80165 = { - isa = PBXFileReference; - path = tidyenum.h; - refType = 4; - }; - F5CCB4300364D26D01A80165 = { - children = ( - F5CCB4310364D26D01A80165, - F5CCB4320364D26D01A80165, - F5CCB4330364D26D01A80165, - F5CCB4340364D26D01A80165, - F5CCB4350364D26D01A80165, - F5CCB4360364D26D01A80165, - F5CCB4370364D26D01A80165, - F5CCB4380364D26D01A80165, - F5CCB4390364D26D01A80165, - F5CCB43A0364D26D01A80165, - F5CCB43B0364D26D01A80165, - F5CCB43C0364D26D01A80165, - F5CCB43D0364D26D01A80165, - F5CCB43E0364D26D01A80165, - F5CCB43F0364D26D01A80165, - F5CCB4400364D26D01A80165, - F5CCB4410364D26D01A80165, - F5CCB4420364D26D01A80165, - F5CCB4430364D26D01A80165, - F5CCB4440364D26D01A80165, - F5CCB4450364D26D01A80165, - F5CCB4460364D26D01A80165, - F5CCB4470364D26D01A80165, - F5CCB4480364D26D01A80165, - F5CCB4490364D26D01A80165, - F5CCB44A0364D26D01A80165, - F5CCB44B0364D26D01A80165, - F5CCB44C0364D26D01A80165, - F5CCB44D0364D26D01A80165, - F5CCB44E0364D26D01A80165, - F5CCB44F0364D26D01A80165, - F5CCB4500364D26D01A80165, - F5CCB4510364D26D01A80165, - F5CCB4520364D26D01A80165, - F5CCB4530364D26D01A80165, - F5CCB4540364D26D01A80165, - ); - isa = PBXGroup; - path = src; - refType = 4; - }; - F5CCB4310364D26D01A80165 = { - isa = PBXFileReference; - path = access.c; - refType = 4; - }; - F5CCB4320364D26D01A80165 = { - isa = PBXFileReference; - path = access.h; - refType = 4; - }; - F5CCB4330364D26D01A80165 = { - isa = PBXFileReference; - path = alloc.c; - refType = 4; - }; - F5CCB4340364D26D01A80165 = { - isa = PBXFileReference; - path = attrask.c; - refType = 4; - }; - F5CCB4350364D26D01A80165 = { - isa = PBXFileReference; - path = attrget.c; - refType = 4; - }; - F5CCB4360364D26D01A80165 = { - isa = PBXFileReference; - path = attrs.c; - refType = 4; - }; - F5CCB4370364D26D01A80165 = { - isa = PBXFileReference; - path = attrs.h; - refType = 4; - }; - F5CCB4380364D26D01A80165 = { - isa = PBXFileReference; - path = buffio.c; - refType = 4; - }; - F5CCB4390364D26D01A80165 = { - isa = PBXFileReference; - path = clean.c; - refType = 4; - }; - F5CCB43A0364D26D01A80165 = { - isa = PBXFileReference; - path = clean.h; - refType = 4; - }; - F5CCB43B0364D26D01A80165 = { - isa = PBXFileReference; - path = config.c; - refType = 4; - }; - F5CCB43C0364D26D01A80165 = { - isa = PBXFileReference; - path = config.h; - refType = 4; - }; - F5CCB43D0364D26D01A80165 = { - isa = PBXFileReference; - path = entities.c; - refType = 4; - }; - F5CCB43E0364D26D01A80165 = { - isa = PBXFileReference; - path = entities.h; - refType = 4; - }; - F5CCB43F0364D26D01A80165 = { - isa = PBXFileReference; - path = fileio.c; - refType = 4; - }; - F5CCB4400364D26D01A80165 = { - isa = PBXFileReference; - path = forward.h; - refType = 4; - }; - F5CCB4410364D26D01A80165 = { - isa = PBXFileReference; - path = istack.c; - refType = 4; - }; - F5CCB4420364D26D01A80165 = { - isa = PBXFileReference; - path = lexer.c; - refType = 4; - }; - F5CCB4430364D26D01A80165 = { - isa = PBXFileReference; - path = lexer.h; - refType = 4; - }; - F5CCB4440364D26D01A80165 = { - isa = PBXFileReference; - path = localize.c; - refType = 4; - }; - F5CCB4450364D26D01A80165 = { - isa = PBXFileReference; - path = message.h; - refType = 4; - }; - F5CCB4460364D26D01A80165 = { - isa = PBXFileReference; - path = parser.c; - refType = 4; - }; - F5CCB4470364D26D01A80165 = { - isa = PBXFileReference; - path = parser.h; - refType = 4; - }; - F5CCB4480364D26D01A80165 = { - isa = PBXFileReference; - path = pprint.c; - refType = 4; - }; - F5CCB4490364D26D01A80165 = { - isa = PBXFileReference; - path = pprint.h; - refType = 4; - }; - F5CCB44A0364D26D01A80165 = { - isa = PBXFileReference; - path = streamio.c; - refType = 4; - }; - F5CCB44B0364D26D01A80165 = { - isa = PBXFileReference; - path = streamio.h; - refType = 4; - }; - F5CCB44C0364D26D01A80165 = { - isa = PBXFileReference; - path = tagask.c; - refType = 4; - }; - F5CCB44D0364D26D01A80165 = { - isa = PBXFileReference; - path = tags.c; - refType = 4; - }; - F5CCB44E0364D26D01A80165 = { - isa = PBXFileReference; - path = tags.h; - refType = 4; - }; - F5CCB44F0364D26D01A80165 = { - isa = PBXFileReference; - path = "tidy-int.h"; - refType = 4; - }; - F5CCB4500364D26D01A80165 = { - isa = PBXFileReference; - path = tidylib.c; - refType = 4; - }; - F5CCB4510364D26D01A80165 = { - isa = PBXFileReference; - path = tmbstr.c; - refType = 4; - }; - F5CCB4520364D26D01A80165 = { - isa = PBXFileReference; - path = tmbstr.h; - refType = 4; - }; - F5CCB4530364D26D01A80165 = { - isa = PBXFileReference; - path = utf8.c; - refType = 4; - }; - F5CCB4540364D26D01A80165 = { - isa = PBXFileReference; - path = utf8.h; - refType = 4; - }; - F5CCB4580364D26D01A80165 = { - fileRef = F5CCB42B0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4590364D26D01A80165 = { - fileRef = F5CCB42C0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB45A0364D26D01A80165 = { - fileRef = F5CCB42D0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB45B0364D26D01A80165 = { - fileRef = F5CCB42E0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB45C0364D26D01A80165 = { - fileRef = F5CCB42F0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB45D0364D26D01A80165 = { - fileRef = F5CCB4310364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB45E0364D26D01A80165 = { - fileRef = F5CCB4320364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB45F0364D26D01A80165 = { - fileRef = F5CCB4330364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4600364D26D01A80165 = { - fileRef = F5CCB4340364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4610364D26D01A80165 = { - fileRef = F5CCB4350364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4620364D26D01A80165 = { - fileRef = F5CCB4360364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4630364D26D01A80165 = { - fileRef = F5CCB4370364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4640364D26D01A80165 = { - fileRef = F5CCB4380364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4650364D26D01A80165 = { - fileRef = F5CCB4390364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4660364D26D01A80165 = { - fileRef = F5CCB43A0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4670364D26D01A80165 = { - fileRef = F5CCB43B0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4680364D26D01A80165 = { - fileRef = F5CCB43C0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4690364D26D01A80165 = { - fileRef = F5CCB43D0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB46A0364D26D01A80165 = { - fileRef = F5CCB43E0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB46B0364D26D01A80165 = { - fileRef = F5CCB43F0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB46C0364D26D01A80165 = { - fileRef = F5CCB4400364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB46D0364D26D01A80165 = { - fileRef = F5CCB4410364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB46E0364D26D01A80165 = { - fileRef = F5CCB4420364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB46F0364D26D01A80165 = { - fileRef = F5CCB4430364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4700364D26D01A80165 = { - fileRef = F5CCB4440364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4710364D26D01A80165 = { - fileRef = F5CCB4450364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4720364D26D01A80165 = { - fileRef = F5CCB4460364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4730364D26D01A80165 = { - fileRef = F5CCB4470364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4740364D26D01A80165 = { - fileRef = F5CCB4480364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4750364D26D01A80165 = { - fileRef = F5CCB4490364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4760364D26D01A80165 = { - fileRef = F5CCB44A0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4770364D26D01A80165 = { - fileRef = F5CCB44B0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4780364D26D01A80165 = { - fileRef = F5CCB44C0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4790364D26D01A80165 = { - fileRef = F5CCB44D0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB47A0364D26D01A80165 = { - fileRef = F5CCB44E0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB47B0364D26D01A80165 = { - fileRef = F5CCB44F0364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB47C0364D26D01A80165 = { - fileRef = F5CCB4500364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB47D0364D26D01A80165 = { - fileRef = F5CCB4510364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB47E0364D26D01A80165 = { - fileRef = F5CCB4520364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB47F0364D26D01A80165 = { - fileRef = F5CCB4530364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4800364D26D01A80165 = { - fileRef = F5CCB4540364D26D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4830364D33301A80165 = { - isa = PBXFileReference; - name = CocoaTidy.h; - path = Classes/CocoaTidy.h; - refType = 4; - }; - F5CCB4840364D33301A80165 = { - isa = PBXFileReference; - name = CocoaTidy.m; - path = Classes/CocoaTidy.m; - refType = 4; - }; - F5CCB4850364D33301A80165 = { - fileRef = F5CCB4830364D33301A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CCB4860364D33301A80165 = { - fileRef = F5CCB4840364D33301A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5CEFEC3037B441A01A80166 = { - isa = PBXFileReference; - name = TreeNode.h; - path = Classes/TreeNode.h; - refType = 4; - }; - F5CEFEC4037B441A01A80166 = { - isa = PBXFileReference; - name = TreeNode.m; - path = Classes/TreeNode.m; - refType = 4; - }; - F5CEFEC5037B441A01A80166 = { - fileRef = F5CEFEC3037B441A01A80166; - isa = PBXBuildFile; - settings = { - }; - }; - F5CEFEC6037B441A01A80166 = { - fileRef = F5CEFEC4037B441A01A80166; - isa = PBXBuildFile; - settings = { - }; - }; - F5D1B574036AF40C01A80165 = { - children = ( - F5D1B575036AF40C01A80165, - ); - isa = PBXVariantGroup; - name = Batch.nib; - path = ""; - refType = 4; - }; - F5D1B575036AF40C01A80165 = { - isa = PBXFileReference; - name = English; - path = English.lproj/Batch.nib; - refType = 4; - }; - F5D1B576036AF40C01A80165 = { - fileRef = F5D1B574036AF40C01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5D1B577036AF44801A80165 = { - children = ( - F5D1B578036AF44801A80165, - ); - isa = PBXVariantGroup; - name = Preferences.nib; - path = ""; - refType = 4; - }; - F5D1B578036AF44801A80165 = { - isa = PBXFileReference; - name = English; - path = English.lproj/Preferences.nib; - refType = 4; - }; - F5D1B579036AF44801A80165 = { - fileRef = F5D1B577036AF44801A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5E425A8039A983701A80165 = { - isa = PBXFileReference; - name = JSDTidy.h; - path = Classes/JSDTidy.h; - refType = 4; - }; - F5E425A9039A983701A80165 = { - isa = PBXFileReference; - name = JSDTidy.m; - path = Classes/JSDTidy.m; - refType = 4; - }; - F5FE7E90037595DC01A80165 = { - isa = PBXFileReference; - name = PreferenceController.h; - path = Classes/PreferenceController.h; - refType = 4; - }; - F5FE7E91037595DC01A80165 = { - isa = PBXFileReference; - name = PreferenceController.m; - path = Classes/PreferenceController.m; - refType = 4; - }; - F5FE7E92037595DC01A80165 = { - fileRef = F5FE7E90037595DC01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5FE7E93037595DC01A80165 = { - fileRef = F5FE7E91037595DC01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5FE7E94037595EB01A80165 = { - isa = PBXFileReference; - name = BatchController.h; - path = Classes/BatchController.h; - refType = 4; - }; - F5FE7E95037595EB01A80165 = { - isa = PBXFileReference; - name = BatchController.m; - path = Classes/BatchController.m; - refType = 4; - }; - F5FE7E96037595EB01A80165 = { - fileRef = F5FE7E94037595EB01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5FE7E97037595EB01A80165 = { - fileRef = F5FE7E95037595EB01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - F5FE7EAB03759E8D01A80165 = { - includeInIndex = 1; - isa = PBXFolderReference; - name = "Balthisar Tidy Help"; - path = "/Users/jderry/Development/Balthisar Tidy Help folder/Balthisar Tidy Help"; - refType = 0; - }; - F5FE7EAE03759E8D01A80165 = { - fileRef = F5FE7EAB03759E8D01A80165; - isa = PBXBuildFile; - settings = { - }; - }; - }; - rootObject = 2A37F4A9FDCFA73011CA2CEA; -} diff --git a/Balthisar Tidy.plist b/Balthisar Tidy.plist new file mode 100644 index 00000000..6d2a8f45 --- /dev/null +++ b/Balthisar Tidy.plist @@ -0,0 +1,96 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + html + HTML + + CFBundleTypeIconFile + iconhtml + CFBundleTypeName + HTML File + CFBundleTypeOSTypes + + TEXT + + CFBundleTypeRole + Editor + NSDocumentClass + TidyDocument + + + CFBundleTypeExtensions + + htm + HTM + + CFBundleTypeIconFile + iconhtm + CFBundleTypeName + HTM File (DOS extension) + CFBundleTypeOSTypes + + TEXT + + CFBundleTypeRole + Editor + NSDocumentClass + TidyDocument + + + CFBundleTypeExtensions + + php + PHP + + CFBundleTypeIconFile + iconphp + CFBundleTypeName + PHP File (PHP HTML File) + CFBundleTypeOSTypes + + TEXT + + CFBundleTypeRole + Editor + NSDocumentClass + TidyDocument + + + CFBundleExecutable + Balthisar Tidy + CFBundleGetInfoString + Balthisar Tidy + CFBundleHelpBookFolder + Balthisar Tidy Help + CFBundleHelpBookName + Balthisar Tidy Help + CFBundleIconFile + iconbroom + CFBundleIdentifier + com.balthisar.balthisartidy + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + Balthisar Tidy + CFBundlePackageType + APPL + CFBundleShortVersionString + 0.6 + CFBundleSignature + WWS2 + CFBundleVersion + 0.6 + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/Balthisar Tidy.xcodeproj/jderry.mode1 b/Balthisar Tidy.xcodeproj/jderry.mode1 old mode 100755 new mode 100644 index 793a7698..19e430b1 --- a/Balthisar Tidy.xcodeproj/jderry.mode1 +++ b/Balthisar Tidy.xcodeproj/jderry.mode1 @@ -1,5 +1,5 @@ - + ActivePerspectiveName @@ -166,7 +166,7 @@ FavBarConfig PBXProjectModuleGUID - D0A2AA180B518B620070328A + D012CD3D0CF2403E00194990 XCBarModuleItemNames XCBarModuleItems @@ -245,7 +245,7 @@ PBXSmartGroupTreeModuleColumnWidthsKey - 258 + 186 PBXSmartGroupTreeModuleColumnsKey_v4 @@ -257,11 +257,6 @@ PBXSmartGroupTreeModuleOutlineStateExpansionKey 2A37F4AAFDCFA73011CA2CEA - 19C28FB0FE9D524F11CA2CBB - 1758732AFF379DA111CA2CBB - 1C37FBAC04509CD000000102 - D0A2AA400B518D5A0070328A - 1C37FAAC04509CD000000102 1C37FABC05509CD000000102 PBXSmartGroupTreeModuleOutlineStateSelectionKey @@ -271,7 +266,7 @@ PBXSmartGroupTreeModuleOutlineStateVisibleRectKey - {{0, 0}, {258, 602}} + {{0, 0}, {186, 794}} PBXTopSmartGroupGIDs @@ -283,19 +278,19 @@ GeometryConfiguration Frame - {{0, 0}, {275, 620}} + {{0, 0}, {203, 812}} GroupTreeTableConfiguration MainColumn - 258 + 186 RubberWindowFrame - 428 145 1168 661 0 0 1920 1178 + 58 257 1088 853 0 0 1920 1178 Module PBXSmartGroupTreeModule Proportion - 275pt + 203pt Dock @@ -325,9 +320,9 @@ GeometryConfiguration Frame - {{0, 0}, {888, 0}} + {{0, 0}, {880, 0}} RubberWindowFrame - 428 145 1168 661 0 0 1920 1178 + 58 257 1088 853 0 0 1920 1178 Module PBXNavigatorGroup @@ -345,18 +340,18 @@ GeometryConfiguration Frame - {{0, 5}, {888, 615}} + {{0, 5}, {880, 807}} RubberWindowFrame - 428 145 1168 661 0 0 1920 1178 + 58 257 1088 853 0 0 1920 1178 Module XCDetailModule Proportion - 615pt + 807pt Proportion - 888pt + 880pt Name @@ -371,9 +366,9 @@ TableOfContents - D0A2AA160B518B620070328A + D012CD3B0CF2403E00194990 1CE0B1FE06471DED0097A5F4 - D0A2AA170B518B620070328A + D012CD3C0CF2403E00194990 1CE0B20306471E060097A5F4 1CE0B20506471E060097A5F4 @@ -488,7 +483,7 @@ ShelfIsVisible SourceDescription - file at '/System/Library/PrivateFrameworks/DevToolsInterface.framework/Versions/A/Resources/XCPerspectivesSpecificationMode1.xcperspec' + file at '/Xcode2.5/Library/PrivateFrameworks/DevToolsInterface.framework/Resources/XCPerspectivesSpecificationMode1.xcperspec' StatusbarIsVisible TimeStamp @@ -507,20 +502,15 @@ 5 WindowOrderList - D0A2AA190B518B620070328A - /Users/jderry/_Documents/Development/Balthisar Tidy ORIGINAL/Balthisar Tidy/Balthisar Tidy.xcodeproj + /Users/jderry/_Documents/Development/Balthisar Tidy 0.5/Balthisar Tidy 0.5 XCode2.5/Balthisar Tidy.xcodeproj WindowString - 428 145 1168 661 0 0 1920 1178 + 58 257 1088 853 0 0 1920 1178 WindowTools - FirstTimeWindowDisplayed - Identifier windowTool.build - IsVertical - Layout @@ -532,16 +522,26 @@ PBXProjectModuleGUID 1CD0528F0623707200166675 PBXProjectModuleLabel - + <No Editor> + PBXSplitModuleInNavigatorKey + + Split0 + + PBXProjectModuleGUID + 1CD052900623707200166675 + + SplitCount + 1 + StatusBarVisibility - + 1 GeometryConfiguration Frame - {{0, 0}, {500, 218}} + {{0, 0}, {500, 215}} RubberWindowFrame - 230 592 500 500 0 0 1920 1178 + 192 257 500 500 0 0 1280 1002 Module PBXNavigatorGroup @@ -549,23 +549,21 @@ 218pt + BecomeActive + 1 ContentConfiguration PBXProjectModuleGUID XCMainBuildResultsModuleGUID PBXProjectModuleLabel Build - XCBuildResultsTrigger_Collapse - 1021 - XCBuildResultsTrigger_Open - 1011 GeometryConfiguration Frame - {{0, 223}, {500, 236}} + {{0, 222}, {500, 236}} RubberWindowFrame - 230 592 500 500 0 0 1920 1178 + 192 257 500 500 0 0 1280 1002 Module PBXBuildResultsModule @@ -574,7 +572,7 @@ Proportion - 459pt + 458pt Name @@ -584,22 +582,18 @@ PBXBuildResultsModule StatusbarIsVisible - + 1 TableOfContents - D0A2AA190B518B620070328A - D0A2AA1A0B518B620070328A + 1C78EAA5065D492600B07095 + 1C78EAA6065D492600B07095 1CD0528F0623707200166675 XCMainBuildResultsModuleGUID ToolbarConfiguration xcode.toolbar.config.build WindowString - 230 592 500 500 0 0 1920 1178 - WindowToolGUID - D0A2AA190B518B620070328A - WindowToolIsVisible - + 192 257 500 500 0 0 1280 1002 Identifier diff --git a/Balthisar Tidy.xcodeproj/project.pbxproj b/Balthisar Tidy.xcodeproj/project.pbxproj old mode 100755 new mode 100644 index cd9d80c8..551be385 --- a/Balthisar Tidy.xcodeproj/project.pbxproj +++ b/Balthisar Tidy.xcodeproj/project.pbxproj @@ -3,213 +3,118 @@ archiveVersion = 1; classes = { }; - objectVersion = 42; + objectVersion = 44; objects = { -/* Begin PBXApplicationTarget section */ - 2A37F4C6FDCFA73011CA2CEA /* Balthisar Tidy */ = { - isa = PBXApplicationTarget; - buildConfigurationList = D0A2AA1B0B518B620070328A /* Build configuration list for PBXApplicationTarget "Balthisar Tidy" */; - buildPhases = ( - 2A37F4C7FDCFA73011CA2CEA /* Headers */, - 2A37F4C9FDCFA73011CA2CEA /* Resources */, - 2A37F4CEFDCFA73011CA2CEA /* Sources */, - 2A37F4D1FDCFA73011CA2CEA /* Frameworks */, - ); - dependencies = ( - ); - name = "Balthisar Tidy"; - productInstallPath = "$(HOME)/Applications"; - productName = "Balthisar Tidy"; - productReference = 1758732AFF379DA111CA2CBB /* Balthisar Tidy.app */; - productSettingsXML = " - - - - CFBundleDevelopmentRegion - English - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - html - HTML - - CFBundleTypeIconFile - iconhtml - CFBundleTypeName - HTML File - CFBundleTypeOSTypes - - TEXT - - CFBundleTypeRole - Editor - NSDocumentClass - MyDocument - - - CFBundleTypeExtensions - - htm - HTM - - CFBundleTypeIconFile - iconhtm - CFBundleTypeName - HTM File (DOS extension) - CFBundleTypeOSTypes - - TEXT - - CFBundleTypeRole - Editor - NSDocumentClass - MyDocument - - - CFBundleTypeExtensions - - php - PHP - - CFBundleTypeIconFile - iconphp - CFBundleTypeName - PHP File (PHP HTML File) - CFBundleTypeOSTypes - - TEXT - - CFBundleTypeRole - Editor - NSDocumentClass - MyDocument - - - CFBundleExecutable - Balthisar Tidy - CFBundleGetInfoString - Balthisar Tidy - CFBundleHelpBookFolder - Balthisar Tidy Help - CFBundleHelpBookName - Balthisar Tidy Help - CFBundleIconFile - iconbroom - CFBundleIdentifier - com.balthisar.balthisartidy - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - Balthisar Tidy - CFBundlePackageType - APPL - CFBundleShortVersionString - v0.1 (0100) - CFBundleSignature - WWS2 - CFBundleVersion - 0100 - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - -"; - }; -/* End PBXApplicationTarget section */ - /* Begin PBXBuildFile section */ - 080E96DAFE201CDB7F000001 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B6FDCFA73011CA2CEA /* MainMenu.nib */; }; - 080E96DBFE201CDB7F000001 /* MyDocument.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B4FDCFA73011CA2CEA /* MyDocument.nib */; }; - 089C1661FE840EACC02AAC07 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; }; - 1058C7A9FEA54F5311CA2CBB /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; }; - 2A37F4C8FDCFA73011CA2CEA /* MyDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = 2A37F4AEFDCFA73011CA2CEA /* MyDocument.h */; }; - F504CED603AFF8E701A80166 /* JSDTidy.h in Headers */ = {isa = PBXBuildFile; fileRef = F5E425A8039A983701A80165 /* JSDTidy.h */; }; - F504CED703AFF8E801A80166 /* JSDTidy.m in Sources */ = {isa = PBXBuildFile; fileRef = F5E425A9039A983701A80165 /* JSDTidy.m */; }; - F561F6B903A6B34B01A80166 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4B0FDCFA73011CA2CEA /* main.m */; }; - F56A531E0378639001A80165 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F56A531C0378639001A80165 /* Localizable.strings */; }; - F5BBA0420371F6C401A80165 /* iconbroom.icns in Resources */ = {isa = PBXBuildFile; fileRef = F5BBA03E0371F6C401A80165 /* iconbroom.icns */; }; - F5BBA0430371F6C401A80165 /* iconhtm.icns in Resources */ = {isa = PBXBuildFile; fileRef = F5BBA03F0371F6C401A80165 /* iconhtm.icns */; }; - F5BBA0440371F6C401A80165 /* iconhtml.icns in Resources */ = {isa = PBXBuildFile; fileRef = F5BBA0400371F6C401A80165 /* iconhtml.icns */; }; - F5BBA0450371F6C401A80165 /* iconphp.icns in Resources */ = {isa = PBXBuildFile; fileRef = F5BBA0410371F6C401A80165 /* iconphp.icns */; }; - F5BD14FF0368BA4E01A80166 /* AppController.h in Headers */ = {isa = PBXBuildFile; fileRef = F5BD14FD0368BA4E01A80166 /* AppController.h */; }; - F5BD15000368BA4E01A80166 /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = F5BD14FE0368BA4E01A80166 /* AppController.m */; }; - F5BD15120368C33901A80166 /* MyDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = F5BD15110368C33901A80166 /* MyDocument.m */; }; - F5CCB4580364D26D01A80165 /* buffio.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB42B0364D26D01A80165 /* buffio.h */; }; - F5CCB4590364D26D01A80165 /* fileio.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB42C0364D26D01A80165 /* fileio.h */; }; - F5CCB45A0364D26D01A80165 /* platform.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB42D0364D26D01A80165 /* platform.h */; }; - F5CCB45B0364D26D01A80165 /* tidy.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB42E0364D26D01A80165 /* tidy.h */; }; - F5CCB45C0364D26D01A80165 /* tidyenum.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB42F0364D26D01A80165 /* tidyenum.h */; }; - F5CCB45D0364D26D01A80165 /* access.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4310364D26D01A80165 /* access.c */; }; - F5CCB45E0364D26D01A80165 /* access.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4320364D26D01A80165 /* access.h */; }; - F5CCB45F0364D26D01A80165 /* alloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4330364D26D01A80165 /* alloc.c */; }; - F5CCB4600364D26D01A80165 /* attrask.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4340364D26D01A80165 /* attrask.c */; }; - F5CCB4610364D26D01A80165 /* attrget.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4350364D26D01A80165 /* attrget.c */; }; - F5CCB4620364D26D01A80165 /* attrs.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4360364D26D01A80165 /* attrs.c */; }; - F5CCB4630364D26D01A80165 /* attrs.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4370364D26D01A80165 /* attrs.h */; }; - F5CCB4640364D26D01A80165 /* buffio.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4380364D26D01A80165 /* buffio.c */; }; - F5CCB4650364D26D01A80165 /* clean.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4390364D26D01A80165 /* clean.c */; }; - F5CCB4660364D26D01A80165 /* clean.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB43A0364D26D01A80165 /* clean.h */; }; - F5CCB4670364D26D01A80165 /* config.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB43B0364D26D01A80165 /* config.c */; }; - F5CCB4680364D26D01A80165 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB43C0364D26D01A80165 /* config.h */; }; - F5CCB4690364D26D01A80165 /* entities.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB43D0364D26D01A80165 /* entities.c */; }; - F5CCB46A0364D26D01A80165 /* entities.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB43E0364D26D01A80165 /* entities.h */; }; - F5CCB46B0364D26D01A80165 /* fileio.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB43F0364D26D01A80165 /* fileio.c */; }; - F5CCB46C0364D26D01A80165 /* forward.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4400364D26D01A80165 /* forward.h */; }; - F5CCB46D0364D26D01A80165 /* istack.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4410364D26D01A80165 /* istack.c */; }; - F5CCB46E0364D26D01A80165 /* lexer.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4420364D26D01A80165 /* lexer.c */; }; - F5CCB46F0364D26D01A80165 /* lexer.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4430364D26D01A80165 /* lexer.h */; }; - F5CCB4700364D26D01A80165 /* localize.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4440364D26D01A80165 /* localize.c */; }; - F5CCB4710364D26D01A80165 /* message.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4450364D26D01A80165 /* message.h */; }; - F5CCB4720364D26D01A80165 /* parser.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4460364D26D01A80165 /* parser.c */; }; - F5CCB4730364D26D01A80165 /* parser.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4470364D26D01A80165 /* parser.h */; }; - F5CCB4740364D26D01A80165 /* pprint.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4480364D26D01A80165 /* pprint.c */; }; - F5CCB4750364D26D01A80165 /* pprint.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4490364D26D01A80165 /* pprint.h */; }; - F5CCB4760364D26D01A80165 /* streamio.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB44A0364D26D01A80165 /* streamio.c */; }; - F5CCB4770364D26D01A80165 /* streamio.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB44B0364D26D01A80165 /* streamio.h */; }; - F5CCB4780364D26D01A80165 /* tagask.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB44C0364D26D01A80165 /* tagask.c */; }; - F5CCB4790364D26D01A80165 /* tags.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB44D0364D26D01A80165 /* tags.c */; }; - F5CCB47A0364D26D01A80165 /* tags.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB44E0364D26D01A80165 /* tags.h */; }; - F5CCB47B0364D26D01A80165 /* tidy-int.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB44F0364D26D01A80165 /* tidy-int.h */; }; - F5CCB47C0364D26D01A80165 /* tidylib.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4500364D26D01A80165 /* tidylib.c */; }; - F5CCB47D0364D26D01A80165 /* tmbstr.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4510364D26D01A80165 /* tmbstr.c */; }; - F5CCB47E0364D26D01A80165 /* tmbstr.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4520364D26D01A80165 /* tmbstr.h */; }; - F5CCB47F0364D26D01A80165 /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4530364D26D01A80165 /* utf8.c */; }; - F5CCB4800364D26D01A80165 /* utf8.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4540364D26D01A80165 /* utf8.h */; }; - F5CCB4850364D33301A80165 /* CocoaTidy.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4830364D33301A80165 /* CocoaTidy.h */; }; - F5CCB4860364D33301A80165 /* CocoaTidy.m in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4840364D33301A80165 /* CocoaTidy.m */; }; - F5CEFEC5037B441A01A80166 /* TreeNode.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CEFEC3037B441A01A80166 /* TreeNode.h */; }; - F5CEFEC6037B441A01A80166 /* TreeNode.m in Sources */ = {isa = PBXBuildFile; fileRef = F5CEFEC4037B441A01A80166 /* TreeNode.m */; }; - F5D1B576036AF40C01A80165 /* Batch.nib in Resources */ = {isa = PBXBuildFile; fileRef = F5D1B574036AF40C01A80165 /* Batch.nib */; }; - F5D1B579036AF44801A80165 /* Preferences.nib in Resources */ = {isa = PBXBuildFile; fileRef = F5D1B577036AF44801A80165 /* Preferences.nib */; }; - F5FE7E92037595DC01A80165 /* PreferenceController.h in Headers */ = {isa = PBXBuildFile; fileRef = F5FE7E90037595DC01A80165 /* PreferenceController.h */; }; - F5FE7E93037595DC01A80165 /* PreferenceController.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FE7E91037595DC01A80165 /* PreferenceController.m */; }; - F5FE7E96037595EB01A80165 /* BatchController.h in Headers */ = {isa = PBXBuildFile; fileRef = F5FE7E94037595EB01A80165 /* BatchController.h */; }; - F5FE7E97037595EB01A80165 /* BatchController.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FE7E95037595EB01A80165 /* BatchController.m */; }; + D0B3C52E0CF257E800633C82 /* buffio.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB42B0364D26D01A80165 /* buffio.h */; }; + D0B3C52F0CF257E800633C82 /* fileio.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB42C0364D26D01A80165 /* fileio.h */; }; + D0B3C5300CF257E800633C82 /* platform.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB42D0364D26D01A80165 /* platform.h */; }; + D0B3C5310CF257E800633C82 /* tidy.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB42E0364D26D01A80165 /* tidy.h */; }; + D0B3C5320CF257E800633C82 /* tidyenum.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB42F0364D26D01A80165 /* tidyenum.h */; }; + D0B3C5330CF257E800633C82 /* access.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4320364D26D01A80165 /* access.h */; }; + D0B3C5340CF257E800633C82 /* attrs.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4370364D26D01A80165 /* attrs.h */; }; + D0B3C5350CF257E800633C82 /* clean.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB43A0364D26D01A80165 /* clean.h */; }; + D0B3C5360CF257E800633C82 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB43C0364D26D01A80165 /* config.h */; }; + D0B3C5370CF257E800633C82 /* entities.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB43E0364D26D01A80165 /* entities.h */; }; + D0B3C5380CF257E800633C82 /* forward.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4400364D26D01A80165 /* forward.h */; }; + D0B3C5390CF257E800633C82 /* lexer.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4430364D26D01A80165 /* lexer.h */; }; + D0B3C53A0CF257E800633C82 /* message.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4450364D26D01A80165 /* message.h */; }; + D0B3C53B0CF257E800633C82 /* parser.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4470364D26D01A80165 /* parser.h */; }; + D0B3C53C0CF257E800633C82 /* pprint.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4490364D26D01A80165 /* pprint.h */; }; + D0B3C53D0CF257E800633C82 /* streamio.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB44B0364D26D01A80165 /* streamio.h */; }; + D0B3C53E0CF257E800633C82 /* tags.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB44E0364D26D01A80165 /* tags.h */; }; + D0B3C53F0CF257E800633C82 /* tidy-int.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB44F0364D26D01A80165 /* tidy-int.h */; }; + D0B3C5400CF257E800633C82 /* tmbstr.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4520364D26D01A80165 /* tmbstr.h */; }; + D0B3C5410CF257E800633C82 /* utf8.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CCB4540364D26D01A80165 /* utf8.h */; }; + D0B3C5420CF257E800633C82 /* AppController.h in Headers */ = {isa = PBXBuildFile; fileRef = F5BD14FD0368BA4E01A80166 /* AppController.h */; }; + D0B3C5430CF257E800633C82 /* PreferenceController.h in Headers */ = {isa = PBXBuildFile; fileRef = F5FE7E90037595DC01A80165 /* PreferenceController.h */; }; + D0B3C5440CF257E800633C82 /* BatchController.h in Headers */ = {isa = PBXBuildFile; fileRef = F5FE7E94037595EB01A80165 /* BatchController.h */; }; + D0B3C5450CF257E800633C82 /* TreeNode.h in Headers */ = {isa = PBXBuildFile; fileRef = F5CEFEC3037B441A01A80166 /* TreeNode.h */; }; + D0B3C5460CF257E800633C82 /* JSDTidy.h in Headers */ = {isa = PBXBuildFile; fileRef = F5E425A8039A983701A80165 /* JSDTidy.h */; }; + D0B3C5470CF257E800633C82 /* TidyDocument.h in Headers */ = {isa = PBXBuildFile; fileRef = F53C0C1303DC802601A80166 /* TidyDocument.h */; }; + D0B3C5480CF257E800633C82 /* JSDTableColumn.h in Headers */ = {isa = PBXBuildFile; fileRef = F53C160B03DCDE6401A80166 /* JSDTableColumn.h */; }; + D0B3C5490CF257E800633C82 /* OptionPaneController.h in Headers */ = {isa = PBXBuildFile; fileRef = F589D0C803ED90EB01A80165 /* OptionPaneController.h */; }; + D0B3C54A0CF257E800633C82 /* JSDTableView.h in Headers */ = {isa = PBXBuildFile; fileRef = F554CD9D03F5990701A80165 /* JSDTableView.h */; }; + D0B3C54B0CF257E800633C82 /* JSDTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = F5D1F42404095DB101A80165 /* JSDTextView.h */; }; + D0B3C54D0CF257E800633C82 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B6FDCFA73011CA2CEA /* MainMenu.nib */; }; + D0B3C54E0CF257E800633C82 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; }; + D0B3C54F0CF257E800633C82 /* Batch.nib in Resources */ = {isa = PBXBuildFile; fileRef = F5D1B574036AF40C01A80165 /* Batch.nib */; }; + D0B3C5500CF257E800633C82 /* Preferences.nib in Resources */ = {isa = PBXBuildFile; fileRef = F5D1B577036AF44801A80165 /* Preferences.nib */; }; + D0B3C5510CF257E800633C82 /* iconbroom.icns in Resources */ = {isa = PBXBuildFile; fileRef = F5BBA03E0371F6C401A80165 /* iconbroom.icns */; }; + D0B3C5520CF257E800633C82 /* iconhtm.icns in Resources */ = {isa = PBXBuildFile; fileRef = F5BBA03F0371F6C401A80165 /* iconhtm.icns */; }; + D0B3C5530CF257E800633C82 /* iconhtml.icns in Resources */ = {isa = PBXBuildFile; fileRef = F5BBA0400371F6C401A80165 /* iconhtml.icns */; }; + D0B3C5540CF257E800633C82 /* iconphp.icns in Resources */ = {isa = PBXBuildFile; fileRef = F5BBA0410371F6C401A80165 /* iconphp.icns */; }; + D0B3C5550CF257E800633C82 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F56A531C0378639001A80165 /* Localizable.strings */; }; + D0B3C5560CF257E800633C82 /* TidyDocument.nib in Resources */ = {isa = PBXBuildFile; fileRef = F53C0C0E03DC7F9401A80166 /* TidyDocument.nib */; }; + D0B3C5570CF257E800633C82 /* optionsInEffect.txt in Resources */ = {isa = PBXBuildFile; fileRef = F54086D703E47DAE01A80165 /* optionsInEffect.txt */; }; + D0B3C5580CF257E800633C82 /* OptionPane.nib in Resources */ = {isa = PBXBuildFile; fileRef = F56B449C03EB3B8E01A80165 /* OptionPane.nib */; }; + D0B3C5590CF257E800633C82 /* optionsTypesExceptions.txt in Resources */ = {isa = PBXBuildFile; fileRef = F589D0DC03EDB68501A80165 /* optionsTypesExceptions.txt */; }; + D0B3C55B0CF257E800633C82 /* access.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4310364D26D01A80165 /* access.c */; }; + D0B3C55C0CF257E800633C82 /* alloc.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4330364D26D01A80165 /* alloc.c */; }; + D0B3C55D0CF257E800633C82 /* attrask.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4340364D26D01A80165 /* attrask.c */; }; + D0B3C55E0CF257E800633C82 /* attrget.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4350364D26D01A80165 /* attrget.c */; }; + D0B3C55F0CF257E800633C82 /* attrs.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4360364D26D01A80165 /* attrs.c */; }; + D0B3C5600CF257E800633C82 /* buffio.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4380364D26D01A80165 /* buffio.c */; }; + D0B3C5610CF257E800633C82 /* clean.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4390364D26D01A80165 /* clean.c */; }; + D0B3C5620CF257E800633C82 /* config.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB43B0364D26D01A80165 /* config.c */; }; + D0B3C5630CF257E800633C82 /* entities.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB43D0364D26D01A80165 /* entities.c */; }; + D0B3C5640CF257E800633C82 /* fileio.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB43F0364D26D01A80165 /* fileio.c */; }; + D0B3C5650CF257E800633C82 /* istack.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4410364D26D01A80165 /* istack.c */; }; + D0B3C5660CF257E800633C82 /* lexer.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4420364D26D01A80165 /* lexer.c */; }; + D0B3C5670CF257E800633C82 /* localize.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4440364D26D01A80165 /* localize.c */; }; + D0B3C5680CF257E800633C82 /* parser.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4460364D26D01A80165 /* parser.c */; }; + D0B3C5690CF257E800633C82 /* pprint.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4480364D26D01A80165 /* pprint.c */; }; + D0B3C56A0CF257E800633C82 /* streamio.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB44A0364D26D01A80165 /* streamio.c */; }; + D0B3C56B0CF257E800633C82 /* tagask.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB44C0364D26D01A80165 /* tagask.c */; }; + D0B3C56C0CF257E800633C82 /* tags.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB44D0364D26D01A80165 /* tags.c */; }; + D0B3C56D0CF257E800633C82 /* tidylib.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4500364D26D01A80165 /* tidylib.c */; }; + D0B3C56E0CF257E800633C82 /* tmbstr.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4510364D26D01A80165 /* tmbstr.c */; }; + D0B3C56F0CF257E800633C82 /* utf8.c in Sources */ = {isa = PBXBuildFile; fileRef = F5CCB4530364D26D01A80165 /* utf8.c */; }; + D0B3C5700CF257E800633C82 /* AppController.m in Sources */ = {isa = PBXBuildFile; fileRef = F5BD14FE0368BA4E01A80166 /* AppController.m */; }; + D0B3C5710CF257E800633C82 /* PreferenceController.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FE7E91037595DC01A80165 /* PreferenceController.m */; }; + D0B3C5720CF257E800633C82 /* BatchController.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FE7E95037595EB01A80165 /* BatchController.m */; }; + D0B3C5730CF257E800633C82 /* TreeNode.m in Sources */ = {isa = PBXBuildFile; fileRef = F5CEFEC4037B441A01A80166 /* TreeNode.m */; }; + D0B3C5740CF257E800633C82 /* JSDTidy.m in Sources */ = {isa = PBXBuildFile; fileRef = F5E425A9039A983701A80165 /* JSDTidy.m */; }; + D0B3C5750CF257E800633C82 /* TidyDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = F53C0C1403DC802601A80166 /* TidyDocument.m */; }; + D0B3C5760CF257E800633C82 /* JSDTableColumn.m in Sources */ = {isa = PBXBuildFile; fileRef = F53C160C03DCDE6401A80166 /* JSDTableColumn.m */; }; + D0B3C5770CF257E800633C82 /* OptionPaneController.m in Sources */ = {isa = PBXBuildFile; fileRef = F589D0C903ED90EB01A80165 /* OptionPaneController.m */; }; + D0B3C5780CF257E800633C82 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4B0FDCFA73011CA2CEA /* main.m */; }; + D0B3C5790CF257E800633C82 /* JSDTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = F554CD9E03F5990701A80165 /* JSDTableView.m */; }; + D0B3C57A0CF257E800633C82 /* JSDTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = F5D1F42504095DB101A80165 /* JSDTextView.m */; }; + D0B3C57C0CF257E800633C82 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; }; + D0B3C5860CF258A800633C82 /* Balthisar Tidy.plist in Resources */ = {isa = PBXBuildFile; fileRef = D0B3C5850CF258A800633C82 /* Balthisar Tidy.plist */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 089C1660FE840EACC02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 1758732AFF379DA111CA2CBB /* Balthisar Tidy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; path = "Balthisar Tidy.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 2A37F4AEFDCFA73011CA2CEA /* MyDocument.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MyDocument.h; path = Classes/MyDocument.h; sourceTree = ""; }; 2A37F4B0FDCFA73011CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 2A37F4B5FDCFA73011CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MyDocument.nib; sourceTree = ""; }; 2A37F4B7FDCFA73011CA2CEA /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = ""; }; 2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; + D0B3C5810CF257E800633C82 /* Balthisar Tidy.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Balthisar Tidy.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + D0B3C5850CF258A800633C82 /* Balthisar Tidy.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Balthisar Tidy.plist"; sourceTree = ""; }; + F53BB0B703EE056301A80165 /* README.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = README.rtf; sourceTree = ""; }; + F53C0C0F03DC7F9401A80166 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/TidyDocument.nib; sourceTree = ""; }; + F53C0C1303DC802601A80166 /* TidyDocument.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TidyDocument.h; path = "Classes/App Pieces/TidyDocument.h"; sourceTree = SOURCE_ROOT; }; + F53C0C1403DC802601A80166 /* TidyDocument.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = TidyDocument.m; path = "Classes/App Pieces/TidyDocument.m"; sourceTree = SOURCE_ROOT; }; + F53C160B03DCDE6401A80166 /* JSDTableColumn.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSDTableColumn.h; path = "Classes/Support Pieces/JSDTableColumn.h"; sourceTree = SOURCE_ROOT; }; + F53C160C03DCDE6401A80166 /* JSDTableColumn.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = JSDTableColumn.m; path = "Classes/Support Pieces/JSDTableColumn.m"; sourceTree = SOURCE_ROOT; }; + F54086D803E47DAE01A80165 /* English */ = {isa = PBXFileReference; lastKnownFileType = text; name = English; path = English.lproj/optionsInEffect.txt; sourceTree = ""; }; + F554CD9D03F5990701A80165 /* JSDTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSDTableView.h; path = "Classes/Support Pieces/JSDTableView.h"; sourceTree = SOURCE_ROOT; }; + F554CD9E03F5990701A80165 /* JSDTableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = JSDTableView.m; path = "Classes/Support Pieces/JSDTableView.m"; sourceTree = SOURCE_ROOT; }; F56A531D0378639001A80165 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = ""; }; + F56B449D03EB3B8E01A80165 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/OptionPane.nib; sourceTree = ""; }; + F589D0C803ED90EB01A80165 /* OptionPaneController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionPaneController.h; path = "Classes/App Pieces/OptionPaneController.h"; sourceTree = SOURCE_ROOT; }; + F589D0C903ED90EB01A80165 /* OptionPaneController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = OptionPaneController.m; path = "Classes/App Pieces/OptionPaneController.m"; sourceTree = SOURCE_ROOT; }; + F589D0DD03EDB68501A80165 /* English */ = {isa = PBXFileReference; lastKnownFileType = text; name = English; path = English.lproj/optionsTypesExceptions.txt; sourceTree = ""; }; F5BBA03E0371F6C401A80165 /* iconbroom.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = iconbroom.icns; path = "Graphics, Included/iconbroom.icns"; sourceTree = ""; }; F5BBA03F0371F6C401A80165 /* iconhtm.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = iconhtm.icns; path = "Graphics, Included/iconhtm.icns"; sourceTree = ""; }; F5BBA0400371F6C401A80165 /* iconhtml.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = iconhtml.icns; path = "Graphics, Included/iconhtml.icns"; sourceTree = ""; }; F5BBA0410371F6C401A80165 /* iconphp.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = iconphp.icns; path = "Graphics, Included/iconphp.icns"; sourceTree = ""; }; - F5BD14FD0368BA4E01A80166 /* AppController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AppController.h; path = Classes/AppController.h; sourceTree = ""; }; - F5BD14FE0368BA4E01A80166 /* AppController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = AppController.m; path = Classes/AppController.m; sourceTree = ""; }; - F5BD15110368C33901A80166 /* MyDocument.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = MyDocument.m; path = Classes/MyDocument.m; sourceTree = ""; }; + F5BD14FD0368BA4E01A80166 /* AppController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AppController.h; path = "Classes/App Pieces/AppController.h"; sourceTree = SOURCE_ROOT; }; + F5BD14FE0368BA4E01A80166 /* AppController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = AppController.m; path = "Classes/App Pieces/AppController.m"; sourceTree = SOURCE_ROOT; }; F5CCB4280364D26D01A80165 /* tab2space.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = tab2space.c; sourceTree = ""; }; F5CCB4290364D26D01A80165 /* tidy.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = tidy.c; sourceTree = ""; }; F5CCB42B0364D26D01A80165 /* buffio.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = buffio.h; sourceTree = ""; }; @@ -253,27 +158,27 @@ F5CCB4520364D26D01A80165 /* tmbstr.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = tmbstr.h; sourceTree = ""; }; F5CCB4530364D26D01A80165 /* utf8.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = utf8.c; sourceTree = ""; }; F5CCB4540364D26D01A80165 /* utf8.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = utf8.h; sourceTree = ""; }; - F5CCB4830364D33301A80165 /* CocoaTidy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CocoaTidy.h; path = Classes/CocoaTidy.h; sourceTree = ""; }; - F5CCB4840364D33301A80165 /* CocoaTidy.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = CocoaTidy.m; path = Classes/CocoaTidy.m; sourceTree = ""; }; - F5CEFEC3037B441A01A80166 /* TreeNode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TreeNode.h; path = Classes/TreeNode.h; sourceTree = ""; }; - F5CEFEC4037B441A01A80166 /* TreeNode.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = TreeNode.m; path = Classes/TreeNode.m; sourceTree = ""; }; + F5CEFEC3037B441A01A80166 /* TreeNode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TreeNode.h; path = "Classes/Support Pieces/TreeNode.h"; sourceTree = SOURCE_ROOT; }; + F5CEFEC4037B441A01A80166 /* TreeNode.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = TreeNode.m; path = "Classes/Support Pieces/TreeNode.m"; sourceTree = SOURCE_ROOT; }; F5D1B575036AF40C01A80165 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/Batch.nib; sourceTree = ""; }; F5D1B578036AF44801A80165 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/Preferences.nib; sourceTree = ""; }; - F5E425A8039A983701A80165 /* JSDTidy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSDTidy.h; path = Classes/JSDTidy.h; sourceTree = ""; }; - F5E425A9039A983701A80165 /* JSDTidy.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = JSDTidy.m; path = Classes/JSDTidy.m; sourceTree = ""; }; - F5FE7E90037595DC01A80165 /* PreferenceController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PreferenceController.h; path = Classes/PreferenceController.h; sourceTree = ""; }; - F5FE7E91037595DC01A80165 /* PreferenceController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PreferenceController.m; path = Classes/PreferenceController.m; sourceTree = ""; }; - F5FE7E94037595EB01A80165 /* BatchController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = BatchController.h; path = Classes/BatchController.h; sourceTree = ""; }; - F5FE7E95037595EB01A80165 /* BatchController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = BatchController.m; path = Classes/BatchController.m; sourceTree = ""; }; - F5FE7EAB03759E8D01A80165 /* Balthisar Tidy Help */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = file; name = "Balthisar Tidy Help"; path = "/Users/jderry/Development/Balthisar Tidy Help folder/Balthisar Tidy Help"; sourceTree = ""; }; + F5D1F42404095DB101A80165 /* JSDTextView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSDTextView.h; path = "Classes/Support Pieces/JSDTextView.h"; sourceTree = SOURCE_ROOT; }; + F5D1F42504095DB101A80165 /* JSDTextView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = JSDTextView.m; path = "Classes/Support Pieces/JSDTextView.m"; sourceTree = SOURCE_ROOT; }; + F5DCE620041BD59401A80165 /* JSDTidy.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = JSDTidy.rtf; path = Classes/JSDTidy/JSDTidy.rtf; sourceTree = SOURCE_ROOT; }; + F5E425A8039A983701A80165 /* JSDTidy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSDTidy.h; path = Classes/JSDTidy/JSDTidy.h; sourceTree = SOURCE_ROOT; }; + F5E425A9039A983701A80165 /* JSDTidy.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = JSDTidy.m; path = Classes/JSDTidy/JSDTidy.m; sourceTree = SOURCE_ROOT; }; + F5FE7E90037595DC01A80165 /* PreferenceController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PreferenceController.h; path = "Classes/App Pieces/PreferenceController.h"; sourceTree = SOURCE_ROOT; }; + F5FE7E91037595DC01A80165 /* PreferenceController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = PreferenceController.m; path = "Classes/App Pieces/PreferenceController.m"; sourceTree = SOURCE_ROOT; }; + F5FE7E94037595EB01A80165 /* BatchController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = BatchController.h; path = "Classes/App Pieces/BatchController.h"; sourceTree = SOURCE_ROOT; }; + F5FE7E95037595EB01A80165 /* BatchController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = BatchController.m; path = "Classes/App Pieces/BatchController.m"; sourceTree = SOURCE_ROOT; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 2A37F4D1FDCFA73011CA2CEA /* Frameworks */ = { + D0B3C57B0CF257E800633C82 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 1058C7A9FEA54F5311CA2CBB /* Cocoa.framework in Frameworks */, + D0B3C57C0CF257E800633C82 /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -300,7 +205,7 @@ 19C28FB0FE9D524F11CA2CBB /* Products */ = { isa = PBXGroup; children = ( - 1758732AFF379DA111CA2CBB /* Balthisar Tidy.app */, + D0B3C5810CF257E800633C82 /* Balthisar Tidy.app */, ); name = Products; sourceTree = ""; @@ -308,6 +213,7 @@ 2A37F4AAFDCFA73011CA2CEA /* Balthisar Tidy */ = { isa = PBXGroup; children = ( + F53BB0B703EE056301A80165 /* README.rtf */, 2A37F4ABFDCFA73011CA2CEA /* Classes */, 2A37F4AFFDCFA73011CA2CEA /* Other Sources */, 2A37F4B8FDCFA73011CA2CEA /* Resources */, @@ -320,23 +226,12 @@ 2A37F4ABFDCFA73011CA2CEA /* Classes */ = { isa = PBXGroup; children = ( - F5BD14FD0368BA4E01A80166 /* AppController.h */, - F5BD14FE0368BA4E01A80166 /* AppController.m */, - F5FE7E94037595EB01A80165 /* BatchController.h */, - F5FE7E95037595EB01A80165 /* BatchController.m */, - 2A37F4AEFDCFA73011CA2CEA /* MyDocument.h */, - F5BD15110368C33901A80166 /* MyDocument.m */, - F5FE7E90037595DC01A80165 /* PreferenceController.h */, - F5FE7E91037595DC01A80165 /* PreferenceController.m */, - F5CCB4830364D33301A80165 /* CocoaTidy.h */, - F5CCB4840364D33301A80165 /* CocoaTidy.m */, - F5CEFEC3037B441A01A80166 /* TreeNode.h */, - F5CEFEC4037B441A01A80166 /* TreeNode.m */, - F5E425A8039A983701A80165 /* JSDTidy.h */, - F5E425A9039A983701A80165 /* JSDTidy.m */, + F56B449503EB35EE01A80165 /* App Pieces */, + F56B449603EB360C01A80165 /* Support Pieces */, + F56B449703EB363401A80165 /* JSDTidy */, ); - name = Classes; - sourceTree = ""; + path = Classes; + sourceTree = SOURCE_ROOT; }; 2A37F4AFFDCFA73011CA2CEA /* Other Sources */ = { isa = PBXGroup; @@ -350,14 +245,17 @@ 2A37F4B8FDCFA73011CA2CEA /* Resources */ = { isa = PBXGroup; children = ( + D0B3C5850CF258A800633C82 /* Balthisar Tidy.plist */, F56A531C0378639001A80165 /* Localizable.strings */, - F5FE7EAB03759E8D01A80165 /* Balthisar Tidy Help */, + F54086D703E47DAE01A80165 /* optionsInEffect.txt */, + F589D0DC03EDB68501A80165 /* optionsTypesExceptions.txt */, F57707310371F19101A80165 /* icons */, 2A37F4B6FDCFA73011CA2CEA /* MainMenu.nib */, - 2A37F4B4FDCFA73011CA2CEA /* MyDocument.nib */, F5D1B574036AF40C01A80165 /* Batch.nib */, F5D1B577036AF44801A80165 /* Preferences.nib */, + F56B449C03EB3B8E01A80165 /* OptionPane.nib */, 089C165FFE840EACC02AAC07 /* InfoPlist.strings */, + F53C0C0E03DC7F9401A80166 /* TidyDocument.nib */, ); name = Resources; sourceTree = ""; @@ -371,6 +269,51 @@ name = Frameworks; sourceTree = ""; }; + F56B449503EB35EE01A80165 /* App Pieces */ = { + isa = PBXGroup; + children = ( + F5BD14FD0368BA4E01A80166 /* AppController.h */, + F5BD14FE0368BA4E01A80166 /* AppController.m */, + F5FE7E94037595EB01A80165 /* BatchController.h */, + F5FE7E95037595EB01A80165 /* BatchController.m */, + F5FE7E90037595DC01A80165 /* PreferenceController.h */, + F5FE7E91037595DC01A80165 /* PreferenceController.m */, + F53C0C1303DC802601A80166 /* TidyDocument.h */, + F53C0C1403DC802601A80166 /* TidyDocument.m */, + F589D0C803ED90EB01A80165 /* OptionPaneController.h */, + F589D0C903ED90EB01A80165 /* OptionPaneController.m */, + ); + name = "App Pieces"; + path = "Classes/App Pieces"; + sourceTree = SOURCE_ROOT; + }; + F56B449603EB360C01A80165 /* Support Pieces */ = { + isa = PBXGroup; + children = ( + F554CD9D03F5990701A80165 /* JSDTableView.h */, + F554CD9E03F5990701A80165 /* JSDTableView.m */, + F53C160B03DCDE6401A80166 /* JSDTableColumn.h */, + F53C160C03DCDE6401A80166 /* JSDTableColumn.m */, + F5CEFEC3037B441A01A80166 /* TreeNode.h */, + F5CEFEC4037B441A01A80166 /* TreeNode.m */, + F5D1F42404095DB101A80165 /* JSDTextView.h */, + F5D1F42504095DB101A80165 /* JSDTextView.m */, + ); + name = "Support Pieces"; + path = "Classes/Support Pieces"; + sourceTree = SOURCE_ROOT; + }; + F56B449703EB363401A80165 /* JSDTidy */ = { + isa = PBXGroup; + children = ( + F5DCE620041BD59401A80165 /* JSDTidy.rtf */, + F5E425A8039A983701A80165 /* JSDTidy.h */, + F5E425A9039A983701A80165 /* JSDTidy.m */, + ); + name = JSDTidy; + path = Classes/JSDTidy; + sourceTree = SOURCE_ROOT; + }; F57707310371F19101A80165 /* icons */ = { isa = PBXGroup; children = ( @@ -459,111 +402,143 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 2A37F4C7FDCFA73011CA2CEA /* Headers */ = { + D0B3C52D0CF257E800633C82 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 2A37F4C8FDCFA73011CA2CEA /* MyDocument.h in Headers */, - F5CCB4580364D26D01A80165 /* buffio.h in Headers */, - F5CCB4590364D26D01A80165 /* fileio.h in Headers */, - F5CCB45A0364D26D01A80165 /* platform.h in Headers */, - F5CCB45B0364D26D01A80165 /* tidy.h in Headers */, - F5CCB45C0364D26D01A80165 /* tidyenum.h in Headers */, - F5CCB45E0364D26D01A80165 /* access.h in Headers */, - F5CCB4630364D26D01A80165 /* attrs.h in Headers */, - F5CCB4660364D26D01A80165 /* clean.h in Headers */, - F5CCB4680364D26D01A80165 /* config.h in Headers */, - F5CCB46A0364D26D01A80165 /* entities.h in Headers */, - F5CCB46C0364D26D01A80165 /* forward.h in Headers */, - F5CCB46F0364D26D01A80165 /* lexer.h in Headers */, - F5CCB4710364D26D01A80165 /* message.h in Headers */, - F5CCB4730364D26D01A80165 /* parser.h in Headers */, - F5CCB4750364D26D01A80165 /* pprint.h in Headers */, - F5CCB4770364D26D01A80165 /* streamio.h in Headers */, - F5CCB47A0364D26D01A80165 /* tags.h in Headers */, - F5CCB47B0364D26D01A80165 /* tidy-int.h in Headers */, - F5CCB47E0364D26D01A80165 /* tmbstr.h in Headers */, - F5CCB4800364D26D01A80165 /* utf8.h in Headers */, - F5CCB4850364D33301A80165 /* CocoaTidy.h in Headers */, - F5BD14FF0368BA4E01A80166 /* AppController.h in Headers */, - F5FE7E92037595DC01A80165 /* PreferenceController.h in Headers */, - F5FE7E96037595EB01A80165 /* BatchController.h in Headers */, - F5CEFEC5037B441A01A80166 /* TreeNode.h in Headers */, - F504CED603AFF8E701A80166 /* JSDTidy.h in Headers */, + D0B3C52E0CF257E800633C82 /* buffio.h in Headers */, + D0B3C52F0CF257E800633C82 /* fileio.h in Headers */, + D0B3C5300CF257E800633C82 /* platform.h in Headers */, + D0B3C5310CF257E800633C82 /* tidy.h in Headers */, + D0B3C5320CF257E800633C82 /* tidyenum.h in Headers */, + D0B3C5330CF257E800633C82 /* access.h in Headers */, + D0B3C5340CF257E800633C82 /* attrs.h in Headers */, + D0B3C5350CF257E800633C82 /* clean.h in Headers */, + D0B3C5360CF257E800633C82 /* config.h in Headers */, + D0B3C5370CF257E800633C82 /* entities.h in Headers */, + D0B3C5380CF257E800633C82 /* forward.h in Headers */, + D0B3C5390CF257E800633C82 /* lexer.h in Headers */, + D0B3C53A0CF257E800633C82 /* message.h in Headers */, + D0B3C53B0CF257E800633C82 /* parser.h in Headers */, + D0B3C53C0CF257E800633C82 /* pprint.h in Headers */, + D0B3C53D0CF257E800633C82 /* streamio.h in Headers */, + D0B3C53E0CF257E800633C82 /* tags.h in Headers */, + D0B3C53F0CF257E800633C82 /* tidy-int.h in Headers */, + D0B3C5400CF257E800633C82 /* tmbstr.h in Headers */, + D0B3C5410CF257E800633C82 /* utf8.h in Headers */, + D0B3C5420CF257E800633C82 /* AppController.h in Headers */, + D0B3C5430CF257E800633C82 /* PreferenceController.h in Headers */, + D0B3C5440CF257E800633C82 /* BatchController.h in Headers */, + D0B3C5450CF257E800633C82 /* TreeNode.h in Headers */, + D0B3C5460CF257E800633C82 /* JSDTidy.h in Headers */, + D0B3C5470CF257E800633C82 /* TidyDocument.h in Headers */, + D0B3C5480CF257E800633C82 /* JSDTableColumn.h in Headers */, + D0B3C5490CF257E800633C82 /* OptionPaneController.h in Headers */, + D0B3C54A0CF257E800633C82 /* JSDTableView.h in Headers */, + D0B3C54B0CF257E800633C82 /* JSDTextView.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ +/* Begin PBXNativeTarget section */ + D0B3C52C0CF257E800633C82 /* Balthisar Tidy */ = { + isa = PBXNativeTarget; + buildConfigurationList = D0B3C57D0CF257E800633C82 /* Build configuration list for PBXNativeTarget "Balthisar Tidy" */; + buildPhases = ( + D0B3C52D0CF257E800633C82 /* Headers */, + D0B3C54C0CF257E800633C82 /* Resources */, + D0B3C55A0CF257E800633C82 /* Sources */, + D0B3C57B0CF257E800633C82 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Balthisar Tidy"; + productInstallPath = "$(HOME)/Applications"; + productName = "Balthisar Tidy"; + productReference = D0B3C5810CF257E800633C82 /* Balthisar Tidy.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + /* Begin PBXProject section */ 2A37F4A9FDCFA73011CA2CEA /* Project object */ = { isa = PBXProject; - buildConfigurationList = D0A2AA1F0B518B620070328A /* Build configuration list for PBXProject "Balthisar Tidy" */; - compatibilityVersion = "Xcode 2.4"; + buildConfigurationList = D012CD420CF2403E00194990 /* Build configuration list for PBXProject "Balthisar Tidy" */; + compatibilityVersion = "Xcode 3.0"; hasScannedForEncodings = 0; mainGroup = 2A37F4AAFDCFA73011CA2CEA /* Balthisar Tidy */; projectDirPath = ""; projectRoot = ""; targets = ( - 2A37F4C6FDCFA73011CA2CEA /* Balthisar Tidy */, + D0B3C52C0CF257E800633C82 /* Balthisar Tidy */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 2A37F4C9FDCFA73011CA2CEA /* Resources */ = { + D0B3C54C0CF257E800633C82 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 080E96DAFE201CDB7F000001 /* MainMenu.nib in Resources */, - 080E96DBFE201CDB7F000001 /* MyDocument.nib in Resources */, - 089C1661FE840EACC02AAC07 /* InfoPlist.strings in Resources */, - F5D1B576036AF40C01A80165 /* Batch.nib in Resources */, - F5D1B579036AF44801A80165 /* Preferences.nib in Resources */, - F5BBA0420371F6C401A80165 /* iconbroom.icns in Resources */, - F5BBA0430371F6C401A80165 /* iconhtm.icns in Resources */, - F5BBA0440371F6C401A80165 /* iconhtml.icns in Resources */, - F5BBA0450371F6C401A80165 /* iconphp.icns in Resources */, - F56A531E0378639001A80165 /* Localizable.strings in Resources */, + D0B3C54D0CF257E800633C82 /* MainMenu.nib in Resources */, + D0B3C54E0CF257E800633C82 /* InfoPlist.strings in Resources */, + D0B3C54F0CF257E800633C82 /* Batch.nib in Resources */, + D0B3C5500CF257E800633C82 /* Preferences.nib in Resources */, + D0B3C5510CF257E800633C82 /* iconbroom.icns in Resources */, + D0B3C5520CF257E800633C82 /* iconhtm.icns in Resources */, + D0B3C5530CF257E800633C82 /* iconhtml.icns in Resources */, + D0B3C5540CF257E800633C82 /* iconphp.icns in Resources */, + D0B3C5550CF257E800633C82 /* Localizable.strings in Resources */, + D0B3C5560CF257E800633C82 /* TidyDocument.nib in Resources */, + D0B3C5570CF257E800633C82 /* optionsInEffect.txt in Resources */, + D0B3C5580CF257E800633C82 /* OptionPane.nib in Resources */, + D0B3C5590CF257E800633C82 /* optionsTypesExceptions.txt in Resources */, + D0B3C5860CF258A800633C82 /* Balthisar Tidy.plist in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 2A37F4CEFDCFA73011CA2CEA /* Sources */ = { + D0B3C55A0CF257E800633C82 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - F5CCB45D0364D26D01A80165 /* access.c in Sources */, - F5CCB45F0364D26D01A80165 /* alloc.c in Sources */, - F5CCB4600364D26D01A80165 /* attrask.c in Sources */, - F5CCB4610364D26D01A80165 /* attrget.c in Sources */, - F5CCB4620364D26D01A80165 /* attrs.c in Sources */, - F5CCB4640364D26D01A80165 /* buffio.c in Sources */, - F5CCB4650364D26D01A80165 /* clean.c in Sources */, - F5CCB4670364D26D01A80165 /* config.c in Sources */, - F5CCB4690364D26D01A80165 /* entities.c in Sources */, - F5CCB46B0364D26D01A80165 /* fileio.c in Sources */, - F5CCB46D0364D26D01A80165 /* istack.c in Sources */, - F5CCB46E0364D26D01A80165 /* lexer.c in Sources */, - F5CCB4700364D26D01A80165 /* localize.c in Sources */, - F5CCB4720364D26D01A80165 /* parser.c in Sources */, - F5CCB4740364D26D01A80165 /* pprint.c in Sources */, - F5CCB4760364D26D01A80165 /* streamio.c in Sources */, - F5CCB4780364D26D01A80165 /* tagask.c in Sources */, - F5CCB4790364D26D01A80165 /* tags.c in Sources */, - F5CCB47C0364D26D01A80165 /* tidylib.c in Sources */, - F5CCB47D0364D26D01A80165 /* tmbstr.c in Sources */, - F5CCB47F0364D26D01A80165 /* utf8.c in Sources */, - F5CCB4860364D33301A80165 /* CocoaTidy.m in Sources */, - F5BD15000368BA4E01A80166 /* AppController.m in Sources */, - F5BD15120368C33901A80166 /* MyDocument.m in Sources */, - F5FE7E93037595DC01A80165 /* PreferenceController.m in Sources */, - F5FE7E97037595EB01A80165 /* BatchController.m in Sources */, - F5CEFEC6037B441A01A80166 /* TreeNode.m in Sources */, - F561F6B903A6B34B01A80166 /* main.m in Sources */, - F504CED703AFF8E801A80166 /* JSDTidy.m in Sources */, + D0B3C55B0CF257E800633C82 /* access.c in Sources */, + D0B3C55C0CF257E800633C82 /* alloc.c in Sources */, + D0B3C55D0CF257E800633C82 /* attrask.c in Sources */, + D0B3C55E0CF257E800633C82 /* attrget.c in Sources */, + D0B3C55F0CF257E800633C82 /* attrs.c in Sources */, + D0B3C5600CF257E800633C82 /* buffio.c in Sources */, + D0B3C5610CF257E800633C82 /* clean.c in Sources */, + D0B3C5620CF257E800633C82 /* config.c in Sources */, + D0B3C5630CF257E800633C82 /* entities.c in Sources */, + D0B3C5640CF257E800633C82 /* fileio.c in Sources */, + D0B3C5650CF257E800633C82 /* istack.c in Sources */, + D0B3C5660CF257E800633C82 /* lexer.c in Sources */, + D0B3C5670CF257E800633C82 /* localize.c in Sources */, + D0B3C5680CF257E800633C82 /* parser.c in Sources */, + D0B3C5690CF257E800633C82 /* pprint.c in Sources */, + D0B3C56A0CF257E800633C82 /* streamio.c in Sources */, + D0B3C56B0CF257E800633C82 /* tagask.c in Sources */, + D0B3C56C0CF257E800633C82 /* tags.c in Sources */, + D0B3C56D0CF257E800633C82 /* tidylib.c in Sources */, + D0B3C56E0CF257E800633C82 /* tmbstr.c in Sources */, + D0B3C56F0CF257E800633C82 /* utf8.c in Sources */, + D0B3C5700CF257E800633C82 /* AppController.m in Sources */, + D0B3C5710CF257E800633C82 /* PreferenceController.m in Sources */, + D0B3C5720CF257E800633C82 /* BatchController.m in Sources */, + D0B3C5730CF257E800633C82 /* TreeNode.m in Sources */, + D0B3C5740CF257E800633C82 /* JSDTidy.m in Sources */, + D0B3C5750CF257E800633C82 /* TidyDocument.m in Sources */, + D0B3C5760CF257E800633C82 /* JSDTableColumn.m in Sources */, + D0B3C5770CF257E800633C82 /* OptionPaneController.m in Sources */, + D0B3C5780CF257E800633C82 /* main.m in Sources */, + D0B3C5790CF257E800633C82 /* JSDTableView.m in Sources */, + D0B3C57A0CF257E800633C82 /* JSDTextView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -578,20 +553,28 @@ name = InfoPlist.strings; sourceTree = ""; }; - 2A37F4B4FDCFA73011CA2CEA /* MyDocument.nib */ = { + 2A37F4B6FDCFA73011CA2CEA /* MainMenu.nib */ = { isa = PBXVariantGroup; children = ( - 2A37F4B5FDCFA73011CA2CEA /* English */, + 2A37F4B7FDCFA73011CA2CEA /* English */, ); - name = MyDocument.nib; + name = MainMenu.nib; sourceTree = ""; }; - 2A37F4B6FDCFA73011CA2CEA /* MainMenu.nib */ = { + F53C0C0E03DC7F9401A80166 /* TidyDocument.nib */ = { isa = PBXVariantGroup; children = ( - 2A37F4B7FDCFA73011CA2CEA /* English */, + F53C0C0F03DC7F9401A80166 /* English */, ); - name = MainMenu.nib; + name = TidyDocument.nib; + sourceTree = ""; + }; + F54086D703E47DAE01A80165 /* optionsInEffect.txt */ = { + isa = PBXVariantGroup; + children = ( + F54086D803E47DAE01A80165 /* English */, + ); + name = optionsInEffect.txt; sourceTree = ""; }; F56A531C0378639001A80165 /* Localizable.strings */ = { @@ -602,6 +585,22 @@ name = Localizable.strings; sourceTree = ""; }; + F56B449C03EB3B8E01A80165 /* OptionPane.nib */ = { + isa = PBXVariantGroup; + children = ( + F56B449D03EB3B8E01A80165 /* English */, + ); + name = OptionPane.nib; + sourceTree = ""; + }; + F589D0DC03EDB68501A80165 /* optionsTypesExceptions.txt */ = { + isa = PBXVariantGroup; + children = ( + F589D0DD03EDB68501A80165 /* English */, + ); + name = optionsTypesExceptions.txt; + sourceTree = ""; + }; F5D1B574036AF40C01A80165 /* Batch.nib */ = { isa = PBXVariantGroup; children = ( @@ -621,20 +620,55 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - D0A2AA1C0B518B620070328A /* Development */ = { + D012CD430CF2403E00194990 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + ppc64, + ppc7400, + ppc970, + i386, + x86_64, + ppc, + ); + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; + }; + name = Development; + }; + D012CD440CF2403E00194990 /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = ( + ppc64, + ppc7400, + ppc970, + i386, + x86_64, + ppc, + ); + SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; + VALID_ARCHS = "ppc64 ppc7400 ppc970 i386 x86_64 ppc"; + }; + name = Deployment; + }; + D0B3C57E0CF257E800633C82 /* Development */ = { + isa = XCBuildConfiguration; + buildSettings = { + ARCHS = ( + i386, + ppc, + ); COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = ""; GCC_DYNAMIC_NO_PIC = NO; GCC_ENABLE_FIX_AND_CONTINUE = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ""; + INFOPLIST_FILE = "Balthisar Tidy.plist"; INSTALL_PATH = "$(HOME)/Applications"; LIBRARY_SEARCH_PATHS = ""; - OPTIMIZATION_CFLAGS = "-O0"; - OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; PRODUCT_NAME = "Balthisar Tidy"; SECTORDER_FLAGS = ""; @@ -648,16 +682,21 @@ }; name = Development; }; - D0A2AA1D0B518B620070328A /* Deployment */ = { + D0B3C57F0CF257E800633C82 /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { + ARCHS = ( + i386, + ppc, + ); COPY_PHASE_STRIP = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_ENABLE_FIX_AND_CONTINUE = NO; + GCC_SYMBOLS_PRIVATE_EXTERN = NO; HEADER_SEARCH_PATHS = ""; + INFOPLIST_FILE = "Balthisar Tidy.plist"; INSTALL_PATH = "$(HOME)/Applications"; LIBRARY_SEARCH_PATHS = ""; - OTHER_CFLAGS = ""; OTHER_LDFLAGS = ""; PRODUCT_NAME = "Balthisar Tidy"; SECTORDER_FLAGS = ""; @@ -671,78 +710,26 @@ }; name = Deployment; }; - D0A2AA1E0B518B620070328A /* Default */ = { - isa = XCBuildConfiguration; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ""; - HEADER_SEARCH_PATHS = ""; - INSTALL_PATH = "$(HOME)/Applications"; - LIBRARY_SEARCH_PATHS = ""; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; - PRODUCT_NAME = "Balthisar Tidy"; - SECTORDER_FLAGS = ""; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - WRAPPER_EXTENSION = app; - }; - name = Default; - }; - D0A2AA200B518B620070328A /* Development */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - }; - name = Development; - }; - D0A2AA210B518B620070328A /* Deployment */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - }; - name = Deployment; - }; - D0A2AA220B518B620070328A /* Default */ = { - isa = XCBuildConfiguration; - buildSettings = { - ARCHS = ( - ppc, - i386, - ); - }; - name = Default; - }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - D0A2AA1B0B518B620070328A /* Build configuration list for PBXApplicationTarget "Balthisar Tidy" */ = { + D012CD420CF2403E00194990 /* Build configuration list for PBXProject "Balthisar Tidy" */ = { isa = XCConfigurationList; buildConfigurations = ( - D0A2AA1C0B518B620070328A /* Development */, - D0A2AA1D0B518B620070328A /* Deployment */, - D0A2AA1E0B518B620070328A /* Default */, + D012CD430CF2403E00194990 /* Development */, + D012CD440CF2403E00194990 /* Deployment */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Development; }; - D0A2AA1F0B518B620070328A /* Build configuration list for PBXProject "Balthisar Tidy" */ = { + D0B3C57D0CF257E800633C82 /* Build configuration list for PBXNativeTarget "Balthisar Tidy" */ = { isa = XCConfigurationList; buildConfigurations = ( - D0A2AA200B518B620070328A /* Development */, - D0A2AA210B518B620070328A /* Deployment */, - D0A2AA220B518B620070328A /* Default */, + D0B3C57E0CF257E800633C82 /* Development */, + D0B3C57F0CF257E800633C82 /* Deployment */, ); defaultConfigurationIsVisible = 0; - defaultConfigurationName = Default; + defaultConfigurationName = Development; }; /* End XCConfigurationList section */ }; diff --git a/Classes/AppController.h b/Classes/App Pieces/AppController.h old mode 100755 new mode 100644 similarity index 100% rename from Classes/AppController.h rename to Classes/App Pieces/AppController.h diff --git a/Classes/AppController.m b/Classes/App Pieces/AppController.m old mode 100755 new mode 100644 similarity index 99% rename from Classes/AppController.m rename to Classes/App Pieces/AppController.m index a0c7d368..c417d6f8 --- a/Classes/AppController.m +++ b/Classes/App Pieces/AppController.m @@ -32,8 +32,7 @@ +(void)initialize { make sure that the preference controller and batch controller are properly disposed of. *********************************************************************/ -- (void)dealloc -{ +- (void)dealloc { [preferenceController release]; [batchController release]; [super dealloc]; diff --git a/Classes/BatchController.h b/Classes/App Pieces/BatchController.h old mode 100755 new mode 100644 similarity index 74% rename from Classes/BatchController.h rename to Classes/App Pieces/BatchController.h index 055c4653..74cc8fea --- a/Classes/BatchController.h +++ b/Classes/App Pieces/BatchController.h @@ -9,12 +9,21 @@ #import #import +#import "OptionPaneController.h" @interface BatchController : NSWindowController { IBOutlet NSOutlineView *fileList; // outlet for the NSOutlineView + + IBOutlet NSView *optionPane; // pointer to our empty optionPane. + + OptionPaneController *optionController; // this will control the real option pane loaded into optionPane + JSDTidyDocument *tidyProcess; // this will point to the optionPaneController's tidy process. + TreeNode *fileTree; // holds a list of everything we'll batch process. } +-(IBAction)startBatch:(id)sender; // handler for the batch button being pressed. + - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item; - (int)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item; - (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item; diff --git a/Classes/BatchController.m b/Classes/App Pieces/BatchController.m old mode 100755 new mode 100644 similarity index 87% rename from Classes/BatchController.m rename to Classes/App Pieces/BatchController.m index 5ad02c59..c2799b39 --- a/Classes/BatchController.m +++ b/Classes/App Pieces/BatchController.m @@ -21,7 +21,7 @@ @implementation BatchController *********************************************************************/ - (id)init { if (self = [super initWithWindowNibName:@"Batch"]) { - TreeNode *tempNode = nil; +/* TreeNode *tempNode = nil; [self setWindowFrameAutosaveName:@"BatchWindow"]; fileTree = [[TreeNode treeNodeWithData:@"Invisible Node"] retain]; tempNode = [TreeNode treeNodeWithData:@"First Node"]; @@ -31,7 +31,9 @@ - (id)init { [tempNode insertChild:[TreeNode treeNodeWithData:@"First Sub Node"] atIndex:0]; //[fileTree insertChild:[TreeNode treeNodeWithData:@"First Node"] atIndex:0]; //[fileTree insertChild:[TreeNode treeNodeWithData:@"Second Node"] atIndex:1]; - } + + [self setWindowFrameAutosaveName:@"BatchWindow"]; +*/ } // if return self; } @@ -42,6 +44,7 @@ - (id)init { o call the inherited method to ensure everything else is ok. *********************************************************************/ -(void)dealloc { + [optionController release]; [fileTree release]; [super dealloc]; } @@ -60,6 +63,20 @@ - (void)windowDidLoad { [checkbox setState:[defaults boolForKey:BNREmptyDocKey]]; */ } +/******************************************************************** + awakeFromNib + When we wake from the nib file, setup the option controller +*********************************************************************/ +-(void) awakeFromNib { + // create a OptionPaneController and put it in place of optionPane + if (!optionController) + optionController = [[OptionPaneController alloc] init]; + [optionController putViewIntoView:optionPane]; + [optionController setTarget:self]; + [optionController setAction:@selector(optionChanged:)]; +} // awakeFromNib + + /**************************************************************************************************** DATA SOURCE methods for the NSOutlineView. ****************************************************************************************************/ @@ -111,4 +128,9 @@ - (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item { return (NSString *)[item nodeData]; } + +-(IBAction)startBatch:(id)sender { + +} // startBatch + @end diff --git a/Classes/App Pieces/OptionPaneController.h b/Classes/App Pieces/OptionPaneController.h new file mode 100644 index 00000000..73f2bf09 --- /dev/null +++ b/Classes/App Pieces/OptionPaneController.h @@ -0,0 +1,44 @@ +/*************************************************************************************** + OptionPaneController.h -- part of Balthisar Tidy + + The main controller for the multi-use option pane. implemented separately for + o use on a document window + o use on the preferences window + + This controller parses optionsInEffect.txt in the application bundle, and compares + the options listed there with the linked-in TidyLib to determine which options are + in effect and valid. We use an instance of JSDTidyDocument to deal with this. + ***************************************************************************************/ + +#import +#import "JSDTidy.h" + +@interface OptionPaneController : NSObject { + IBOutlet NSView *myView; // pointer to the view -- will be returned by getView. + IBOutlet NSTableView *theTable; // pointer to the table + IBOutlet NSTextField *theDescription; // pointer to the description field. + + SEL _action; // routine to be called (action method) when an option changes. + id _target; // the target for the action method (optional--can be nil targeted). + + NSArray *optionsInEffect; // array of NSString that holds the options we really want to use. + NSArray *optionsExceptions; // array of NSString that holds the options we want to treat as STRINGS + JSDTidyDocument *tidyProcess; // our tidy wrapper/processor for dealing with valid options dynamically. + +} + +-(id)init; // initialize the view so we can use it. +-(NSView *)getView; // return the view so that it can be used in a parent window. +-(void)putViewIntoView:(NSView *)dstView; // make the view of this controller the view of dstView. + +-(IBAction)optionChanged:(id)sender; // handle an option changing in the tableview. + +-(SEL)action; // returns the action for this controller when options change. +-(void)setAction:(SEL)theAction; // sets the action for this controller when options change. +-(id)target; // returns the target for this controller. +-(void)setTarget:(id)theTarget; // sets the target -- optional, can be nil-targeted action. + +-(void)tidyDocument:(JSDTidyDocument *)theDoc; // set method for tidyProcess +-(JSDTidyDocument *)tidyDocument; // get method for tidyProcess + +@end diff --git a/Classes/App Pieces/OptionPaneController.m b/Classes/App Pieces/OptionPaneController.m new file mode 100644 index 00000000..add29568 --- /dev/null +++ b/Classes/App Pieces/OptionPaneController.m @@ -0,0 +1,239 @@ +/*************************************************************************************** + OptionPaneController.h -- part of Balthisar Tidy + + The main controller for the multi-use option pane. implemented separately for + o use on a document window + o use on the preferences window + ***************************************************************************************/ + +#import "OptionPaneController.h" +#import "JSDTableColumn.h" + +@implementation OptionPaneController + + +/******************************************************************** + init - designated initializer + load the bundle so the view can be drawn. +*********************************************************************/ +-(id)init { + if ([super init]) { + [NSBundle loadNibNamed:@"OptionPane" owner:self]; + tidyProcess = [[JSDTidyDocument alloc] init]; + // get our options list and exception list (items to treat as string regardless of tidylib definition) + optionsInEffect = [[NSArray arrayWithArray:[JSDTidyDocument loadConfigurationListFromResource:@"optionsInEffect" ofType:@"txt"]] retain]; + optionsExceptions = [[NSArray arrayWithArray:[JSDTidyDocument loadConfigurationListFromResource:@"optionsTypesExceptions" ofType:@"txt"]] retain]; + + // create a custom column for the NSTableView -- the table will retain and control it. + [[JSDTableColumn alloc] initReplacingColumn:[theTable tableColumnWithIdentifier:@"check"]]; + } // if + return self; +} // init + +/********************************************************************* + dealloc + our destructor -- get rid of stuff +**********************************************************************/ +- (void)dealloc +{ + [tidyProcess release]; + [optionsInEffect release]; + [optionsExceptions release]; + [super dealloc]; +} + +/******************************************************************** + getView + return theView so that it can be made a subview in another + window. +*********************************************************************/ +-(NSView *)getView { + return myView; +} // getView + +/******************************************************************** + putViewIntoView + put the view of this controller into theView +*********************************************************************/ +-(void)putViewIntoView:(NSView *)dstView { + // remove all subviews -- should only be one or zero, but let's be safe. + NSEnumerator *enumerator = [[dstView subviews] objectEnumerator]; + NSView *trash; + while (trash = [enumerator nextObject]) + [trash removeFromSuperview]; + // and put in the view + [dstView addSubview:myView]; + [theTable reloadData]; // this DOES happen automatically, but the scroll bars don't initially appear. + [theTable selectRow:0 byExtendingSelection:NO]; // this SHOULD happen automatically, but doesn't for some reason. +} + + +/******************************************************************** + tableViewSelectionDidChange: + we arrived here by virtue of this controller class being the + delegate of the table. Whenever the selection changes + we're going to put up a helpful hint of what the selection is. +*********************************************************************/ +- (void)tableViewSelectionDidChange:(NSNotification *)aNotification { + // get the description of the selected row. + if ([aNotification object] == theTable) + [theDescription setStringValue:NSLocalizedString([optionsInEffect objectAtIndex:[theTable selectedRow]], nil)]; +} // tableViewSelectionDidChange + +/******************************************************************** + numberOfRowsInTableView + we're here because we're the datasource of the tableview. + We need to specify how many items are in the table view. +*********************************************************************/ +- (int)numberOfRowsInTableView:(NSTableView *)aTableView { + return [optionsInEffect count]; +} // numberOfRowsInTableView + + +/******************************************************************** + tableView:objectValueForTableColumn:row + we're here because we're the datasource of the tableview. + We need to specify what to show in the row/column. +*********************************************************************/ +- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { + // get the id for the option at this row + TidyOptionId optId = [JSDTidyDocument optionIdForName:[optionsInEffect objectAtIndex:rowIndex]]; + + // handle returning the name of the option. + if ([[aTableColumn identifier] isEqualToString:@"name"]) + return [optionsInEffect objectAtIndex:rowIndex]; + + // handle the value column of the option + if ([[aTableColumn identifier] isEqualToString:@"check"]) + // if we're working on Encoding, then return the INDEX in allAvailableStringEncodings of the value. + if ( (optId == TidyCharEncoding) || (optId == TidyInCharEncoding) || (optId == TidyOutCharEncoding) ) { + int i = [[tidyProcess optionValueForId:optId] intValue]; // value of option + uint j = [[[tidyProcess class] allAvailableStringEncodings] indexOfObject:[NSNumber numberWithInt:i]]; // index of option + return [[NSNumber numberWithInt:j] stringValue]; // return it as a string + } else + return [tidyProcess optionValueForId:optId]; + return @""; +} //tableView:objectValueForTableColumn:row + + + +/******************************************************************** + tableColumn:customDataCellForRow + we're here because we're the datasource of the tableview. + We need to specify which cell to use for this particular row. +*********************************************************************/ +-(id)tableColumn:(JSDTableColumn *)aTableColumn customDataCellForRow:(int)row { + // get the id for the option at this row + TidyOptionId optId = [JSDTidyDocument optionIdForName:[optionsInEffect objectAtIndex:row]]; + + if ([[aTableColumn identifier] isEqualToString:@"check"]) { + NSArray *picks = [JSDTidyDocument optionPickListForId:optId]; + // only return a popup if there IS a picklist OR the item is in the optionsExceptions array. + if ( ([picks count] != 0) && (![optionsExceptions containsObject:[optionsInEffect objectAtIndex:row]] ) ) + return [aTableColumn usefulPopUpCell:picks]; + } // if + return nil; +} // tableColumn:customDataCellForRow + +/******************************************************************** + tableView:shouldEditTableColumn:row + we're here because we're the delegate of the tableview. + We need to disable for text editing cells with widgets. +*********************************************************************/ +- (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { + if ([[aTableColumn identifier] isEqualToString:@"check"]) { + if ([[aTableColumn dataCellForRow:rowIndex] class] != [NSTextFieldCell class]) + return NO; + else + return YES; + } // if + return NO; +} // tableView:shouldEditTableColumn:row + + +/******************************************************************** + tableView:setObjectValue:forTableColumn:row + user changed a value -- let's record it! +*********************************************************************/ +- (void)tableView:(NSTableView *)aTableView setObjectValue:(id)object forTableColumn:(NSTableColumn *)inColumn row:(int)inRow { + TidyOptionId optId = [JSDTidyDocument optionIdForName:[optionsInEffect objectAtIndex:inRow]]; + if ([[inColumn identifier] isEqualToString:@"check"]) { + // if we're working with encoding, we need to get the NSStringEncoding instead of the index of the item. + if ( (optId == TidyCharEncoding) || (optId == TidyInCharEncoding) || (optId == TidyOutCharEncoding) ) { + id myNumber = [[[tidyProcess class] allAvailableStringEncodings] objectAtIndex:[object unsignedLongValue]]; + [tidyProcess setOptionValueForId:optId fromObject:myNumber]; + } else + [tidyProcess setOptionValueForId:optId fromObject:object]; + } // if +} // tableView:setObjectValue:forTableColumn:row + +/******************************************************************** + tidyDocument + get method to expose the tidy document. +*********************************************************************/ +-(void)tidyDocument:(JSDTidyDocument *)theDoc { + [theDoc retain]; + [tidyProcess release]; + tidyProcess = theDoc; +} // tidyDocument + + +/******************************************************************** + tidyDocument + set method to expose the tidy document. +*********************************************************************/ +-(JSDTidyDocument *)tidyDocument { + return tidyProcess; +} // tidyDocument + +//=================================================================================================== +// TARGETING AND ACTIONING -- we want to behave like a Cocoa component, so support that idea. +//=================================================================================================== + +/******************************************************************** + optionChanged: + One of the options changed! See if there's something assigned + to _action, and if so, call it! We're here as a result of being + the Action of the tableview. +*********************************************************************/ +- (IBAction)optionChanged:(id)sender { + [NSApp sendAction:_action to:_target from:self]; +} + +/******************************************************************** + action + return the assigned action. +*********************************************************************/ +-(SEL)action { + return _action; +} // action + +/******************************************************************** + SetAction + assign an action to this controller. +*********************************************************************/ +-(void)setAction:(SEL)theAction { + _action = theAction; +} // setAction; + +/******************************************************************** + target + return the target of this controller. +*********************************************************************/ +-(id)target { + return _target; +} // target + +/******************************************************************** + SetTarget + assign a target to this controller. Remember that actions work + on the target-action paradigm, but that nil-targeted actions are + supported. This means if _target isn't used, the action is + sent all the way up the responder chain. If there's a target, it + only goes to the target. +*********************************************************************/ +-(void)setTarget:(id)theTarget { + _target = theTarget; +} // setTarger + +@end diff --git a/Classes/App Pieces/PreferenceController.h b/Classes/App Pieces/PreferenceController.h new file mode 100644 index 00000000..94307a63 --- /dev/null +++ b/Classes/App Pieces/PreferenceController.h @@ -0,0 +1,36 @@ +/*************************************************************************************** + PreferenceController.h -- part of Balthisar Tidy + + The main preference controller. Here we'll control the following: + o Handles the application preferences. + o Implements class methods to be used before instantiation. + ***************************************************************************************/ + +#import +#import "OptionPaneController.h" + +extern NSString *JSDKeySavingPrefStyle; +extern NSString *JSDKeyWarnBeforeOverwrite; +extern NSString *JSDKeyBatchSavingPrefStyle; + +@interface PreferenceController : NSWindowController { + + IBOutlet NSButton *saving1; // pointer to enable save + IBOutlet NSButton *saving2; // pointer to disable save + IBOutlet NSButton *savingWarn; // pointer to warn on save + + IBOutlet NSButton *batchSaving1; // pointer to overwrite + IBOutlet NSButton *batchSaving2; // pointer to backup + + IBOutlet NSView *optionPane; // pointer to our empty optionPane. + OptionPaneController *optionController; // this will control the real option pane loaded into optionPane + + JSDTidyDocument *tidyProcess; // this will point to the optionPaneController's tidy process. + +} ++(void)registerUserDefaults; + +-(IBAction)preferenceChanged:(id)sender; // handler for a configuration option change. +-(IBAction)radioSavingChanged:(id)sender; // handler for a saving preference change. +-(IBAction)radioBatchChanged:(id)sender; // handler for a batch preference change. +@end diff --git a/Classes/App Pieces/PreferenceController.m b/Classes/App Pieces/PreferenceController.m new file mode 100644 index 00000000..35c3919d --- /dev/null +++ b/Classes/App Pieces/PreferenceController.m @@ -0,0 +1,146 @@ +/*************************************************************************************** + PreferenceController.m -- part of Balthisar Tidy + + The main preference controller. Here we'll control the following: + o Handles the application preferences. + o Implements class methods to be used before instantiation. + ***************************************************************************************/ + +#import +#import "PreferenceController.h" +#import "JSDTidy.h" + +// these convenience definitions for our prefs keys. +// the rest are generated by TidyLib directly. +NSString *JSDKeySavingPrefStyle = @"SavingPrefStyle"; +NSString *JSDKeyWarnBeforeOverwrite = @"WarnBeforeOverwrite"; +NSString *JSDKeyBatchSavingPrefStyle = @"BatchSavingPrefStyle"; + + +@implementation PreferenceController + +/******************************************************************** + registerUserDefaults -- CLASS method. + register all of the user defaults. Implemented as a CLASS + method in order to keep this with the preferences controller, + but the preferences controller won't have been created yet! +*********************************************************************/ ++(void)registerUserDefaults { + NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary]; // create a dictionary + // put all of the defaults in the dictionary + [defaultValues setObject:[NSNumber numberWithInt:2] forKey:JSDKeySavingPrefStyle /* was key 10 */]; + [defaultValues setObject:[NSNumber numberWithBool:NO] forKey:JSDKeyWarnBeforeOverwrite /* was key 11 */]; + [defaultValues setObject:[NSNumber numberWithInt:1] forKey:JSDKeyBatchSavingPrefStyle /* was key 14 */]; + [JSDTidyDocument addDefaultsToDictionary:defaultValues]; // get the defaults ultimately from the linked-in TidyLib + // register the defaults with the defaults system + [[NSUserDefaults standardUserDefaults] registerDefaults: defaultValues]; +} // registerUserDefaults + +/******************************************************************** + init + Our creator -- we want to load the nib "Preferences". +*********************************************************************/ +- (id)init { + if (self = [super initWithWindowNibName:@"Preferences"]) + [self setWindowFrameAutosaveName:@"PrefWindow"]; + return self; +} // init + +/******************************************************************** + dealloc + clean up. +*********************************************************************/ +- (void)dealloc +{ + tidyProcess = nil; + [optionController release]; + [super dealloc]; +} // dealloc + +/******************************************************************** + awakeFromNib + When we wake from the nib file, setup the option pane controller. +*********************************************************************/ +-(void) awakeFromNib { + // create a OptionPaneController and put it in place of optionPane + if (!optionController) + optionController = [[OptionPaneController alloc] init]; + [optionController putViewIntoView:optionPane]; + [optionController setTarget:self]; + [optionController setAction:@selector(optionChanged:)]; + tidyProcess = [optionController tidyDocument]; +} // awakeFromNib + + +/******************************************************************** + windowDidLoad + when the window has loaded, let's put the correct preferences on. +*********************************************************************/ +- (void)windowDidLoad { + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; + [saving1 setState:([defaults integerForKey: JSDKeySavingPrefStyle] == 1)]; + [saving2 setState:([defaults integerForKey: JSDKeySavingPrefStyle] == 2)]; + [savingWarn setState:[defaults boolForKey: JSDKeyWarnBeforeOverwrite]]; + [savingWarn setEnabled:[saving1 state]]; + [batchSaving1 setState:([defaults integerForKey: JSDKeyBatchSavingPrefStyle] == 1)]; + [batchSaving2 setState:([defaults integerForKey: JSDKeyBatchSavingPrefStyle] == 2)]; + // load the default systems preferences. + [tidyProcess takeOptionValuesFromDefaults:defaults]; +} // windowDidLoad + +/******************************************************************** + radioSavingChanged + one of the radio buttons for saving options has changed. + Handle this apart, since we're not using a matrix. +*********************************************************************/ +-(IBAction)radioSavingChanged:(id)sender { + [saving1 setState:NO]; + [saving2 setState:NO]; + [sender setState:YES]; + [savingWarn setEnabled:[saving1 state]]; + [self preferenceChanged:nil]; +} // radioSavingChanged + + +/******************************************************************** + radioBatchChanged + one of the radio buttons for batch options has changed. + Handle this apart, since we're not using a matrix. +*********************************************************************/ +-(IBAction)radioBatchChanged:(id)sender { + [batchSaving1 setState:NO]; + [batchSaving2 setState:NO]; + [sender setState:YES]; + [self preferenceChanged:nil]; +} // radioSavingChanged + +/******************************************************************** + preferenceChanged + one of the saving/batch prefs changed. Log and notify. +*********************************************************************/ +-(IBAction)preferenceChanged:(id)sender { + // update the preference registry + [[NSUserDefaults standardUserDefaults] setInteger:0 forKey:JSDKeySavingPrefStyle]; + if ([saving1 state]) [[NSUserDefaults standardUserDefaults] setInteger:1 forKey:JSDKeySavingPrefStyle]; + if ([saving2 state]) [[NSUserDefaults standardUserDefaults] setInteger:2 forKey:JSDKeySavingPrefStyle]; + [[NSUserDefaults standardUserDefaults] setBool:[savingWarn state] forKey:JSDKeyWarnBeforeOverwrite]; + [[NSUserDefaults standardUserDefaults] setInteger:0 forKey:JSDKeyBatchSavingPrefStyle]; + if ([batchSaving1 state]) [[NSUserDefaults standardUserDefaults] setInteger:1 forKey:JSDKeyBatchSavingPrefStyle]; + if ([batchSaving2 state]) [[NSUserDefaults standardUserDefaults] setInteger:2 forKey:JSDKeyBatchSavingPrefStyle]; + // send the notification that a saving preference has changed! + [[NSNotificationCenter defaultCenter] postNotificationName:@"JSDSavePrefChange" object:nil]; +} + +/******************************************************************** + optionChanged + one of the preferences changed in the table view. We're + here as a result of having been set the Action for the + OptionPaneController. We're gonna record the preference, + but we're not going to post a notification, 'cos new + documents will read the preferences themselves. +*********************************************************************/ +-(IBAction)optionChanged:(id)sender { + [tidyProcess writeOptionValuesWithDefaults:[NSUserDefaults standardUserDefaults]]; +} // optionChanged + +@end diff --git a/Classes/App Pieces/TidyDocument.h b/Classes/App Pieces/TidyDocument.h new file mode 100644 index 00000000..0be3159b --- /dev/null +++ b/Classes/App Pieces/TidyDocument.h @@ -0,0 +1,37 @@ +/*************************************************************************************** + TidyDocument.h -- part of Balthisar Tidy + + The main document controller. Here we'll control the following: + o + ***************************************************************************************/ + +#import +#import "JSDTidy.h" +#import "OptionPaneController.h" +#import "JSDTextView.h" + +@interface TidyDocument : NSDocument +{ + // view outlets + IBOutlet JSDTextView *sourceView; // pointer to the source HTML view. + IBOutlet JSDTextView *tidyView; // pointer to the tidy'd HTML view. + IBOutlet NSTableView *errorView; // pointer to where to display the error messages. + + // items for the option controller and pane + IBOutlet NSView *optionPane; // pointer to our empty optionPane. + OptionPaneController *optionController; // this will control the real option pane loaded into optionPane + + // internally-used instance variables. + JSDTidyDocument* tidyProcess; // our tidy wrapper/processor. + int saveBehavior; // the save behavior from the preferences. + bool saveWarning; // the warning behavior for when saveBehavior == 1; + bool yesSavedAs; // disable warnings and protections once a save-as has been done. + bool tidyOriginalFile; // flags whether the file was CREATED by Tidy, for writing type/creator codes. +} + +- (IBAction)optionChanged:(id)sender; // react to a tidy'ing control being changed. + +- (IBAction)errorClicked:(id)sender; // react to an error row being clicked. + +- (void)retidy; // tidy's itself. +@end diff --git a/Classes/MyDocument.m b/Classes/App Pieces/TidyDocument.m old mode 100755 new mode 100644 similarity index 54% rename from Classes/MyDocument.m rename to Classes/App Pieces/TidyDocument.m index e53ec96e..b234be7c --- a/Classes/MyDocument.m +++ b/Classes/App Pieces/TidyDocument.m @@ -1,5 +1,5 @@ /*************************************************************************************** - MyDocument.m -- part of Balthisar Tidy + TidyDocument.m -- part of Balthisar Tidy The main document controller. Here we'll control the following: o File I/O, including the use of type/creator codes. @@ -31,11 +31,11 @@ // not use any type/creator and let the OS do its own thing in Finder. //============================================================================================= -#import "MyDocument.h" -#import "CocoaTidy.h" +#import "TidyDocument.h" #import "PreferenceController.h" +#import "JSDTidy.h" -@implementation MyDocument +@implementation TidyDocument //============================================================================================= // FILE I/O HANDLING @@ -46,27 +46,23 @@ @implementation MyDocument Called as part of the responder chain. We already have a name and type as a result of (1) the file picker, or (2) opening a document from Finder. Here, we'll merely load the file contents - into a string, and process it when the nib awakes (since we're + into an NSData, and process it when the nib awakes (since we're likely to be called here before the nib and its controls exist). *********************************************************************/ - (BOOL)readFromFile:(NSString *)filename ofType:(NSString *)docType { - [processString release]; - processString = [NSString stringWithContentsOfFile:filename]; // load the file. - [processString retain]; - tidyOriginalFile = NO; // the current file was OPENED, not a Tidy original. - return YES; // yes, it was loaded successfully. -} + [tidyProcess setOriginalTextWithData:[NSData dataWithContentsOfFile:filename]]; // give our tidyProcess the data. + tidyOriginalFile = NO; // the current file was OPENED, not a Tidy original. + return YES; // yes, it was loaded successfully. +} // readFromFile /******************************************************************** dataRepresentationOfType Called as a result of saving files. All we're going to do is - pass back a string, because we're only dealing with simple text - file. + pass back the NSData taken from the TidyDoc *********************************************************************/ -- (NSData *)dataRepresentationOfType:(NSString *)aType -{ - return (NSData *)[tidyView string]; -} +- (NSData *)dataRepresentationOfType:(NSString *)aType { + return [tidyProcess tidyTextAsData]; // return the raw data in user-encoding to be written. +} // dataRepresentationOfType /******************************************************************** writeToFile @@ -77,13 +73,14 @@ - (NSData *)dataRepresentationOfType:(NSString *)aType contents, which is the tidy'd view. *********************************************************************/ - (BOOL)writeToFile:(NSString *)fileName ofType:(NSString *)type { - bool success = [super writeToFile:fileName ofType:type]; + bool success = [super writeToFile:fileName ofType:type]; // inherited method does the actual saving if (success) { - [sourceView setString:[tidyView string]]; // update the sourceView with the newly-saved contents. - yesSavedAs = YES; // this flag disables the warnings, since they're meaningless now. + [tidyProcess setOriginalText:[tidyProcess tidyText]]; // make the tidyText the new originalText. + [sourceView setString:[tidyProcess workingText]]; // update the sourceView with the newly-saved contents. + yesSavedAs = YES; // this flag disables the warnings, since they're meaningless now. } return success; -} +} // writeToFile /******************************************************************** fileAttributesToWriteToFile:ofType:saveOperation @@ -102,8 +99,8 @@ - (NSDictionary *)fileAttributesToWriteToFile:(NSString *)fullDocumentPath NSMutableDictionary *myDict = (NSMutableDictionary *)[super fileAttributesToWriteToFile:fullDocumentPath ofType:documentTypeName saveOperation:saveOperationType]; // ONLY add type/creator if this is an original file -- NOT if we opened the file. if (tidyOriginalFile) { - [myDict setObject:[NSNumber numberWithUnsignedLong:'WWS2'] forKey:NSFileHFSCreatorCode]; - [myDict setObject:[NSNumber numberWithUnsignedLong:'TEXT'] forKey:NSFileHFSTypeCode]; + [myDict setObject:[NSNumber numberWithUnsignedLong:'WWS2'] forKey:NSFileHFSCreatorCode]; // set creator code. + [myDict setObject:[NSNumber numberWithUnsignedLong:'TEXT'] forKey:NSFileHFSTypeCode]; // set file type. } else { // use original type/creator codes, if any. OSType macType = [ [ [ NSFileManager defaultManager ] fileAttributesAtPath: fullDocumentPath traverseLink: YES ] fileHFSTypeCode]; OSType macCreator = [ [ [ NSFileManager defaultManager ] fileAttributesAtPath: fullDocumentPath traverseLink: YES ] fileHFSCreatorCode]; @@ -113,19 +110,23 @@ - (NSDictionary *)fileAttributesToWriteToFile:(NSString *)fullDocumentPath } } return myDict; -} +} // fileAttributesToWriteToFile:ofType:saveOperation /******************************************************************** revertToSavedFromFile:ofType allow the default reversion to take place, and then put the - correct value in the editor if it took place. + correct value in the editor if it took place. The inherited + method does readFromFile, so our tidyProcess will already + have the reverted data. *********************************************************************/ - (BOOL)revertToSavedFromFile:(NSString *)fileName ofType:(NSString *)type { bool didRevert = [super revertToSavedFromFile:fileName ofType:type]; - if (didRevert) - [sourceView setString:processString]; - return didRevert; -} + if (didRevert) { + [sourceView setString:[tidyProcess workingText]]; // update the display, since the reversion already loaded the data. + [self retidy]; // retidy the document. + } // if + return didRevert; // flag whether we reverted or not. +} // revertToSavedFromFile:ofType /******************************************************************** saveDocument @@ -140,20 +141,24 @@ - (IBAction)saveDocument:(id)sender { // (2) the sourceView isn't empty. // (3) the file hasn't been saved already. This last is important, because if the file has // already been edited and saved, there's no longer an "original" file to protect. + // warning will only apply if there's a current file and it's NOT been saved yet, and it's not new. - if ((saveBehavior == 1) && (saveWarning) && (yesSavedAs == NO) && ([[self fileName] length] != 0 )) { + if ( (saveBehavior == 1) && // behavior is protective AND + (saveWarning) && // we want to have a warning AND + (yesSavedAs == NO) && // we've NOT yet done a save as... AND + ([[self fileName] length] != 0 )) { // the filename isn't zero length int i = NSRunAlertPanel(NSLocalizedString(@"WarnSaveOverwrite", nil), NSLocalizedString(@"WarnSaveOverwriteExplain", nil), NSLocalizedString(@"continue save", nil),NSLocalizedString(@"do not save", nil) , nil); if (i == NSAlertAlternateReturn) return; // don't let user continue the save operation if he chose don't save. - } + } // if // save is completely disabled -- tell user to Save AsÉ if (saveBehavior == 2) { NSRunAlertPanel(NSLocalizedString(@"WarnSaveDisabled", nil), NSLocalizedString(@"WarnSaveDisabledExplain", nil), NSLocalizedString(@"cancel", nil), nil, nil); return; // don't let user continue the save operation. - } + } // if return [super saveDocument:sender]; } // end saveDocument @@ -171,54 +176,52 @@ - (IBAction)saveDocument:(id)sender { - (id)init { if ([super init]) { - tidyProcess = [[CocoaTidy init] alloc]; - processString = @""; - tidyOriginalFile = YES; // if yes, we'll write file/creator codes. + tidyOriginalFile = YES; // if yes, we'll write file/creator codes. + tidyProcess = [[JSDTidyDocument alloc] init]; // use our own tidy process, NOT the controller's instance. // register for notification [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleSavePrefChange:) name:@"JSDSavePrefChange" object:nil]; - } + } // if return self; -} +} // init /********************************************************************* dealloc our destructor -- get rid of the tidy processor and processString **********************************************************************/ -- (void)dealloc -{ - // don't foget to removed ourselves from the Notification Center! - [[NSNotificationCenter defaultCenter] removeObserver:self]; - - [tidyProcess release]; - [processString release]; - [super dealloc]; -} +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; // remove ourselves from the notification center! + [tidyProcess release]; // release the tidyProcess. + [optionController release]; // remove the optionController pane. + [super dealloc]; // do the inherited dealloc. +} // dealloc /******************************************************************** configureViewSettings given aView, make it non-wrapping. Also set fonts. *********************************************************************/ - (void)configureViewSettings:(NSTextView *)aView { - const float LargeNumberForText = 1.0e7; - NSScrollView *scrollView = (NSScrollView *)[[aView superview] superview]; // get the TextView's scroll-view. - NSTextContainer *container = [aView textContainer]; // get the textContainer object. - - [scrollView setHasHorizontalScroller:YES]; // sets the scroll-view attributes. - [scrollView setHasVerticalScroller:YES]; // sets the scroll-view attributes. - [scrollView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)];// sets auto-resizing. - [[scrollView contentView] setAutoresizesSubviews:YES]; // sets auto-resizing. - - [container setContainerSize:NSMakeSize(LargeNumberForText, LargeNumberForText)]; - [container setWidthTracksTextView:NO]; - [container setHeightTracksTextView:NO]; - - [aView setMaxSize:NSMakeSize(LargeNumberForText, LargeNumberForText)]; - [aView setHorizontallyResizable:YES]; - [aView setVerticallyResizable:YES]; - [aView setAutoresizingMask:NSViewNotSizable]; - [aView setFont:[NSFont fontWithName:@"Courier" size:12]]; // set the font for the views. -} + [aView setRichText:NO]; // don't allow rich text. + [aView setUsesFontPanel:NO]; // don't allow the font panel. + [aView setContinuousSpellCheckingEnabled:NO]; // turn off spell checking. + [aView setSelectable:YES]; // text can be selectable. + [aView setEditable:NO]; // text shouldn't be editable. + [aView setImportsGraphics:NO]; // don't let user import graphics. + [aView setUsesRuler:NO]; // no, the ruler won't be used. +} // configureViewSettings + +/******************************************************************** + awakeFromNib + When we wake from the nib file, setup the option controller +*********************************************************************/ +-(void) awakeFromNib { + // create a OptionPaneController and put it in place of optionPane + if (!optionController) + optionController = [[OptionPaneController alloc] init]; + [optionController putViewIntoView:optionPane]; + [optionController setTarget:self]; + [optionController setAction:@selector(optionChanged:)]; +} // awakeFromNib /******************************************************************** windowControllerDidLoadNib: @@ -227,46 +230,37 @@ - (void)configureViewSettings:(NSTextView *)aView { *********************************************************************/ - (void)windowControllerDidLoadNib:(NSWindowController *) aController { - [super windowControllerDidLoadNib:aController]; + [super windowControllerDidLoadNib:aController]; // inherited method needs to be called. // configure the view settings that we can't in IB. - [self configureViewSettings:sourceView]; - [self configureViewSettings:tidyView]; - [self configureViewSettings:errorView]; - + [self configureViewSettings:[sourceView textView]]; // setup the sourceView's options. + [[sourceView textView] setEditable:YES]; // make the sourceView editable. + [self configureViewSettings:[tidyView textView]]; // setup the tidyView's options. + // honor the defaults system defaults. - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - [checkIndent setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:0]]]; - [checkOmit setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:1]]]; - [checkWrap setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:2]]]; - [valWrap setStringValue:[defaults stringForKey: [PreferenceController keyNameForKeyNumber:3]]]; - [checkUppercase setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:4]]]; - [checkClean setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:5]]]; - [checkBare setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:6]]]; - [checkNumeric setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:7]]]; - [checkXML setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:8]]]; - [menuEncoding selectItemAtIndex:[defaults integerForKey: [PreferenceController keyNameForKeyNumber:9]]]; + NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; // get the default default system + [[optionController tidyDocument] takeOptionValuesFromDefaults:defaults]; // make the optionController take the values // saving behavior settings - saveBehavior = [defaults integerForKey:[PreferenceController keyNameForKeyNumber:10]]; - saveWarning = [defaults boolForKey:[PreferenceController keyNameForKeyNumber:11]]; + saveBehavior = [defaults integerForKey:JSDKeySavingPrefStyle]; + saveWarning = [defaults boolForKey:JSDKeyWarnBeforeOverwrite]; yesSavedAs = NO; - // make the sourceView string the same as our processString. - [sourceView setString:processString]; - + // make the sourceView string the same as our loaded text. + [sourceView setString:[tidyProcess workingText]]; + // force the processing to occur. [self optionChanged:self]; -} +} // windowControllerDidLoadNib /******************************************************************** windowNibName return the name of the Nib associated with this class. *********************************************************************/ -- (NSString *)windowNibName -{ - return @"MyDocument"; -} +- (NSString *)windowNibName { + return @"TidyDocument"; +} // windowNibName + //============================================================================================= // PREFERENCES, TIDY OPTIONS, AND TIDYING @@ -279,30 +273,29 @@ - (NSString *)windowNibName *********************************************************************/ - (void)handleSavePrefChange:(NSNotification *)note { - saveBehavior = [[NSUserDefaults standardUserDefaults] integerForKey:[PreferenceController keyNameForKeyNumber:10]]; - saveWarning = [[NSUserDefaults standardUserDefaults] boolForKey:[PreferenceController keyNameForKeyNumber:11]]; -} + saveBehavior = [[NSUserDefaults standardUserDefaults] integerForKey:JSDKeySavingPrefStyle]; + saveWarning = [[NSUserDefaults standardUserDefaults] boolForKey:JSDKeyWarnBeforeOverwrite]; +} // handleSavePrefChange /******************************************************************** - TidyCurrentDocument - do the actual tidying of the document. -*********************************************************************/ --(void)TidyCurrentDocument { - // set the text in the tidyProcess - [tidyProcess setOriginalText:[sourceView string]]; - //perform the tidy process - [tidyProcess performTidy]; - // show the output in the document window. - [tidyView setString:[tidyProcess tidyText]]; - [errorView setString:[tidyProcess errorText]]; - // our definition of "dirty" will be any time the tidyText is not the same as originalText - // granted, the user can cheat by copying the tidyText to the originalText, but oh well. The point is - // we want to make sure the user has the chance to save if the tidy is not the same as source. - if (([[sourceView string] isEqual:[tidyView string]]) || ([[sourceView string] length] == 0)) + retidy + do the actual re-tidy'ing + *********************************************************************/ +-(void)retidy { + [tidyProcess setWorkingText:[sourceView string]]; // put the sourceView text into the tidyProcess. + [tidyView setString:[tidyProcess tidyText]]; // put the tidy'd text into the view. + [errorView reloadData]; // reload the error data + [errorView deselectAll:self]; // get rid of the selected row. + + // handle document dirty detection -- we're NOT dirty if the source and tidy string are + // the same, or there is no source view, of if the source is the same as the original. + if ( ( [tidyProcess areEqualOriginalTidy]) || // the original text and tidy text are equal OR + ( [[tidyProcess originalText] length] == 0 ) || // the originalText was never there OR + ( [tidyProcess areEqualOriginalWorking ] )) // the workingText is the same as the original. [self updateChangeCount:NSChangeCleared]; else [self updateChangeCount:NSChangeDone]; -} +} // retidy /******************************************************************** textDidChange: @@ -312,73 +305,94 @@ -(void)TidyCurrentDocument { inclined to type everything, 'cos this is bound to be slow. *********************************************************************/ - (void)textDidChange:(NSNotification *)aNotification { - [self TidyCurrentDocument]; -} + [self retidy]; +} // textDidChange + /******************************************************************** optionChanged: - One of the options changed! Let the CocoaTidy object know, and - retidy the document. + One of the options changed! We're here by virtue of being the + action of the optionController instance. Let's retidy here. *********************************************************************/ - (IBAction)optionChanged:(id)sender { - // create a temporary CocoaTidyOptions object to set all of our options - CocoaTidyOptions* myOpts = [[CocoaTidyOptions alloc] init]; - - // set all of the options in the CocoaTidyOptions object. - [myOpts optIndent:[checkIndent state]]; - [myOpts optOmit:[checkOmit state]]; - [myOpts optWrapAtColumn:[checkWrap state]]; - [myOpts optWrapAtColumnNr:[valWrap intValue]]; - [myOpts optUpper:[checkUppercase state]]; - [myOpts optClean:[checkClean state]]; - [myOpts optBare:[checkBare state]]; - [myOpts optNumeric:[checkNumeric state]]; - [myOpts optXML:[checkXML state]]; - - // grok the encoding option -- position dependant, maybe not the best way. - switch ( [menuEncoding indexOfSelectedItem] ) { - case 0: - [myOpts optRaw:YES]; - break; - case 1: - [myOpts optASCII:YES]; - break; - case 2: - [myOpts optLatin1:YES]; - break; - case 3: - [myOpts optISO2022:YES]; - break; - case 4: - [myOpts optUTF8:YES]; - break; - case 5: - [myOpts optMac:YES]; - break; - case 6: - [myOpts optUTF16LE:YES]; - break; - case 7: - [myOpts optUTF16BE:YES]; - break; - case 8: - [myOpts optUTF16:YES]; - break; - case 9: - [myOpts optWin1252:YES]; - break; - case 10: - [myOpts optBig5:YES]; - break; - case 11: - [myOpts optShiftJIS:YES]; - break; - } // end switch - - [tidyProcess setOptionsWithOptions: myOpts]; // set the options. - [myOpts release]; // free the temporary CocoaTidyOptions object. - [self TidyCurrentDocument]; // tidy the current document. -} + [tidyProcess optionCopyFromDocument:[optionController tidyDocument]]; + [self retidy]; +} // optionChanged + + +//============================================================================================= +// SUPPORT FOR THE ERROR TABLE +//============================================================================================= + + +/******************************************************************** + numberOfRowsInTableView + we're here because we're the datasource of the tableview. + We need to specify how many items are in the table view. +*********************************************************************/ +- (int)numberOfRowsInTableView:(NSTableView *)aTableView { + return [[tidyProcess errorArray] count]; +} // numberOfRowsInTableView + + +/******************************************************************** + tableView:objectValueForTableColumn:row + we're here because we're the datasource of the tableview. + We need to specify what to show in the row/column. +*********************************************************************/ +- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex { + NSDictionary *error = [[tidyProcess errorArray] objectAtIndex:rowIndex]; // get the current error + + // list of error types -- no localized; users can localize based on this string. + NSArray *errorTypes = [NSArray arrayWithObjects:@"Info:", @"Warning:", @"Config:", @"Access:", @"Error:", @"Document:", @"Panic:", nil]; + + // handle returning the severity of the error, localized. + if ([[aTableColumn identifier] isEqualToString:@"severity"]) + return NSLocalizedString([errorTypes objectAtIndex: [[error objectForKey:@"level"] intValue] ], nil); + + // handle the location, localized, or "N/A" if not applicable + if ([[aTableColumn identifier] isEqualToString:@"where"]) { + if (([[error objectForKey:@"line"] intValue] == 0) || ([[error objectForKey:@"column"] intValue] == 0)) { + return NSLocalizedString(@"N/A", nil); + } // if (N/A) + return [NSString stringWithFormat:@"%@ %@, %@ %@", NSLocalizedString(@"line", nil), [error objectForKey:@"line"], NSLocalizedString(@"column", nil), [error objectForKey:@"column"]]; + } // if where + + if ([[aTableColumn identifier] isEqualToString:@"description"]) + return [error objectForKey:@"message"]; + return @""; +} //tableView:objectValueForTableColumn:row + +/******************************************************************** + errorClicked: + we arrived here by virtue of this controller class and this + method being the action of the table. Whenever the selection + changes we're going to highlight and show the related + column/row in the sourceView. +*********************************************************************/ +- (IBAction)errorClicked:(id)sender { + int errorViewRow = [errorView selectedRow]; + if (errorViewRow >= 0) { + int highlightRow = [[[[tidyProcess errorArray] objectAtIndex:errorViewRow] objectForKey:@"line"] intValue]; + int highlightCol = [[[[tidyProcess errorArray] objectAtIndex:errorViewRow] objectForKey:@"column"] intValue]; + [sourceView setHighlightedLine:highlightRow column:highlightCol]; + } + else + [sourceView setHighlightedLine:0 column:0]; +} // errorClicked + +/******************************************************************** + tableViewSelectionDidChange: + we arrived here by virtue of this controller class being the + delegate of the table. Whenever the selection changes + we're going to highlight and show the related column/row + in the sourceView. +*********************************************************************/ +- (void)tableViewSelectionDidChange:(NSNotification *)aNotification { + // get the description of the selected row. + if ([aNotification object] == errorView) + [self errorClicked:self]; +} // tableViewSelectionDidChange @end diff --git a/Classes/CocoaTidy.h b/Classes/CocoaTidy.h deleted file mode 100755 index 47b1c434..00000000 --- a/Classes/CocoaTidy.h +++ /dev/null @@ -1,168 +0,0 @@ -/*************************************************************************************** - CocoaTidy.h - - A Cocoa wrapper for tidylib. - ***************************************************************************************/ - -#import -#import "tidy.h" - -/**************************************************************************************************** - CocoaTidyOptions - A complete class for managing Tidy'd options. Implemented this - separately from the CocoaTidy class, so that (1) the CocoaTidy - class could simply include an instance of it, and (2) so that - applications can use the options class for other uses (e.g., prefs) - ****************************************************************************************************/ -@interface CocoaTidyOptions : NSObject { - // processing directives - bool optIndent; // -indent or -i to indent element content - bool optOmit; // -omit or -o to omit optional end tags - bool optWrapAtColumn; // -wrap to wrap text at the specified (default is 68) - int optWrapAtColumnNr; // the for the above option. - bool optUpper; // -upper or -u to force tags to upper case (default is lower case) - bool optClean; // -clean or -c to replace FONT, NOBR and CENTER tags by CSS - bool optBare; // -bare or -b to strip out smart quotes and em dashes, etc. - bool optNumeric; // -numeric or -n to output numeric rather than named entities - bool optXML; // -xml input is well-formed XML. - bool optAsXHTML; // -asxhtml to convert HTML to well formed XHTML - bool optAsHTML; // -ashtml to force XHTML to well formed HTML - int optAccessLevel; // -access to do additional accessibility checks ( = 1, 2, 3) - - // Character encodings - bool optRaw; // -raw to output values above 127 without conversion to entities - bool optASCII; // -ascii to use US-ASCII for output, ISO-8859-1 for input - bool optLatin1; // -latin1 to use ISO-8859-1 for both input and output - bool optISO2022; // -iso2022 to use ISO-2022 for both input and output - bool optUTF8; // -utf8 to use UTF-8 for both input and output - bool optMac; // -mac to use MacRoman for input, US-ASCII for output - bool optUTF16LE; // -utf16le to use UTF-16LE for both input and output - bool optUTF16BE; // -utf16be to use UTF-16BE for both input and output - bool optUTF16; // -utf16 to use UTF-16 for both input and output - bool optWin1252; // -win1252 to use Windows-1252 for input, US-ASCII for output - bool optBig5; // -big5 to use Big5 for both input and output - bool optShiftJIS; // -shiftjis to use Shift_JIS for both input and output - - NSString *encoding; // the encoding value as a string, which is used by tidylib for encoding options. -} - -// options --(bool)optIndent; // read method for optIndent; --(void)optIndent:(bool)opt; // set method for optIndent; - --(bool)optOmit; --(void)optOmit:(bool)opt; - --(bool)optWrapAtColumn; --(void)optWrapAtColumn:(bool)opt; - --(int)optWrapAtColumnNr; --(void)optWrapAtColumnNr:(int)ColumnNr; - --(bool)optUpper; --(void)optUpper:(bool)opt; - --(bool)optClean; --(void)optClean:(bool)opt; - --(bool)optBare; --(void)optBare:(bool)opt; - --(bool)optNumeric; --(void)optNumeric:(bool)opt; - --(bool)optXML; --(void)optXML:(bool)opt; - --(bool)optAsXHTML; --(void)optAsXHTML:(bool)opt; - --(bool)optAsHTML; --(void)optAsHTML:(bool)opt; - --(int)optAccessLevel; --(void)optAccessLevel:(int)opt; - --(bool)optRaw; --(void)optRaw:(bool)opt; - --(bool)optASCII; --(void)optASCII:(bool)opt; - --(bool)optLatin1; --(void)optLatin1:(bool)opt; - --(bool)optISO2022; --(void)optISO2022:(bool)opt; - --(bool)optUTF8; --(void)optUTF8:(bool)opt; - --(bool)optMac; --(void)optMac:(bool)opt; - --(bool)optUTF16LE; --(void)optUTF16LE:(bool)opt; - --(bool)optUTF16BE; --(void)optUTF16BE:(bool)opt; - --(bool)optUTF16; --(void)optUTF16:(bool)opt; - --(bool)optWin1252; --(void)optWin1252:(bool)opt; - --(bool)optBig5; --(void)optBig5:(bool)opt; - --(bool)optShiftJIS; --(void)optShiftJIS:(bool)opt; - --(NSString *)encoding; --(void)setEncodingAsString:(NSString *)string; - -@end // CocoaTidyOptions class - - - -/**************************************************************************************************** - CocoaTidy - A basic TidyLib implementation in Cocoa. Regular tidy options are set - via an attached CocoaTidyOptions. Basic support is included, which - means that considering the supported options, Tidy can tidy a document - and pretty-format it. - ****************************************************************************************************/ -@interface CocoaTidy : NSObject { - NSString *origText; // the original text to process. - NSString *tidyText; // the tidy'd text done processing. - NSString *errorText; // the error-text generated by tidy. - CocoaTidyOptions *options; // holds the options supported by this instance. - TidyDoc tdoc; // a tidy document for doing the processing. -} - -// initialization and deallocation --(id)init; // override the initializer. --(id)initWithString:(NSString *)string; // initialize with a string. --(id)initWithContentsOfFile:(NSString *)path; // initialize with a file. --(void)dealloc; // override the destructor. - -// strings --(NSString *)originalText; // read method for origText. --(void)setOriginalText:(NSString *)string; // set method for origText. - --(NSString *)tidyText; // read method for tidy'd text. - --(NSString *)errorText; // read method for error log text. - -// performTidy --(void)performTidy; - -// peformTidyWithFile:toFile --(void)performTidyWithFile:(NSString *)fSource:toFile:(NSString *)fDestination; - -// option support --(CocoaTidyOptions *)options; // read the options --(void)setOptionsWithOptions:(CocoaTidyOptions *)theOptions; // set the options. - -@end diff --git a/Classes/CocoaTidy.m b/Classes/CocoaTidy.m deleted file mode 100755 index 67b713d4..00000000 --- a/Classes/CocoaTidy.m +++ /dev/null @@ -1,527 +0,0 @@ -/*************************************************************************************** - CocoaTidy.m - - A Cocoa wrapper for tidylib. - ***************************************************************************************/ - -#import "CocoaTidy.h" -#import "tidy.h" -#import "buffio.h" - -@implementation CocoaTidy - -/////////////////////////////////////////////////////////////////////////////// -/// INITIALIZATION AND DESTRUCTION -/////////////////////////////////////////////////////////////////////////////// - -/******************************************************************** - init -- designated initializer! - Our creator. We need to set up our local variables. - ********************************************************************/ -- (id)init { - if (self = [super init]) { - origText = @""; - tidyText = @""; - errorText = @""; - options = [[CocoaTidyOptions init] alloc]; - tdoc = tidyCreate(); - } - return self; -} - -/******************************************************************** - dealloc - Our deallocator in order to dispose of finished variables. - ********************************************************************/ --(void)dealloc { - [origText release]; - [tidyText release]; - [errorText release]; - [options release]; - tidyRelease(tdoc); - [super dealloc]; -} - -/******************************************************************** - initWithString - init, but with a string - ********************************************************************/ --(id)initWithString:(NSString *)string { - [self init]; - [self setOriginalText:string]; - return self; -} - -/******************************************************************** - initWithContentsOfFile - init, but with the contents of a file - ********************************************************************/ --(id)initWithContentsOfFile:(NSString *)path { - [self init]; - [self setOriginalText:[NSString stringWithContentsOfFile:path]]; - return self; -} - - - -/////////////////////////////////////////////////////////////////////////////// -/// STRING ACCESS (THE GOOD STUFF) -/////////////////////////////////////////////////////////////////////////////// - - -/******************************************************************** - originalText - return origText - ********************************************************************/ --(NSString *)originalText { - return origText; -} - -/******************************************************************** - SetOriginalText - set origText - ********************************************************************/ --(void)setOriginalText:(NSString *)string { - [string retain]; - [origText release]; - origText = string; -} - -/******************************************************************** - tidyText - return tidyText - ********************************************************************/ --(NSString *)tidyText { - return tidyText; -} - -/******************************************************************** - errorText - return errorText - ********************************************************************/ --(NSString *)errorText { - return errorText; -} - - -/////////////////////////////////////////////////////////////////////////////// -/// OPTIONS SUPPORT -/////////////////////////////////////////////////////////////////////////////// --(CocoaTidyOptions *)options { - return options; -} - --(void)setOptionsWithOptions:(CocoaTidyOptions *)theOptions { - [options release]; - options = theOptions; - [options retain]; -} - -/////////////////////////////////////////////////////////////////////////////// -/// TIDYING ROUTINES -- DO THE ACTUAL TIDY'ING. -/////////////////////////////////////////////////////////////////////////////// - -/******************************************************************** - prepareTidyOptions - prepare the options in the tidyDoc to get ready for the op. - ********************************************************************/ --(void)prepareTidyOptions { - tidyRelease(tdoc); // release the old tDoc - tdoc = tidyCreate(); // create a virgin tDoc - - // set the options based on the options record -- encoding options - tidySetCharEncoding( tdoc, [[options encoding] cString] ); - - // set the options based on the options record -- processing directives - if ([options optIndent]) // indent or not - tidyOptSetInt( tdoc, TidyIndentContent, 5 ); - if ([options optOmit]) // omit optional end tags - tidyOptSetBool( tdoc, TidyHideEndTags, YES ); - if ([options optWrapAtColumn]) // word wrap - tidyOptSetInt( tdoc, TidyWrapLen, [options optWrapAtColumnNr] ); - else - tidyOptSetInt( tdoc, TidyWrapLen, 0 ); // default to NO wrapping, NOT at 72 characters! - if ([options optUpper]) // upper case tags - tidyOptSetBool( tdoc, TidyUpperCaseTags, YES ); - if ([options optClean]) // replace with CSS - tidyOptSetBool( tdoc, TidyMakeClean, YES ); - if ([options optBare]) // strip smart quotes, etc. - tidyOptSetBool( tdoc, TidyMakeBare, YES ); - if ([options optNumeric]) // use numberic entities. - tidyOptSetBool( tdoc, TidyNumEntities, YES ); - if ([options optAsXHTML]) // return XHTML - tidyOptSetBool( tdoc, TidyXhtmlOut, YES ); -} - -/******************************************************************** - performTidy - run the operation. - ********************************************************************/ --(void)performTidy{ - int status = 0; // status at each step of processing - - // setup the tidy options in the tdoc - [self prepareTidyOptions]; - - // setup the output buffer to copy to an NSString instead of writing to stdout - TidyBuffer *outBuffer = malloc(sizeof(TidyBuffer)); - tidyBufInit( outBuffer ); - - // setup the error buffer to catch errors here instead of stdout - TidyBuffer *errBuffer = malloc(sizeof(TidyBuffer)); - tidyBufInit( errBuffer ); - tidySetErrorBuffer( tdoc, errBuffer ); - - // parse the original text into the TidyDoc - status = tidyParseString(tdoc, [origText cString] /*content*/); - - // clean and repair -- this adds document-type info and meta-data if doc isn't proprietary - if ( status >= 0 ) - status = tidyCleanAndRepair( tdoc ); - - // runs diagnostics on the document for us, which shows additional information. - if ( status >= 0 ) - status = tidyRunDiagnostics( tdoc ); - - // save the tidy'd text to a string - if ( status >= 0) { - tidySaveBuffer( tdoc, outBuffer ); - [tidyText release]; - if (outBuffer->size > 0) - tidyText = [[NSString alloc] initWithCString:outBuffer->bp]; - else - tidyText = @""; - [tidyText retain]; - } - - // give the Tidy general info at the bottom. - tidyGeneralInfo( tdoc ); - - // copy the error buffer into an NSString - [errorText release]; - if (errBuffer->size > 0) - errorText = [[NSString alloc] initWithCString:errBuffer->bp]; - else - errorText = @""; - [errorText retain]; - - tidyBufFree(outBuffer); - tidyBufFree(errBuffer); // free the error buffer. -} // end peformTidy - - -/******************************************************************** - performTidyWithFile:toFile - run the operation using the already set options, but use file- - system I/O directly to eliminate possible strangeness with the - use of NSString (if any?). This wraps the native tidylib calls. - ********************************************************************/ --(void)performTidyWithFile:(NSString *)fSource:toFile:(NSString *)fDestination { - int status = 0; // status at each step of processing - - // setup the tidy options in the tdoc - [self prepareTidyOptions]; - - // parse the original text into the TidyDoc - status = tidyParseFile( tdoc, [fSource cString] ); - - // clean and repair -- this formats the document for us, and reports errors to stderr. - if ( status >= 0 ) - status = tidyCleanAndRepair( tdoc ); - - // runs diagnostics on the document for us. - if ( status >= 0 ) - status = tidyRunDiagnostics( tdoc ); - - // save the tidy'd text to a string - if ( status >= 0) - status = tidySaveFile( tdoc, [fDestination cString] ); - - // give the Tidy general info at the bottom. - tidyGeneralInfo( tdoc ); -} // end performTidyWithFile:toFile - - -@end // implementation CocoaTidy - - - -@implementation CocoaTidyOptions - -/////////////////////////////////////////////////////////////////////////////// -/// INITIALIZATION AND DESTRUCTION -/////////////////////////////////////////////////////////////////////////////// - -/******************************************************************** - init -- designated initializer! - Our creator. We need to set up our local variables. - ********************************************************************/ -- (id)init { - if (self = [super init]) { - encoding = @"raw"; - optRaw = YES; - } - return self; -} - -/******************************************************************** - dealloc - Our deallocator in order to dispose of finished variables. - ********************************************************************/ --(void)dealloc { - [encoding release]; - [super dealloc]; -} - -/////////////////////////////////////////////////////////////////////////////// -/// OPTION SETTING -- regular options -/////////////////////////////////////////////////////////////////////////////// - -// optIndent --(bool)optIndent { - return optIndent; -} --(void)optIndent:(bool)opt { - optIndent = opt; -} - -// optOmit --(bool)optOmit { - return optOmit; -} --(void)optOmit:(bool)opt { - optOmit = opt; -} - -// optWrapAtColumn --(bool)optWrapAtColumn { - return optWrapAtColumn; -} --(void)optWrapAtColumn:(bool)opt { - optWrapAtColumn = opt; -} - -// optWrapAtColumnNr --(int)optWrapAtColumnNr { - return optWrapAtColumnNr; -} --(void)optWrapAtColumnNr:(int)ColumnNr { - optWrapAtColumnNr = ColumnNr; -} - -// optUpper --(bool)optUpper { - return optUpper; -} --(void)optUpper:(bool)opt { - optUpper = opt; -} - -// optClean --(bool)optClean { - return optClean; -} --(void)optClean:(bool)opt { - optClean = opt; -} - -// optBare --(bool)optBare { - return optBare; -} --(void)optBare:(bool)opt { - optBare = opt; -} - -// optNumeric --(bool)optNumeric { - return optNumeric; -} --(void)optNumeric:(bool)opt { - optNumeric = opt; -} - -// optXML --(bool)optXML { - return optXML; -} --(void)optXML:(bool)opt { - optXML = opt; -} - -// optAsXHTML --(bool)optAsXHTML { - return optAsXHTML; -} --(void)optAsXHTML:(bool)opt{ - optAsXHTML = opt; -} - -// optAsHTML --(bool)optAsHTML { - return optAsHTML; -} --(void)optAsHTML:(bool)opt { - optAsHTML = opt; -} - -// optAccessLevel --(int)optAccessLevel { - return optAccessLevel; -} --(void)optAccessLevel:(int)opt { - optAccessLevel = opt; -} - - -/////////////////////////////////////////////////////////////////////////////// -/// OPTION SETTING -- encoding options -/////////////////////////////////////////////////////////////////////////////// - --(void)clearAllEncodings { - optRaw = NO; - optASCII = NO; - optLatin1 = NO; - optISO2022 = NO; - optUTF8 = NO; - optMac = NO; - optUTF16LE = NO; - optUTF16BE = NO; - optUTF16 = NO; - optWin1252 = NO; - optBig5 = NO; - optShiftJIS = NO; -} - --(bool)optRaw { - return optRaw; -} - --(void)optRaw:(bool)opt { - [self clearAllEncodings]; - [self setEncodingAsString:@"raw"]; - optRaw = YES; -} - --(bool)optASCII { - return optASCII; -} - --(void)optASCII:(bool)opt { - [self clearAllEncodings]; - [self setEncodingAsString:@"ascii"]; - optASCII = YES; -} - --(bool)optLatin1 { - return optLatin1; -} - --(void)optLatin1:(bool)opt { - [self clearAllEncodings]; - [self setEncodingAsString:@"latin1"]; - optLatin1 = YES; -} - --(bool)optISO2022 { - return optISO2022; -} - --(void)optISO2022:(bool)opt { - [self clearAllEncodings]; - [self setEncodingAsString:@"iso2022"]; - optISO2022 = YES; -} - --(bool)optUTF8 { - return optUTF8; -} - --(void)optUTF8:(bool)opt { - [self clearAllEncodings]; - [self setEncodingAsString:@"utf8"]; - optUTF8 = YES; -} - --(bool)optMac { - return optMac; -} - --(void)optMac:(bool)opt { - [self clearAllEncodings]; - [self setEncodingAsString:@"mac"]; - optMac = YES; -} - --(bool)optUTF16LE { - return optUTF16LE; -} - --(void)optUTF16LE:(bool)opt { - [self clearAllEncodings]; - [self setEncodingAsString:@"utf16le"]; - optUTF16LE = YES; -} - --(bool)optUTF16BE { - return optUTF16BE; -} - --(void)optUTF16BE:(bool)opt { - [self clearAllEncodings]; - [self setEncodingAsString:@"utf16be"]; - optUTF16BE = YES; -} - --(bool)optUTF16 { - return optUTF16; -} - --(void)optUTF16:(bool)opt { - [self clearAllEncodings]; - [self setEncodingAsString:@"utf16"]; - optUTF16 = YES; -} - --(bool)optWin1252 { - return optWin1252; -} - --(void)optWin1252:(bool)opt { - [self clearAllEncodings]; - [self setEncodingAsString:@"win1252"]; - optWin1252 = YES; -} - --(bool)optBig5 { - return optBig5; -} - --(void)optBig5:(bool)opt { - [self clearAllEncodings]; - [self setEncodingAsString:@"big5"]; - optBig5 = YES; -} - --(bool)optShiftJIS { - return optShiftJIS; -} - --(void)optShiftJIS:(bool)opt { - [self clearAllEncodings]; - [self setEncodingAsString:@"shiftjis"]; - optShiftJIS = YES; -} - --(NSString *)encoding { - return encoding; -} - --(void)setEncodingAsString:(NSString *)string { - [encoding release]; - encoding = [string lowercaseString]; - [encoding retain]; -} - - -@end // implementation CocoaTidyOptions diff --git a/Classes/JSDTidy.h b/Classes/JSDTidy.h deleted file mode 100755 index ab9c220b..00000000 --- a/Classes/JSDTidy.h +++ /dev/null @@ -1,85 +0,0 @@ -/*************************************************************************************** - JSDTidy.h - - A Cocoa wrapper for tidylib. - ***************************************************************************************/ - -#import -#import "tidy.h" -//#import "tidyenum.h" - -/**************************************************************************************************** - JSDTidyDocument - A basic TidyLib implementation in Cocoa. Tries to implement all of the "good stuff" from TidyLib, - including the TidyDoc object and methods to use it, options, and eventually true HTML parsing. - "See config.c" for all of Tidy's configuration options. - It should be completely self-contained but for linking to Foundation and tidy.h. - ****************************************************************************************************/ -@interface JSDTidyDocument : NSObject { - - TidyDoc tDoc; // the TidyDocument instance. Everything is performed on it. - NSString *originalText; // buffer for the original text. -} - -//--------------------------------------------- -// INITIALIZATION and DESTRUCTION -//--------------------------------------------- --(id)init; // override the initializer - designated initializer --(id)initWithString:(NSString *)string; // initialize with a string. --(id)initWithContentsOfFile:(NSString *)path; // initialize with a file. --(void)dealloc; // override the destructor. - -//--------------------------------------------- -// OPTIONS - methods for dealing with options -//--------------------------------------------- -+(TidyOptionId)optionIdForName:(NSString *)name; // returns the ID for the given name -+(NSString *)optionNameForId:(TidyOptionId)id; // returns the name for the given ID -+(TidyConfigCategory)optionCategoryForId:(TidyOptionId)id; // returns the category for the given ID -+(TidyOptionType)optionTypeForId:(TidyOptionId)id; // returns the type: string, int, or bool. -+(NSString *)optionDefaultValueForId:(TidyOptionId)id; // returns the factory default value for the given ID -+(uint)optionDefaultIntForId:(TidyOptionId)id; // returns the factory default value for the given ID -+(bool)optionDefaultBoolForId:(TidyOptionId)id; // returns the factory default value for the given ID -+(uint)optionIsReadOnlyForId:(TidyOptionId)id; // indicates whether the propery is read-only -+(NSArray *)optionPickListForId:(TidyOptionId)id; // returns an NSArray of NSString for the given ID - --(NSString *)optionValueForId:(TidyOptionId)id; // returns the value for the item as an NSString --(uint)optionIntForId:(TidyOptionId)id; // returns the value for the item as an integer --(bool)optionBoolForId:(TidyOptionId)id; // returns the value for the item as a bool --(void)setOptionValueForId:(TidyOptionId)id:fromString:(NSString *)value; // sets the value for the item --(void)setOptionIntForId:(TidyOptionId)id:fromInt:(int)value; // sets the value for the item as an integer --(void)setOptionBoolForId:(TidyOptionId)id:fromBool:(bool)value;// sets the value for the item as a bool - --(void)optionResetToDefaultForId:(TidyOptionId)id; // resets the designated ID to factory default --(void)optionResetAllToDefault; // resets all options to factory default - -//--------------------------------------------- -// DIAGNOSTICS and REPAIR -//--------------------------------------------- --(int)tidyDetectedHtmlVersion; // returns 0, 2, 3 or 4 --(bool)tidyDetectedXhtml; // determines whether the document is XHTML --(bool)tidyDetectedGenericXml; // determines if the document is generic XML. - --(int)tidyStatus; // returns 0 if there are no errors, 2 for doc errors, 1 for other. --(uint)tidyErrorCount; // returns number of document errors. --(uint)tidyWarningCount; // returns number of document warnings. --(uint)tidyAccessWarningCount; // returns number of document accessibility warnings. - -//--------------------------------------------- -// TEXT - the important, good stuff. -//--------------------------------------------- --(NSString *)originalText; // read the original text. --(void)originalText:(NSString *)text; // set the orginal text --(NSString *)tidyText; // read the tidy'd text. --(NSString *)errorText; // read the error text. - -//--------------------------------------------- -// MISCELLENEOUS - misc. Tidy methods supported -//--------------------------------------------- --(NSString *)tidyReleaseDate; // returns the TidyLib release date --(int)tidySaveFile:(NSString *)fileName; // saves the output to the designated file path. - -//--------------------------------------------- -// DOCUMENT TREE PARSING -- coming soon! -//--------------------------------------------- - -@end // JSDTidyDocument diff --git a/Classes/JSDTidy.m b/Classes/JSDTidy.m deleted file mode 100755 index 40c7310b..00000000 --- a/Classes/JSDTidy.m +++ /dev/null @@ -1,306 +0,0 @@ -/*************************************************************************************** - JSDTidy.m - - A Cocoa wrapper for tidylib. - ***************************************************************************************/ - -#import "JSDTidy.h" -#import "config.h" - -@implementation JSDTidyDocument - -//--------------------------------------------------------------------------------------- -// INITIALIZATION and DESTRUCTION -//--------------------------------------------------------------------------------------- - -/******************************************************************** - init (the designated initializer) - set up our local variables needed... - ********************************************************************/ --(id)init { - -} // init - -/******************************************************************** - initWithString - initialize with an existing string. - ********************************************************************/ --(id)initWithString:(NSString *)string { - -} // initWithString - -/******************************************************************** - initWithContentsOfFile - initialize with the contents of a file. - ********************************************************************/ --(id)initWithContentsOfFile:(NSString *)path { - -} // initWithContentsOfFile - -/******************************************************************** - dealloc - free up everything we've allocated (I hope) - ********************************************************************/ --(void)dealloc { - [super dealloc]; -} // dealloc - - -//--------------------------------------------------------------------------------------- -// OPTIONS - methods for dealing with options -//--------------------------------------------------------------------------------------- - -/******************************************************************** - optionIdForName - returns the ID for the given name. - ********************************************************************/ -+(TidyOptionId)optionIdForName:(NSString *)name { - -} // optionIdForName - -/******************************************************************** - optionNameForId - returns the name for the given ID - ********************************************************************/ -+(NSString *)optionNameForId:(TidyOptionId)id { - -} // optionNameForId - -/******************************************************************** - optionCategoryForId - returns the category for the given ID - ********************************************************************/ -+(TidyConfigCategory)optionCategoryForId:(TidyOptionId)id { - -} // optionCategoryForId - -/******************************************************************** - optionTypeForId - returns the type: string, int, or bool. - ********************************************************************/ -+(TidyOptionType)optionTypeForId:(TidyOptionId)id { - -} // optionTypeForId - -/******************************************************************** - optionDefaultValueForId - returns the factory default value for the given ID - ********************************************************************/ -+(NSString *)optionDefaultValueForId:(TidyOptionId)id { - -} // optionDefaultValueForId - -/******************************************************************** - optionDefaultIntForId - returns the factory default value for the given ID - ********************************************************************/ -+(uint)optionDefaultIntForId:(TidyOptionId)id { - -} // optionDefaultIntForId - -/******************************************************************** - optionDefaultBoolForId - returns the factory default value for the given ID - ********************************************************************/ -+(bool)optionDefaultBoolForId:(TidyOptionId)id { - -} // optionDefaultBoolForId - -/******************************************************************** - optionIsReadOnlyForId - indicates whether the propery is read-only - ********************************************************************/ -+(uint)optionIsReadOnlyForId:(TidyOptionId)id { - -} // optionIsReadOnlyForId - -/******************************************************************** - optionPickListForId - returns an NSArray of NSString for the given ID - ********************************************************************/ -+(NSArray *)optionPickListForId:(TidyOptionId)id { - -} // optionPickListForId - -/******************************************************************** - optionValueForId - returns the value for the item as an NSString - ********************************************************************/ --(NSString *)optionValueForId:(TidyOptionId)id { - -} // optionValueForId - -/******************************************************************** - optionIntForId - returns the value for the item as an intege - ********************************************************************/ --(uint)optionIntForId:(TidyOptionId)id { - -} // optionIntForId - -/******************************************************************** - optionBoolForId - returns the value for the item as a bool - ********************************************************************/ --(bool)optionBoolForId:(TidyOptionId)id { - -} // optionBoolForId - -/******************************************************************** - setOptionValueForId - sets the value for the item - ********************************************************************/ --(void)setOptionValueForId:(TidyOptionId)id:fromString:(NSString *)value { - -} // setOptionValueForId - -/******************************************************************** - setOptionIntForId - sets the value for the item as an integer - ********************************************************************/ --(void)setOptionIntForId:(TidyOptionId)id:fromInt:(int)value { - -} // setOptionIntForId - -/******************************************************************** - setOptionBoolForId - sets the value for the item as a bool - ********************************************************************/ --(void)setOptionBoolForId:(TidyOptionId)id:fromBool:(bool)value { - -} // setOptionBoolForId - -/******************************************************************** - optionResetToDefaultForId - resets the designated ID to factory default - ********************************************************************/ --(void)optionResetToDefaultForId:(TidyOptionId)id { - -} // optionResetToDefaultForId - -/******************************************************************** - optionResetAllToDefault - resets all options to factory default - ********************************************************************/ --(void)optionResetAllToDefault { - -} // optionResetAllToDefault - - -//--------------------------------------------------------------------------------------- -// DIAGNOSTICS and REPAIR -//--------------------------------------------------------------------------------------- - -/******************************************************************** - tidyDetectedHtmlVersion - returns 0, 2, 3 or 4 - ********************************************************************/ --(int)tidyDetectedHtmlVersion { - -} // tidyDetectedHtmlVersion - -/******************************************************************** - tidyDetectedXhtml - determines whether the document is XHTML - ********************************************************************/ --(bool)tidyDetectedXhtml { - -} // tidyDetectedXhtml - -/******************************************************************** - tidyDetectedGenericXml - determines if the document is generic XML. - ********************************************************************/ --(bool)tidyDetectedGenericXml { - -} // tidyDetectedGenericXml - -/******************************************************************** - tidyStatus - returns 0 if there are no errors, 2 for doc errors, 1 for other. - ********************************************************************/ --(int)tidyStatus { - -} // tidyStatus - -/******************************************************************** - tidyErrorCount - returns number of document errors. - ********************************************************************/ --(uint)tidyErrorCount { - -} // tidyErrorCount - -/******************************************************************** - tidyWarningCount - returns number of document warnings. - ********************************************************************/ --(uint)tidyWarningCount { - -} // tidyWarningCount - -/******************************************************************** - tidyAccessWarningCount - returns number of document accessibility warnings. - ********************************************************************/ --(uint)tidyAccessWarningCount { - -} // tidyAccessWarningCount - -//--------------------------------------------------------------------------------------- -// TEXT - the important, good stuff. -//--------------------------------------------------------------------------------------- - -/******************************************************************** - originalText - read the original text. - ********************************************************************/ --(NSString *)originalText { - -} // originalText - -/******************************************************************** - originalText - set the orginal text - ********************************************************************/ --(void)originalText:(NSString *)text { - -} // originalText - -/******************************************************************** - tidyText - read the tidy'd text. - ********************************************************************/ --(NSString *)tidyText { - -} // tidyText - -/******************************************************************** - errorText - read the error text. - ********************************************************************/ --(NSString *)errorText { - -} // errorText - -//--------------------------------------------------------------------------------------- -// MISCELLENEOUS - misc. Tidy methods supported -//--------------------------------------------------------------------------------------- - -/******************************************************************** - tidyReleaseDate - returns the TidyLib release date - ********************************************************************/ --(NSString *)tidyReleaseDate { - -} // tidyReleaseDate - -/******************************************************************** - tidySaveFile - saves the output to the designated file path. - ********************************************************************/ --(int)tidySaveFile:(NSString *)fileName { - -} // tidySaveFile - -@end // JSDTidyDocument diff --git a/Classes/JSDTidy/JSDTidy.h b/Classes/JSDTidy/JSDTidy.h new file mode 100644 index 00000000..20085bec --- /dev/null +++ b/Classes/JSDTidy/JSDTidy.h @@ -0,0 +1,197 @@ +/*************************************************************************************** + JSDTidy.h + + A Cocoa wrapper for tidylib. + + IMPORTANT NOTES: please see the file JSDTidy.rtf for some important notes. + "FORMAL" DOCUMENATATION: please see the file JSDTidy.html for the "formal," Apple- + style documentation. If it shows up as plain-text in + Project-Builder, right-click it and open-as an HTML file. + + ***************************************************************************************/ + +#import +#import "tidy.h" +#import "tidyenum.h" + +//----------------------------------------------------------------------------------------------------------------- +// SOME DEFINES +//----------------------------------------------------------------------------------------------------------------- +// In the prefs file, this prefix will prepend all TidyLib options stored there. This would only be used if you're +// using the convenience preferences methods defined in JSDTidyDocument that work with the native Cocoa preferences +// system. This "prefix" support exists in order to isolate the TidyLib configuration names from your own pref names. +#define tidyPrefPrefix @"-tidy-" + +// The keys for dealing with errors in errorArray, which is an array of NSDictionary objects with these keys. +#define errorKeyLevel @"level" +#define errorKeyLine @"line" +#define errorKeyColumn @"column" +#define errorKeyMessage @"message" + +// the default encoding styles that override the tidy-implemented character encodings. +#define defaultInputEncoding NSMacOSRomanStringEncoding +#define defaultLastEncoding NSMacOSRomanStringEncoding +#define defaultOutputEncoding NSMacOSRomanStringEncoding + + +/**************************************************************************************************** + JSDTidyDocument + A basic TidyLib implementation in Cocoa. Tries to implement all of the "good stuff" from TidyLib, + including the TidyDoc object and methods to use it, options, and eventually true HTML parsing. + "See config.c" for all of Tidy's configuration options. + It should be completely self-contained but for linking to Foundation and tidy.h. + ****************************************************************************************************/ +@interface JSDTidyDocument : NSObject { +//------------------------------------------------------------------------------------------------------------ +// INSTANCE VARIABLES -- they're protected for subclassing. Use the accessor methods instead of these. +//------------------------------------------------------------------------------------------------------------ +@protected + TidyDoc prefDoc; // the TidyDocument instance for HOLDING PREFERENCES and nothing more. + NSString *originalText; // buffer for the original text - Note this is an NSString instance. + NSString *workingText; // buffer the current working text - Note this an an NSString instance. + NSString *tidyText; // buffer for the tidy'd text - Note this is an NSString instance. + NSString *errorText; // buffer for the error text - This is a standard NSString. + NSMutableArray *errorArray; // buffer for the error text as an array of NSDictionary of the errors. + NSStringEncoding inputEncoding; // the user-specified input-encoding to process everything. OVERRIDE tidy. + NSStringEncoding lastEncoding; // the PREVIOUS user-specified input encoding. This is so we can REVERT. + NSStringEncoding outputEncoding; // the user-specified output-encoding to process everything. OVERRIDE tidy. +} + + +//------------------------------------------------------------------------------------------------------------ +// ENCODING SUPPORT +//------------------------------------------------------------------------------------------------------------ ++(NSArray *)allAvailableStringEncodings; // returns an array of NSStringEncoding. ++(NSArray *)allAvailableStringEncodingsNames; // returns an array of NSString, correlated to above. + +//------------------------------------------------------------------------------------------------------------ +// INITIALIZATION and DESTRUCTION +//------------------------------------------------------------------------------------------------------------ +-(id)init; // override the initializer - designated initializer +-(void)dealloc; // override the destructor. + +// the following convenience initializer assumes you know you're putting in a correctly-decoded NSString. +-(id)initWithString:(NSString *)value; // sets original & working text at initialization. + +// these convenience initializers will DECODE to the Unicode string using the default set for input-encoding +-(id)initWithFile:(NSString *)path; // initialize with a given file. +-(id)initWithData:(NSData *)data; // initialize with the given data. + + +//------------------------------------------------------------------------------------------------------------ +// TEXT - the important, good stuff. +//------------------------------------------------------------------------------------------------------------ + +//--------------------------------------------- +// originalText -- this allows an optional ref- +// erence copy of the really original text as +// a convenience for changes. The non-string +// set methods decode using the current en- +// coding set in input-encoding. +//--------------------------------------------- +-(NSString *)originalText; // read the original text as an NSString. +-(void)setOriginalText:(NSString *)value; // set the original & working text from an NSString. +-(void)setOriginalTextWithData:(NSData *)data; // set the original & working text from an NSData. +-(void)setOriginalTextWithFile:(NSString *)path; // set the original & working text from a file. + +//--------------------------------------------- +// workingText -- this is the text that Tidy +// will actually tidy up. The non-string set +// methods decode using the current encoding +// setting in input-encoding. +//--------------------------------------------- +-(NSString *)workingText; // read the working text as an NSString. +-(void)setWorkingText:(NSString *)value; // set the working text from an NSString. +-(void)setWorkingTextWithData:(NSData *)data; // set the working text from an NSData. +-(void)setWorkingTextWithFile:(NSString *)path; // set the working text from a file. + +//--------------------------------------------- +// tidyText -- this is the text that Tidy +// generates from the workingText. +//--------------------------------------------- +-(NSString *)tidyText; // return the tidy'd text. +-(NSData *)tidyTextAsData; // return the tidy'd text in the output-encoding format. +-(void)tidyTextToFile:(NSString *)path; // write the tidy'd text to a file in the current format. + +//--------------------------------------------- +// errors reported by tidy +//--------------------------------------------- +-(NSString *)errorText; // return the error text in traditional tidy format. +-(NSArray *)errorArray; // return the array of tidy errors and warnings. + +//--------------------------------------------- +// comparing the text. +//--------------------------------------------- +-(bool)areEqualOriginalWorking; // are the original and working text identical? +-(bool)areEqualWorkingTidy; // are the working and tidy text identical? +-(bool)areEqualOriginalTidy; // are the orginal and tidy text identical? + +//------------------------------------------------------------------------------------------------------------ +// OPTIONS - methods for dealing with options +//------------------------------------------------------------------------------------------------------------ ++(NSArray *) optionGetList; // returns an NSArray of NSString for all options built into Tidy. ++(int) optionCount; // returns the number of options built into Tidy. + ++(TidyOptionId) optionIdForName:(NSString *)name; // returns the TidyOptionId for the given option name. + ++(NSString *) optionNameForId:(TidyOptionId)idf; // returns the name for the given TidyOptionId. ++(TidyConfigCategory)optionCategoryForId:(TidyOptionId)idf; // returns the TidyConfigCategory for the given TidyOptionId. ++(TidyOptionType) optionTypeForId:(TidyOptionId)idf; // returns the TidyOptionType: string, int, or bool. ++(NSString *) optionDefaultValueForId:(TidyOptionId)idf; // returns the factory default value for the given TidyOptionId. ++(bool) optionIsReadOnlyForId:(TidyOptionId)idf; // indicates whether the option is read-only. ++(NSArray *) optionPickListForId:(TidyOptionId)idf; // returns an NSArray of NSString for the given TidyOptionId. + +-(NSString *) optionValueForId:(TidyOptionId)idf; // returns the value for the item as an NSString +-(void) setOptionValueForId:(TidyOptionId)idf // sets the value for the given TidyOptionId. + fromObject:(id)value; // Works with NSString or NSNumber only! + +-(void) optionResetToDefaultForId:(TidyOptionId)id;// resets the designated TidyOptionId to factory default +-(void) optionResetAllToDefault; // resets all options to factory default + +-(void) optionCopyFromDocument:(JSDTidyDocument *)theDocument; // sets options based on those in theDocument. + +//------------------------------------------------------------------------------------------------------------ +// RAW ACCESS EXPOSURE +//------------------------------------------------------------------------------------------------------------ +-(TidyDoc)tidyDocument; // return the TidyDoc attached to this instance. + +//------------------------------------------------------------------------------------------------------------ +// DIAGNOSTICS and REPAIR +//------------------------------------------------------------------------------------------------------------ +-(int) tidyDetectedHtmlVersion; // returns 0, 2, 3 or 4 +-(bool)tidyDetectedXhtml; // determines whether the document is XHTML. +-(bool)tidyDetectedGenericXml; // determines if the document is generic XML. + +-(int) tidyStatus; // returns 0 if there are no errors, 2 for doc errors, 1 for other. +-(uint)tidyErrorCount; // returns number of document errors. +-(uint)tidyWarningCount; // returns number of document warnings. +-(uint)tidyAccessWarningCount; // returns number of document accessibility warnings. + +// the errorFilter is the instance method that is called from the c-callback in the implementation file. So, callback-to-c-to-this. +-(bool)errorFilter:(TidyDoc)tDoc Level:(TidyReportLevel)lvl Line:(uint)line Column:(uint)col Message:(ctmbstr)mssg; + +//------------------------------------------------------------------------------------------------------------ +// MISCELLENEOUS - misc. Tidy methods supported +//------------------------------------------------------------------------------------------------------------ +-(NSString *)tidyReleaseDate; // returns the TidyLib release date + +//------------------------------------------------------------------------------------------------------------ +// SUPPORTED CONFIG LIST SUPPORT +//------------------------------------------------------------------------------------------------------------ ++(NSArray *)loadConfigurationListFromResource:(NSString *)fileName ofType:(NSString *)fileType; // get list of config options. + +//------------------------------------------------------------------------------------------------------------ +// MAC OS PREFS SUPPORT +//------------------------------------------------------------------------------------------------------------ ++(void)addDefaultsToDictionary:(NSMutableDictionary *)defaultDictionary; // sucks the defaults into a dictionary. ++(void)addDefaultsToDictionary:(NSMutableDictionary *)defaultDictionary // same as above, but with list of tidy options. + fromResource:(NSString *)fileName + ofType:(NSString *)fileType; +-(void)writeOptionValuesWithDefaults:(NSUserDefaults *)defaults; // write the values right into prefs. +-(void)takeOptionValuesFromDefaults:(NSUserDefaults *)defaults; // take config from passed-in defaults. + +//------------------------------------------------------------------------------------------------------------ +// DOCUMENT TREE PARSING -- coming soon! +//------------------------------------------------------------------------------------------------------------ + +@end // JSDTidyDocument diff --git a/Classes/JSDTidy/JSDTidy.m b/Classes/JSDTidy/JSDTidy.m new file mode 100644 index 00000000..bec18010 --- /dev/null +++ b/Classes/JSDTidy/JSDTidy.m @@ -0,0 +1,883 @@ +/*************************************************************************************** + JSDTidy.m + + A Cocoa wrapper for tidylib. + ***************************************************************************************/ + +#import "JSDTidy.h" +#import "buffio.h" +#import "config.h" + +// let the compiler know this function exists. +extern id objc_msgSend( id self, SEL op, ...); + +@implementation JSDTidyDocument + +/******************************************************************** + tidyCallbackFilter + In order to support TidyLib's callback function for process- + ing errors on the fly, we need to set up a standard C-function + to handle the callback. In the TidyDoc that we receive, we + will have put a pointer to self, so that we can call the + correct instance method from here. + ********************************************************************/ +BOOL tidyCallbackFilter ( TidyDoc tdoc, TidyReportLevel lvl, uint line, uint col, ctmbstr mssg ) { + typedef Bool (*myTemp)( id, SEL, TidyDoc, TidyReportLevel, uint, uint, ctmbstr ); // to cast objc_msgSend properly. + bool k = (myTemp)objc_msgSend((id)tidyGetAppData( tdoc ), @selector(errorFilter:Level:Line:Column:Message:), tdoc, lvl, line, col, mssg); + return k; +} // tidyCallbackFilter + + +//------------------------------------------------------------------------------------------------------------ +// ENCODING SUPPORT -- support the full extent of Mac OS X character encoding. +//------------------------------------------------------------------------------------------------------------ + +/******************************************************************** + encodingCompare (regular C-function). + Sort using the equivalent Mac encoding as the major key. + Secondary key is the actual encoding value, which works well. + Treat Unicode encodings as special case, and put them at top. + THIS ROUTINE BASED ON THE ROUTINE FROM THE TEXTEDIT EXAMPLE. + ********************************************************************/ +static int encodingCompare(const void *firstPtr, const void *secondPtr) { + CFStringEncoding first = *(CFStringEncoding *)firstPtr; + CFStringEncoding second = *(CFStringEncoding *)secondPtr; + CFStringEncoding macEncodingForFirst = CFStringGetMostCompatibleMacStringEncoding(first); + CFStringEncoding macEncodingForSecond = CFStringGetMostCompatibleMacStringEncoding(second); + if (first == second) return 0; // Should really never happen + if (macEncodingForFirst == kCFStringEncodingUnicode || macEncodingForSecond == kCFStringEncodingUnicode) { + if (macEncodingForSecond == macEncodingForFirst) return (first > second) ? 1 : -1; // Both Unicode; compare second order + return (macEncodingForFirst == kCFStringEncodingUnicode) ? -1 : 1; // First is Unicode + } // if + if ((macEncodingForFirst > macEncodingForSecond) || ((macEncodingForFirst == macEncodingForSecond) && (first > second))) return 1; + return -1; +} // encodingCompare + +/******************************************************************** + allAvailableStringEncodings + returns an array of all available string encodings on the current + system. The array is of NSNumber containing the NSStringEncoding. + This will also sort the list, and only includes those encodings + with human-readable names. + THIS ROUTINE BASED ON THE ROUTINE FROM THE TEXTEDIT EXAMPLE. + ********************************************************************/ ++(NSArray *)allAvailableStringEncodings { + static NSMutableArray *allEncodings = nil; // only do this once + if (!allEncodings) { + const CFStringEncoding *cfEncodings = CFStringGetListOfAvailableEncodings(); + CFStringEncoding *tmp; + int cnt, num = 0; + while (cfEncodings[num] != kCFStringEncodingInvalidId) num++; // Count + tmp = malloc(sizeof(CFStringEncoding) * num); + memcpy(tmp, cfEncodings, sizeof(CFStringEncoding) * num); // Copy the list + qsort(tmp, num, sizeof(CFStringEncoding), encodingCompare); // Sort it + allEncodings = [[NSMutableArray alloc] init]; // Now put it in an NSArray + for (cnt = 0; cnt < num; cnt++) { + NSStringEncoding nsEncoding = CFStringConvertEncodingToNSStringEncoding(tmp[cnt]); + if (nsEncoding && [NSString localizedNameOfStringEncoding:nsEncoding]) [allEncodings addObject:[NSNumber numberWithUnsignedInt:nsEncoding]]; + } // for + free(tmp); + } // if + return allEncodings; +} // allAvailableStringEncodings + +/******************************************************************** + allAvailableStringEncodingsNames + returns an array of all available string encodings on the current + system. The array is of NSString containing the human-readable + names of the encoding types. + ********************************************************************/ ++(NSArray *)allAvailableStringEncodingsNames { + static NSMutableArray *encodingNames = nil; // only do this once + if (!encodingNames) { + encodingNames = [[NSMutableArray alloc] init]; + NSArray *allEncodings = [[self class] allAvailableStringEncodings]; // reference the list of encoding numbers. + int cnt; // init counter. + int numEncodings = [allEncodings count]; // get number of encodings usable. + for (cnt = 0; cnt < numEncodings; cnt++) { // loop through the encodings present. + NSStringEncoding encoding = [[allEncodings objectAtIndex:cnt] unsignedIntValue]; // get the encoding type. + NSString *encodingName = [NSString localizedNameOfStringEncoding:encoding]; // get the encoding name. + [encodingNames addObject:encodingName]; // add to the array. + } // for + } // if + return encodingNames; +} // allAvailableStringEncodingsNames + +/******************************************************************** + fixSourceCoding + repairs the character decoding whenever the input-coding has + changed. This is the logic of how this works here: + o Our NSString is Unicode, and was decoded FROM lastEncoding. + o So using lastEncoding make the NSString into an NSData. + o Using inputEncoding, make the NSData into a new string. + We're going to process both originalText and workingText. + ********************************************************************/ +-(void)fixSourceCoding { + // only go through the trouble if the encoding isn't the same! + if (lastEncoding != inputEncoding) { + NSString *newText; + newText = [[NSString alloc] initWithData:[originalText dataUsingEncoding:lastEncoding] encoding:inputEncoding]; + [originalText release]; + originalText = newText; + newText = [[NSString alloc] initWithData:[workingText dataUsingEncoding:lastEncoding] encoding:inputEncoding]; + [workingText release]; + workingText = newText; +#warning HERE is where to call encodingChange event. + } // if +} // fixSourceCoding + + +//------------------------------------------------------------------------------------------------------------ +// INITIALIZATION and DESTRUCTION +//------------------------------------------------------------------------------------------------------------ + +/******************************************************************** + init (the designated initializer) + set up our local variables needed. + ********************************************************************/ +-(id)init { + if (self = [super init]) { + originalText = @""; // initialize the originalText. + workingText = @""; // initialize the workingText. + tidyText = @""; // initialize the tidyText. + errorText = @""; // initialize the errorText. + errorArray = [[NSMutableArray alloc] init]; // initialize the errorArray. + prefDoc = tidyCreate(); // create the preference container. + inputEncoding = defaultInputEncoding; // set default user-specified input-encoding. + lastEncoding = defaultLastEncoding; // set default user-specified previous encoding for reversion. + outputEncoding = defaultOutputEncoding; // set default user-specified output-encoding. + } + return self; +} // init + +/******************************************************************** + dealloc + free up everything we've allocated (I hope). + ********************************************************************/ +-(void)dealloc { + [originalText release]; + [workingText release]; + [tidyText release]; + [errorText release]; + [errorArray release]; + tidyRelease(prefDoc); + [super dealloc]; +} // dealloc + +/******************************************************************** + initWithString + initialize with an existing string. + ********************************************************************/ +-(id)initWithString:(NSString *)value { + [[self init] setOriginalText:value]; + return self; +} // initWithString + +/******************************************************************** + initWithFile + initialize with the contents of a file. + ********************************************************************/ +-(id)initWithFile:(NSString *)path { + [[self init] setOriginalTextWithFile:path]; + return self; +} // initWithFile + +/******************************************************************** + initWithData + initialize with the contents of a file. + ********************************************************************/ +-(id)initWithData:(NSData *)data { + [[self init] setOriginalTextWithData:data]; + return self; +} // initWithData + + +//------------------------------------------------------------------------------------------------------------ +// TEXT - the important, good stuff. +//------------------------------------------------------------------------------------------------------------ + +/******************************************************************** + processTidy - regard as PRIVATE + do the actual tidy processing to set the tidyText and errorText + ********************************************************************/ +-(void)processTidy { + // use a FRESH TidyDocument each time to cover up some issues with it. + TidyDoc newTidy = tidyCreate(); // this is the TidyDoc will will really process. Eventually will be prefDoc. + tidyOptCopyConfig( newTidy, prefDoc ); // put our preferences into the working copy newTidy. + + // setup the output buffer to copy to an NSString instead of writing to stdout + TidyBuffer *outBuffer = malloc(sizeof(TidyBuffer)); + tidyBufInit( outBuffer ); + + // setup the error buffer to catch errors here instead of stdout + tidySetAppData( newTidy, (uint)self ); // so we can send a message from outside ourself to ourself. + tidySetReportFilter( newTidy, (TidyReportFilter)&tidyCallbackFilter); // the callback will go to this out-of-class C function. + [errorArray removeAllObjects]; // clear out all of the previous errors. + TidyBuffer *errBuffer = malloc(sizeof(TidyBuffer)); // allocate a buffer for our error text. + tidyBufInit( errBuffer ); // init the buffer. + tidySetErrorBuffer( newTidy, errBuffer ); // and let tidy know to use it. + + // parse the workingText and clean, repair, and diagnose it. + tidyOptSetValue( newTidy, TidyCharEncoding, [@"utf8" cString] ); // set all internal char-encoding to UTF8. + tidyOptSetValue( newTidy, TidyInCharEncoding, [@"utf8" cString] ); // set all internal char-encoding to UTF8. + tidyOptSetValue( newTidy, TidyOutCharEncoding, [@"utf8" cString] ); // set all internal char-encoding to UTF8. +// tidyParseBuffer(newTidy, (void*)[[workingText dataUsingEncoding:NSUTF8StringEncoding] bytes]); // parse the original text into the TidyDoc + tidyParseString(newTidy, [workingText UTF8String]); // parse the original text into the TidyDoc + tidyCleanAndRepair( newTidy ); // clean and repair + tidyRunDiagnostics( newTidy ); // runs diagnostics on the document for us. + + // save the tidy'd text to an NSString + tidySaveBuffer( newTidy, outBuffer ); // save it to the buffer we set up above. + [tidyText release]; // release the current tidyText. + if (outBuffer->size > 0) { // case the buffer to an NSData that we can use to set the NSString. + tidyText = [[NSString alloc] initWithUTF8String:outBuffer->bp]; // make a string from the data. + } else + tidyText = @""; // set to null string -- no output. + [tidyText retain]; + + // give the Tidy general info at the bottom. + tidyErrorSummary (newTidy); + tidyGeneralInfo( newTidy ); + + // copy the error buffer into an NSString -- the errorArray is built using + // callbacks so we don't need to do anything at all to build it right here. + [errorText release]; + if (errBuffer->size > 0) + errorText = [[NSString alloc] initWithCString:errBuffer->bp]; + else + errorText = @""; + [errorText retain]; + + tidyBufFree(outBuffer); // free the output buffer. + tidyBufFree(errBuffer); // free the error buffer. + + // prefDoc has "good" preferences, not corrupted by tidy's processing. But we want to keep newTidy to expose it to + // the using application. So, we'll assign newTidy as prefDoc after putting prefDoc's preferences into newTidy. + tidyOptCopyConfig( newTidy, prefDoc ); // save our uncorrupted preferences. + tidyRelease(prefDoc); // kill the old prefDoc. + prefDoc = newTidy; // now prefDoc is the just-tidy'd document. +} // processTidy + +/******************************************************************** + originalText + read the original text as an NSString. + ********************************************************************/ +-(NSString *)originalText { + return originalText; +} // originalText + +/******************************************************************** + setOriginalText + set the original & working text from an NSString. + ********************************************************************/ +-(void)setOriginalText:(NSString *)value { + [value retain]; + [originalText release]; + originalText = value; + [self setWorkingText:originalText]; // will also process tidy. +} // setOriginalText + +/******************************************************************** + setOriginalTextWithData + set the original & working text from an NSData. Use the current + user-specified setting for input-encoding to decode. + ********************************************************************/ +-(void)setOriginalTextWithData:(NSData *)data { + [originalText release]; + originalText = [[NSString alloc] initWithData:data encoding:inputEncoding]; + [originalText retain]; + [self setWorkingText:originalText]; // will also process tidy. +} // setOriginalTextWithData + +/******************************************************************** + setOriginalTextWithFile + set the original & working text from a file. + ********************************************************************/ +-(void)setOriginalTextWithFile:(NSString *)path { + [originalText release]; + originalText = [[NSString alloc] initWithData:[NSData dataWithContentsOfFile:path] encoding:inputEncoding]; + [originalText retain]; + [self setWorkingText:originalText]; // will also process tidy. +} // setOriginalTextWithFile + +/******************************************************************** + workingText + read the original text as an NSString. + ********************************************************************/ +-(NSString *)workingText { + return workingText; +} // workingText + +/******************************************************************** + setWorkingText + set the original & working text from an NSString. + ********************************************************************/ +-(void)setWorkingText:(NSString *)value { + [value retain]; + [workingText release]; + workingText = value; + [self processTidy]; +} // setWorkingText + +/******************************************************************** + setWorkingTextWithData + set the original & working text from an NSData. + ********************************************************************/ +-(void)setWorkingTextWithData:(NSData *)data { + [workingText release]; + workingText = [[NSString alloc] initWithData:data encoding:inputEncoding]; + [workingText retain]; + [self processTidy]; +} // setWorkingTextWithData + +/******************************************************************** + setWorkingTextWithFile + set the original & working text from a file. + ********************************************************************/ +-(void)setWorkingTextWithFile:(NSString *)path { + [workingText release]; + workingText = [[NSString alloc] initWithData:[NSData dataWithContentsOfFile:path] encoding:inputEncoding]; + [workingText retain]; + [self processTidy]; +} // setWorkingTextWithFile + +/******************************************************************** + tidyText + return the tidy'd text. + ********************************************************************/ +-(NSString *)tidyText { + return tidyText; +} // tidyText + +/******************************************************************** + tidyTextAsData + return the tidy'd text in the output-encoding format. + ********************************************************************/ +-(NSData *)tidyTextAsData { + return [tidyText dataUsingEncoding:outputEncoding]; +} // tidyTextAsData + +/******************************************************************** + tidyTextToFile + write the tidy'd text to a file in the current format. + ********************************************************************/ +-(void)tidyTextToFile:(NSString *)path { + [[tidyText dataUsingEncoding:outputEncoding] writeToFile:path atomically:YES]; +} // tidyTextToFile + +/******************************************************************** + errorText + read the error text. + ********************************************************************/ +-(NSString *)errorText { + return errorText; +} // errorText + +/******************************************************************** + errorArray + read the error array. + ********************************************************************/ +-(NSArray *)errorArray { + return (NSArray *)errorArray; +} // errorArray + + +/******************************************************************** + areEqualOriginalWorking + are the original and working text identical? + ********************************************************************/ +-(bool)areEqualOriginalWorking { + return [originalText isEqualToString:workingText]; +} // areEqualOriginalWorking + +/******************************************************************** + areEqualWorkingTidy + are the working and tidy text identical? + ********************************************************************/ +-(bool)areEqualWorkingTidy { + return [tidyText isEqualToString:tidyText]; +} // areEqualWorkingTidy + +/******************************************************************** + areEqualOriginalTidy + are the orginal and tidy text identic + ********************************************************************/ +-(bool)areEqualOriginalTidy{ + return [originalText isEqualToString:tidyText]; +} // areEqualOriginalTidy + + +//------------------------------------------------------------------------------------------------------------ +// OPTIONS - methods for dealing with options +//------------------------------------------------------------------------------------------------------------ + +/******************************************************************** + isTidyEncodingOption + convenience method just to decide if an optionId is an Tidy + encoding option. + ********************************************************************/ ++(bool)isTidyEncodingOption:(TidyOptionId)opt { + return ( (opt == TidyCharEncoding) || (opt == TidyInCharEncoding) || (opt == TidyOutCharEncoding) ); +} // isTidyEncodingOption + +/******************************************************************** + optionGetOptionInstance -- regard as PRIVATE + given an option id, return an instance of a tidy option. This + is defined because inexplicably some of the TidyLib functions + require a "real" option in order to return data. + ********************************************************************/ ++(TidyOption)optionGetOptionInstance:(TidyOptionId)idf { + TidyDoc dummyDoc = tidyCreate(); // create a dummy document. + TidyOption result = tidyGetOption( dummyDoc, idf); // get an instance of an option. + tidyRelease(dummyDoc); // release the document. + return result; // return the instance of the option. +} // optionGetOptionInstance + +/******************************************************************** + optionGetList + returns an NSArray of NSString for all options built into Tidy. + ********************************************************************/ ++(NSArray *)optionGetList { + static NSMutableArray *theArray = nil; // just do this once. + if (!theArray) { + theArray = [[NSMutableArray alloc] init]; // create an array. + TidyDoc dummyDoc = tidyCreate(); // create a dummy document (we're a CLASS method). + TidyIterator i = tidyGetOptionList( dummyDoc ); // set up an iterator + while ( i ) { // loop... + TidyOption topt = tidyGetNextOption( dummyDoc, &i ); // get an option + [theArray addObject:[NSString stringWithCString:tidyOptGetName( topt )]]; // add the name to the array + } // while + tidyRelease(dummyDoc); // release the dummy document. + } // if + return theArray; // return the array of results. +} // optionGetList + +/******************************************************************** + optionCount + returns the number of Tidy options that exist. + ********************************************************************/ ++(int)optionCount { + return N_TIDY_OPTIONS; // defined in config.c of TidyLib +} // optionCount + +/******************************************************************** + optionIdForName + returns the TidyOptionId for the given option name. + ********************************************************************/ ++(TidyOptionId)optionIdForName:(NSString *)name { + TidyOptionId optID = tidyOptGetIdForName( [name cString] ); + if (optID < N_TIDY_OPTIONS) + return optID; // return the optionId. + return TidyUnknownOption; // optionId 0 is TidyUnknownOption +} // optionIdForName + +/******************************************************************** + optionNameForId + returns the name for the given TidyOptionId. + ********************************************************************/ ++(NSString *)optionNameForId:(TidyOptionId)idf { + return [NSString stringWithCString:tidyOptGetName( [self optionGetOptionInstance:idf] )]; +} // optionNameForId + +/******************************************************************** + optionCategoryForId + returns the TidyConfigCategory for the given TidyOptionId. + ********************************************************************/ ++(TidyConfigCategory)optionCategoryForId:(TidyOptionId)idf { + return tidyOptGetCategory( [self optionGetOptionInstance:idf] ); +} // optionCategoryForId + +/******************************************************************** + optionTypeForId + returns the TidyOptionType: string, int, or bool. + ********************************************************************/ ++(TidyOptionType)optionTypeForId:(TidyOptionId)idf { + return tidyOptGetType( [self optionGetOptionInstance:idf] ); +} // optionTypeForId + +/******************************************************************** + optionDefaultValueForId + returns the factory default value for the given TidyOptionId. + all values are converted to type NSString -- that's all we deal + with because Cocoa makes it sooooo easy to convert, and it + simplifies everything else -- we can use all one datatype. + We OVERRIDE the encoding options to return our own. + ********************************************************************/ ++(NSString *)optionDefaultValueForId:(TidyOptionId)idf { + // ENCODING OPTIONS -- special case, so handle first. + if ([self isTidyEncodingOption:idf]) { // override tidy encodings with our own. + if (idf == TidyCharEncoding) return [NSString stringWithFormat:@"%hu", defaultInputEncoding]; + if (idf == TidyInCharEncoding) return [NSString stringWithFormat:@"%hu", defaultInputEncoding]; + if (idf == TidyOutCharEncoding) return [NSString stringWithFormat:@"%hu", defaultOutputEncoding]; + } // if + + TidyOptionType optType = [JSDTidyDocument optionTypeForId:idf]; // get the option type + + if (optType == TidyString) { + ctmbstr tmp = tidyOptGetDefault( [self optionGetOptionInstance:idf] ); + return ( (tmp != nil) ? [NSString stringWithCString:tmp] : @"" ); // return either the string or null. + } // string type + + if (optType == TidyBoolean) { + return [NSString stringWithFormat:@"%hu", tidyOptGetDefaultBool( [self optionGetOptionInstance:idf] )]; // return string of the bool. + } // bool type + + if (optType == TidyInteger) { + return [NSString stringWithFormat:@"%hu", tidyOptGetDefaultInt( [self optionGetOptionInstance:idf] )]; // return string of the integer. + } // integer type + + return @""; +} // optionDefaultValueForId + + +/******************************************************************** + optionIsReadOnlyForId + indicates whether the option is read-only + ********************************************************************/ ++(bool)optionIsReadOnlyForId:(TidyOptionId)idf { + return tidyOptIsReadOnly( [self optionGetOptionInstance:idf] ); +} // optionIsReadOnlyForId + +/******************************************************************** + optionPickListForId + returns an NSArray of NSString for the given TidyOptionId + ********************************************************************/ ++(NSArray *)optionPickListForId:(TidyOptionId)idf { + NSMutableArray *theArray = [[[NSMutableArray alloc] init] autorelease]; // declare our return array + // if we're an encoding option, return OUR OWN pick list. + if ([self isTidyEncodingOption:idf]) { + return [[self class] allAvailableStringEncodingsNames]; + } // if + else { + TidyIterator i = tidyOptGetPickList( [self optionGetOptionInstance:idf] ); + while ( i ) + [theArray addObject:[NSString stringWithCString:tidyOptGetNextPick([self optionGetOptionInstance:idf], &i)]]; + } // else - if + + return theArray; +} // optionPickListForId + +/******************************************************************** + optionValueForId + returns the value for the item as an NSString + ********************************************************************/ +-(NSString *)optionValueForId:(TidyOptionId)idf { + + // we need to treat user-defined tags specially, 'cos TidyLib doesn't return them as config options! + if ((idf == TidyInlineTags) || (idf == TidyBlockTags) || (idf == TidyEmptyTags) || (idf == TidyPreTags)) { + NSMutableArray *theArray = [[[NSMutableArray alloc] init] autorelease]; + ctmbstr tmp; + TidyIterator i = tidyOptGetDeclTagList( prefDoc ); + while ( i ) { + tmp = tidyOptGetNextDeclTag(prefDoc, idf, &i); + if (tmp) + [theArray addObject:[NSString stringWithCString:tmp]]; + } // while + return [theArray componentsJoinedByString:@", "]; + } // if user-defined tags. + + // we need to treat encoding options specially, 'cos we're override Tidy's treatment of them. + if ( [[self class] isTidyEncodingOption:idf]) { + if (idf == TidyCharEncoding) return [[NSNumber numberWithInt:inputEncoding] stringValue]; + if (idf == TidyInCharEncoding) return [[NSNumber numberWithInt:inputEncoding] stringValue]; + if (idf == TidyOutCharEncoding) return [[NSNumber numberWithInt:outputEncoding] stringValue]; + } // if tidy coding option + + TidyOptionType optType = [JSDTidyDocument optionTypeForId:idf]; + + if (optType == TidyString) { + ctmbstr tmp = tidyOptGetValue( prefDoc, idf ); + return ( (tmp != nil) ? [NSString stringWithCString:tmp] : @"" ); + } // if string type + + if (optType == TidyBoolean) { + return [[NSNumber numberWithBool:tidyOptGetBool( prefDoc, idf )] stringValue]; + } // if bool type + + if (optType == TidyInteger) { + if (idf == TidyWrapLen) { + if (tidyOptGetInt( prefDoc, idf) == LONG_MAX) + return @"0"; + } // if - special occassion for TidyWrapLen + return [[NSNumber numberWithInt:tidyOptGetInt( prefDoc, idf )] stringValue]; + } // if integer type + + return @""; +} // optionValueForId + +/******************************************************************** + setOptionValueForId:fromObject + sets the value for the item + ********************************************************************/ +-(void)setOptionValueForId:(TidyOptionId)idf fromObject:(id)value { + // we need to treat encoding options specially, 'cos we're override Tidy's treatment of them. + if ( [[self class] isTidyEncodingOption:idf]) { + if (idf == TidyCharEncoding) { + lastEncoding = inputEncoding; + inputEncoding = [value unsignedIntValue]; + outputEncoding = [value unsignedIntValue]; + [self fixSourceCoding]; + } // if TidyCharEncoding; + if (idf == TidyInCharEncoding) { + lastEncoding = inputEncoding; + inputEncoding = [value unsignedIntValue]; + [self fixSourceCoding]; + } // if TidyInCharEncoding; + if (idf == TidyOutCharEncoding) { + outputEncoding = [value unsignedIntValue]; + } // if TidyOutCharEncoding; + return; + } // if tidy coding option + + // here we could be passed any object -- hope it's a string or number or bool! + if ([value isKindOfClass:[NSString class]]) + tidyOptParseValue( prefDoc, [[JSDTidyDocument optionNameForId:idf] cString], [value cString] ); + else + if ([value isKindOfClass:[NSNumber class]]) { + if ([JSDTidyDocument optionTypeForId:idf] == TidyBoolean) + tidyOptSetBool( prefDoc, idf, [value boolValue]); + else + if ([JSDTidyDocument optionTypeForId:idf] == TidyInteger) + tidyOptSetInt( prefDoc, idf, [value unsignedIntValue]); + } // if +} // setOptionValueForId:fromObject + +/******************************************************************** + optionResetToDefaultForId + resets the designated ID to factory default + ********************************************************************/ +-(void)optionResetToDefaultForId:(TidyOptionId)idf { + tidyOptResetToDefault( prefDoc, idf ); +} // optionResetToDefaultForId + +/******************************************************************** + optionResetAllToDefault + resets all options to factory default + ********************************************************************/ +-(void)optionResetAllToDefault { + tidyOptResetAllToDefault( prefDoc ); +} // optionResetAllToDefault + +/******************************************************************** + optionCopyFromDocument + copies all options from theDocument + ********************************************************************/ +-(void)optionCopyFromDocument:(JSDTidyDocument *)theDocument { + tidyOptCopyConfig( prefDoc, [theDocument tidyDocument] ); +} // optionCopyFromDocument + +//------------------------------------------------------------------------------------------------------------ +// RAW ACCESS EXPOSURE +//------------------------------------------------------------------------------------------------------------ + +/******************************************************************** + tidyDocument + return the address of prefDoc + ********************************************************************/ +-(TidyDoc)tidyDocument { + return prefDoc; +} // tidyDocument + + +//------------------------------------------------------------------------------------------------------------ +// DIAGNOSTICS and REPAIR +//------------------------------------------------------------------------------------------------------------ + +/******************************************************************** + tidyDetectedHtmlVersion + returns 0, 2, 3 or 4 + ********************************************************************/ +-(int)tidyDetectedHtmlVersion { + return tidyDetectedHtmlVersion( prefDoc ); +} // tidyDetectedHtmlVersion + +/******************************************************************** + tidyDetectedXhtml + determines whether the document is XHTML + ********************************************************************/ +-(bool)tidyDetectedXhtml { + return tidyDetectedXhtml( prefDoc ); +} // tidyDetectedXhtml + +/******************************************************************** + tidyDetectedGenericXml + determines if the document is generic XML. + ********************************************************************/ +-(bool)tidyDetectedGenericXml { + return tidyDetectedGenericXml( prefDoc ); +} // tidyDetectedGenericXml + +/******************************************************************** + tidyStatus + returns 0 if there are no errors, 2 for doc errors, 1 for other. + ********************************************************************/ +-(int)tidyStatus { + return tidyStatus( prefDoc ); +} // tidyStatus + +/******************************************************************** + tidyErrorCount + returns number of document errors. + ********************************************************************/ +-(uint)tidyErrorCount { + return tidyErrorCount( prefDoc ); +} // tidyErrorCount + +/******************************************************************** + tidyWarningCount + returns number of document warnings. + ********************************************************************/ +-(uint)tidyWarningCount { + return tidyWarningCount( prefDoc ); +} // tidyWarningCount + +/******************************************************************** + tidyAccessWarningCount + returns number of document accessibility warnings. + ********************************************************************/ +-(uint)tidyAccessWarningCount { + return tidyAccessWarningCount( prefDoc ); +} // tidyAccessWarningCount + +/******************************************************************** + errorFilter:Level:Line:Column:Message + This is the REAL TidyError filter, and is called by the + standard C tidyCallBackFilter function implemented at the + top of this file. We CAN'T setup standard C callbacks such + that they directly callback to an Obj-C method without + changing the C library to include Obj-C's hidden id and SEL + parameterss. So this is how it is. + ********************************************************************/ +-(bool)errorFilter:(TidyDoc)tDoc Level:(TidyReportLevel)lvl Line:(uint)line Column:(uint)col Message:(ctmbstr)mssg { + NSMutableDictionary *errorDict = [[NSMutableDictionary alloc] init]; // create a dictionary to hold the error report + [errorDict setObject:[NSNumber numberWithInt:lvl] forKey:errorKeyLevel]; + [errorDict setObject:[NSNumber numberWithInt:line] forKey:errorKeyLine]; + [errorDict setObject:[NSNumber numberWithInt:col] forKey:errorKeyColumn]; + [errorDict setObject:[NSString stringWithCString:mssg] forKey:errorKeyMessage]; + [errorArray addObject:errorDict]; + return YES; // always return yes so errorText works, also. +} // errorFilter:Level:Line:Column:Message + + +//------------------------------------------------------------------------------------------------------------ +// MISCELLENEOUS - misc. Tidy methods supported +//------------------------------------------------------------------------------------------------------------ + +/******************************************************************** + tidyReleaseDate + returns the TidyLib release date + ********************************************************************/ +-(NSString *)tidyReleaseDate { + return [NSString stringWithCString:tidyReleaseDate()]; +} // tidyReleaseDate + + +//------------------------------------------------------------------------------------------------------------ +// SUPPORTED CONFIG LIST SUPPORT +//------------------------------------------------------------------------------------------------------------ + +/******************************************************************** + loadConfigurationListFromResource:ofType -- CLASS method + returns an array of NSString from a file-resource. This compares + each item with the linked-in TidyLib to ensure items are support- + ed, and ensures there are no duplicates. There is nothing in + JSDTidyDocument that uses this except for the optional defaults + system support below, and it aids support of Balthisar + Tidy's preferences implementation. + ********************************************************************/ ++(NSArray *)loadConfigurationListFromResource:(NSString *)fileName ofType:(NSString *)fileType { + NSMutableArray *optionsInEffect = [[NSMutableArray alloc] init]; + NSString *contentPath = [[NSBundle mainBundle] pathForResource:fileName ofType:fileType]; + if (contentPath != nil) { + NSEnumerator *enumerator = [[[NSString stringWithContentsOfFile: contentPath] componentsSeparatedByString:@"\n"] objectEnumerator]; + NSString *tmpStr; + while (tmpStr = [enumerator nextObject]) { + if (([JSDTidyDocument optionIdForName:tmpStr] != 0) && (![optionsInEffect containsObject:tmpStr])) + [optionsInEffect addObject:tmpStr]; + } // while + } // if + return optionsInEffect; +} // loadConfigurationListFromResource:ofType + + +//------------------------------------------------------------------------------------------------------------ +// MAC OS PREFS SUPPORT +//------------------------------------------------------------------------------------------------------------ + +/******************************************************************** + addDefaultsToDictionary -- CLASS method + parses through EVERY default defined in Tidy to ascertain their + values and add them to the passed-in dictionary. Useful for + working with the Cocoa preference system. We DON'T register + the defaults because there may be other defaults to register. + The calling class can have other items in the passed-in + dictionary. + ********************************************************************/ ++(void)addDefaultsToDictionary:(NSMutableDictionary *)defaultDictionary { + NSEnumerator *enumerator = [[JSDTidyDocument optionGetList] objectEnumerator]; // uses ALL tidy options. + NSString *optionName; + while (optionName = [enumerator nextObject]) + [defaultDictionary setObject:[JSDTidyDocument optionDefaultValueForId:[JSDTidyDocument optionIdForName:optionName]] forKey:[tidyPrefPrefix stringByAppendingString:optionName]]; +} // addDefaultsToDictionary + + +/******************************************************************** + addDefaultsToDictionary:fromResource:ofType -- CLASS method + parses through EVERY default defined in the specified resource + file to ascertain their values and add them to the passed-in + dictionary. Useful for working with the Cocoa preference system. + We DON'T register the defaults because there may be other defaults + to register. The calling class can have other items in the + passed-in dictionary. Same as addDefaultsToDictionary, except + uses a resource file list of options, instead of ALL TidyLib + options. + ********************************************************************/ ++(void)addDefaultsToDictionary:(NSMutableDictionary *)defaultDictionary fromResource:(NSString *)fileName ofType:(NSString *)fileType { + NSEnumerator *enumerator = [[JSDTidyDocument loadConfigurationListFromResource:fileName ofType:fileType] objectEnumerator]; // just resource options. + NSString *optionName; + while (optionName = [enumerator nextObject]) + [defaultDictionary setObject:[JSDTidyDocument optionDefaultValueForId:[JSDTidyDocument optionIdForName:optionName]] forKey:[tidyPrefPrefix stringByAppendingString:optionName]]; +} // addDefaultsToDictionary + + +/******************************************************************** + writeOptionValuesWithDefaults + parses through the current configuration values and registers + the current value with the Cocoa preference system. We DO + register the preference changes, since the calling class can + also register its own changes when necessary. + ********************************************************************/ +-(void)writeOptionValuesWithDefaults:(NSUserDefaults *)defaults { + NSEnumerator *enumerator = [[JSDTidyDocument optionGetList] objectEnumerator]; // enumerate all built-in options. + NSString *optionName; // buffer for an option name. + while (optionName = [enumerator nextObject]) { // loop the enumerator. + TidyOptionId optId = [JSDTidyDocument optionIdForName:optionName]; // get the optionId + NSString *keyName = [tidyPrefPrefix stringByAppendingString:optionName]; // get the name + [defaults setObject:[self optionValueForId:optId] forKey:keyName]; // write the default + } // while +} // writeOptionValuesWithDefaults + + +/******************************************************************** + takeOptionValuesFromDefaults + given a defaults instance, attempts to set all of its options + from what's registered in the Apple defaults system. + ********************************************************************/ +-(void)takeOptionValuesFromDefaults:(NSUserDefaults *)defaults { + NSEnumerator *enumerator = [[JSDTidyDocument optionGetList] objectEnumerator]; // enumerate all built-in options. + NSString *optionName; + while (optionName = [enumerator nextObject]) { // loop the enumerator. + TidyOptionId optId = [JSDTidyDocument optionIdForName:optionName]; // get the current optionId. + TidyOptionType optType = [JSDTidyDocument optionTypeForId:optId]; // get the type. + NSString *keyName = [tidyPrefPrefix stringByAppendingString:optionName]; // get the key name + NSObject *myObj = [defaults objectForKey:keyName]; // get the object (value) from the prefs. + // we've got to convert TidyInteger items into NSNumbers to use them from here. We shouldn't HAVE to, + // but doctype-mode in TidyLib doesn't have a string parser, so we'll force integers to integers. + if (optType == TidyInteger) + [self setOptionValueForId:optId fromObject:[NSNumber numberWithInt:[(NSString *)myObj intValue]]]; + else + [self setOptionValueForId:optId fromObject:myObj]; + } +} // takeOptionValuesFromDefaults + +@end // JSDTidyDocument diff --git a/Classes/JSDTidy/JSDTidy.rtf b/Classes/JSDTidy/JSDTidy.rtf new file mode 100644 index 00000000..16a2b212 --- /dev/null +++ b/Classes/JSDTidy/JSDTidy.rtf @@ -0,0 +1,107 @@ +{\rtf1\mac\ansicpg10000\cocoartf102 +{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; +\f3\fmodern\fcharset77 CourierNewPSMT;} +{\colortbl;\red255\green255\blue255;} +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural + +\f0\b\fs48 \cf0 JSDTidy Documentation +\f1\b0\fs24 \ +\ + +\f0\b\fs26 Introduction +\f1\b0\fs24 \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qj +\cf0 JSDTidy is a Cocoa wrapper for most of the functionality of TidyLib (see http://tidy.sf.net), the current incarnation of Dave Ragget\'d5s original HTML Tidy program. TidyLib is a pure-C library written for the most cross-platform availability possible. Since Cocoa is decidely +\f2\i not +\f1\i0 cross-platform (meaning \'d2outside of Cocoa\'d3 independent of hardware), no effort is made in this wrapper to maintain any such cross-functionality. Additionally, because of features unique to Cocoa, some parts of TidyLib have been replaced by native Mac OS X routines (particularly file-encoding handling).\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural +\cf0 \ + +\f0\b\fs26 Usage +\f1\b0\fs24 \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qj +\cf0 JSDTidy defines the JSDTidyDocument class, instances of which perform all of the functionality of TidyLib. For the most part, usage can be determined by browsing through the documentation and comments that are in the header file. Additionally, a good, real-world resource that indicates actual implementation can be seen by looking at the source code for Balthisar Tidy (http://www.balthisar.com/tidy). Below, however, are some important notes that will greatly ease things for you as you try to use JSDTidy. +\f2\i JSDTidy should have come distributed with Balthisar Tidy! +\f1\i0 \ +\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural + +\f0\b\fs26 \cf0 Upgrading TidyLib +\f1\b0\fs24 \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qj +\cf0 As much as possible I've tried to use only public interfaces into TidyLib. Therefore you should be able to get the latest version of TidyLib and successfully compile it against JSDTidy.\ + +\f0\b\fs26 \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural +\cf0 Options and Data Types +\f1\b0\fs24 \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qj +\cf0 In Tidy parlance, options are called the \'d2configuration.\'d3 JSDTidy implements all of these as based on NSString, including values that are represented as numbers and booleans. This \CocoaLigature0 makes implementation as transparent as possible and avoids type mismatches, and makes especially easy the ability to process tidy options arbitrarily, i.e., without knowing which options are compiled in.\ +\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural + +\f0\b\fs26 \cf0 \CocoaLigature1 Options and Auto-Fixing +\f1\b0\fs24 \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qj +\cf0 \CocoaLigature0 After a TidyDocument in TidyLib has processed itself (that is, the document has been Tidy\'d5d), it \'d2fixes\'d3 the configuration settings, and doesn\'d5t leave tham at the desired setting. For example, if you set +\f3 text-indent +\f1 to +\f3 5 +\f1 , and set +\f3 indent +\f1 to +\f3 no +\f1 , TidyLib will automatically reset +\f3 text-indent +\f1 to +\f3 0 +\f1 after Tidy\'d5ing the document. This isn't a very pretty sight from user interface perspective. Therefore when managing Tidying preferences with an instance of JSDTidyDocument, it\'d5s recommend that this instance be used +\f2\i exclusively +\f1\i0 for managing preferences and that it never actually Tidy anything. This will ensure that the configuration values don\'d5t seem to randomly change for you. You can then use +\f0\b optionCopyFromDocument +\f1\b0 to get the configuration options from your configuration instance into the instance that will actually do the Tidy\'d5ing.\ +\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural + +\f0\b\fs26 \cf0 \CocoaLigature1 Character Encoding +\f1\b0\fs24 \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qj +\cf0 \CocoaLigature0 The handling of character encoding in JSDTidy is admittedly the biggest weakness of previous JSDTidy and Balthisar Tidy releases. Both Cocoa and TidyLib offer file-encoding transformations and both can handle files are various encodings. It seems, however, that the Mac OS is more capable than Tidy when it comes to the number of encoding formats available, as well as having the benefit of being built-in to the operating system. Because of this, JSDTidy will override all use of TidyLib file encoding configuration options! Because file encoding can be quite complicated, it\'d5s essential that you know how JSDTidy expects to handle file encoding.\ + The essence of how JSDTidy handles character encoding can best be described (such are my talents) with this thought excercise: You have +\f0\b file +\f1\b0 which happens to exist using +\f0\b mac +\f1\b0 encoding. Your JSDTidyDocument is already configured such that it expects +\f0\b latin1 +\f1\b0 text. You load the file into the JSDTidyDocument as NSData, which is a binary copy of the file. JSDTidyDocument then decodes this file as if it were +\f0\b mac +\f1\b0 encoded, and builds a Unitext NSString called +\f0\b originalText +\f1\b0 . Since the +\f0\b originalText +\f1\b0 changed (you just loaded a file causing it change), the Unicode NSString +\f0\b tidyText +\f1\b0 is generated, too. The program copies the +\f0\b originalText +\f1\b0 into an NSTextView to be edited, and the user edits it. All this time, the program is keeping the sourceText in sync with the NSTextView, i.e., updating the +\f0\b originalText +\f1\b0 . The user, though, realizes the encoding is wrong, and changes the JSDTidyDocument input-encoding to the proper +\f0\b mac +\f1\b0 type for this document. JSDTidyDocument will then convert +\f0\b originalText +\f1\b0 from the Unicode NSString +\f2\i back +\f1\i0 to latin1. Note that it's not +\f2\i really +\f1\i0 converting to +\f0\b latin1 +\f1\b0 , since it was never +\f0\b latin1 +\f1\b0 in the first place, but merely reversing the bad conversion from +\f0\b latin1 +\f1\b0 . JSDTidyDocument will then convert from this reverted state to another Unicode NSString using the +\f0\b mac +\f1\b0 encoding. The only possible information loss will be whatever the user changed before setting the correct encoding.\ + Hence, our standard for internal data storage will be NSString, which is internally Unicode encoded. Once we're in this Unicode format, we can freely change between formats with little effort.\ + \ + } \ No newline at end of file diff --git a/Classes/MyDocument.h b/Classes/MyDocument.h deleted file mode 100755 index 74602797..00000000 --- a/Classes/MyDocument.h +++ /dev/null @@ -1,42 +0,0 @@ -/*************************************************************************************** - MyDocument.h -- part of Balthisar Tidy - - The main document controller. Here we'll control the following: - o - ***************************************************************************************/ - -#import -#import - -@interface MyDocument : NSDocument -{ - NSString *processString; // string to hold for processing/loading - - // view outlets - IBOutlet NSTextView *sourceView; // pointer to the source HTML view. - IBOutlet NSTextView *tidyView; // pointer to the tidy'd HTML view. - IBOutlet NSTextView *errorView; // pointer to where to display the error messages. - - // tidy controls - IBOutlet NSButton *checkIndent; - IBOutlet NSButton *checkOmit; - IBOutlet NSButton *checkWrap; - IBOutlet NSTextField *valWrap; - IBOutlet NSButton *checkUppercase; - IBOutlet NSButton *checkClean; - IBOutlet NSButton *checkBare; - IBOutlet NSButton *checkNumeric; - IBOutlet NSButton *checkXML; - IBOutlet NSPopUpButton *menuEncoding; - - // internally-used instance variables. - CocoaTidy* tidyProcess; // our tidy wrapper/processor. - int saveBehavior; // the save behavior from the preferences. - bool saveWarning; // the warning behavior for when saveBehavior == 1; - bool yesSavedAs; // disable warnings and protections once a save-as has been done. - bool tidyOriginalFile; // flags whether the file was CREATED by Tidy, for writing type/creator codes. -} - -- (IBAction)optionChanged:(id)sender; // react to a tidy'ing control being changed. - -@end diff --git a/Classes/PreferenceController.h b/Classes/PreferenceController.h deleted file mode 100755 index b0745c6c..00000000 --- a/Classes/PreferenceController.h +++ /dev/null @@ -1,36 +0,0 @@ -/*************************************************************************************** - PreferenceController.h -- part of Balthisar Tidy - - The main preference controller. Here we'll control the following: - o Handles the application preferences. - o Implements class methods to be used before instantiation. - ***************************************************************************************/ - -#import - -@interface PreferenceController : NSWindowController { - IBOutlet NSButton *indent; - IBOutlet NSButton *omit; - IBOutlet NSButton *wrap; - IBOutlet NSTextField *wrapColumn; - IBOutlet NSButton *uppercase; - IBOutlet NSButton *clean; - IBOutlet NSButton *bare; - IBOutlet NSButton *numeric; - IBOutlet NSButton *xmlOutput; - IBOutlet NSPopUpButton *encoding; - - IBOutlet NSButton *saving1; - IBOutlet NSButton *saving2; - IBOutlet NSButton *savingWarn; - - IBOutlet NSButton *batchSaving1; - IBOutlet NSButton *batchSaving2; -} -+(NSString *)keyNameForKeyNumber:(int)keyNr; -+(void)registerUserDefaults; - --(IBAction)preferenceChanged:(id)sender; --(IBAction)radioSavingChanged:(id)sender; --(IBAction)radioBatchChanged:(id)sender; -@end diff --git a/Classes/PreferenceController.m b/Classes/PreferenceController.m deleted file mode 100755 index 1c4c84ed..00000000 --- a/Classes/PreferenceController.m +++ /dev/null @@ -1,172 +0,0 @@ -/*************************************************************************************** - PreferenceController.m -- part of Balthisar Tidy - - The main preference controller. Here we'll control the following: - o Handles the application preferences. - o Implements class methods to be used before instantiation. - ***************************************************************************************/ - -#import -#import "PreferenceController.h" - -@implementation PreferenceController - -/******************************************************************** - keyNameForKeyNumber -- CLASS method. - returns the key name for the given key number. We're going - to use numbers instenally to reference given preferences, for - programming convenience. But, we want the keys to have names - for the preferences file. -*********************************************************************/ -+(NSString *)keyNameForKeyNumber:(int)keyNr { - return [[NSArray arrayWithObjects: @"IndentElements", // 0 - @"OmitOptionalContent", // 1 - @"WrapEnabled", // 2 - @"WrapColumnNumber", // 3 - @"UppercaseElements", // 4 - @"CleanWithCSS", // 5 - @"BareConvertSymbols", // 6 - @"Numeric", // 7 - @"XMLOutput", // 8 - @"EncodingStlye", // 9 - @"SavingPrefStyle", // 10 - @"WarnBeforeOverwrite", // 11 - @"OBSOLETE", // 12 - @"OBSOLETE", // 13 - @"BatchSavingPrefStyle", // 14 - @"OBSOLETE", // 15 - @"OBSOLETE", // 16 - nil] objectAtIndex:keyNr]; -} - -/******************************************************************** - registerUserDefaults -- CLASS method. - register all of the user defaults. Implemented as a CLASS - method in order to keep this with the preferences controller, - but the preferences controller won't have been created yet! -*********************************************************************/ -+(void)registerUserDefaults { - NSMutableDictionary *defaultValues = [NSMutableDictionary dictionary]; // create a dictionary - // put all of the defaults in the dictionary - [defaultValues setObject:[NSNumber numberWithBool:YES] forKey:[PreferenceController keyNameForKeyNumber:0]]; - [defaultValues setObject:[NSNumber numberWithBool:NO] forKey:[PreferenceController keyNameForKeyNumber:1]]; - [defaultValues setObject:[NSNumber numberWithBool:NO] forKey:[PreferenceController keyNameForKeyNumber:2]]; - [defaultValues setObject:[NSNumber numberWithInt:72] forKey:[PreferenceController keyNameForKeyNumber:3]]; - [defaultValues setObject:[NSNumber numberWithBool:YES] forKey:[PreferenceController keyNameForKeyNumber:4]]; - [defaultValues setObject:[NSNumber numberWithBool:NO] forKey:[PreferenceController keyNameForKeyNumber:5]]; - [defaultValues setObject:[NSNumber numberWithBool:NO] forKey:[PreferenceController keyNameForKeyNumber:6]]; - [defaultValues setObject:[NSNumber numberWithBool:NO] forKey:[PreferenceController keyNameForKeyNumber:7]]; - [defaultValues setObject:[NSNumber numberWithBool:NO] forKey:[PreferenceController keyNameForKeyNumber:8]]; - [defaultValues setObject:[NSNumber numberWithInt:0] forKey:[PreferenceController keyNameForKeyNumber:9]]; - [defaultValues setObject:[NSNumber numberWithInt:2] forKey:[PreferenceController keyNameForKeyNumber:10]]; - [defaultValues setObject:[NSNumber numberWithBool:NO] forKey:[PreferenceController keyNameForKeyNumber:11]]; - [defaultValues setObject:[NSNumber numberWithInt:1] forKey:[PreferenceController keyNameForKeyNumber:14]]; - // register the defaults - [[NSUserDefaults standardUserDefaults] registerDefaults: defaultValues]; -} - -/******************************************************************** - init - Our creator -- we want to load the nib "Preferences". -*********************************************************************/ -- (id)init { - if (self = [super initWithWindowNibName:@"Preferences"]) { - [self setWindowFrameAutosaveName:@"PrefWindow"]; - } - return self; -} - -/******************************************************************** - dealloc - clean up. -*********************************************************************/ -- (void)dealloc -{ - [super dealloc]; -} - -/******************************************************************** - windowDidLoad - when the window has loaded, let's put the correct preferences on. -*********************************************************************/ -- (void)windowDidLoad { - NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; - //NSLog(@"Now starting to unpack preferences..."); - [indent setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:0]]]; - [omit setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:1]]]; - [wrap setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:2]]]; - [wrapColumn setStringValue:[defaults stringForKey: [PreferenceController keyNameForKeyNumber:3]]]; - [uppercase setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:4]]]; - [clean setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:5]]]; - [bare setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:6]]]; - [numeric setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:7]]]; - [xmlOutput setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:8]]]; - [encoding selectItemAtIndex:[defaults integerForKey: [PreferenceController keyNameForKeyNumber:9]]]; - - [saving1 setState:([defaults integerForKey: [PreferenceController keyNameForKeyNumber:10]] == 1)]; - [saving2 setState:([defaults integerForKey: [PreferenceController keyNameForKeyNumber:10]] == 2)]; - [savingWarn setState:[defaults boolForKey: [PreferenceController keyNameForKeyNumber:11]]]; - [savingWarn setEnabled:[saving1 state]]; - - [batchSaving1 setState:([defaults integerForKey: [PreferenceController keyNameForKeyNumber:14]] == 1)]; - [batchSaving2 setState:([defaults integerForKey: [PreferenceController keyNameForKeyNumber:14]] == 2)]; -} - -/******************************************************************** - radioSavingChanged - one of the radio buttons for saving options has changed. - Handle this apart, since we're not using a matrix. -*********************************************************************/ --(IBAction)radioSavingChanged:(id)sender { - [saving1 setState:NO]; - [saving2 setState:NO]; - [sender setState:YES]; - [savingWarn setEnabled:[saving1 state]]; - [self preferenceChanged:nil]; -} - - -/******************************************************************** - radioBatchChanged - one of the radio buttons for batch options has changed. - Handle this apart, since we're not using a matrix. -*********************************************************************/ --(IBAction)radioBatchChanged:(id)sender { - [batchSaving1 setState:NO]; - [batchSaving2 setState:NO]; - [sender setState:YES]; - [self preferenceChanged:nil]; -} - -/******************************************************************** - preferenceChanged - one of the preferences changed. Log ALL of them at once for - simplicity. No need to track them separately. -*********************************************************************/ --(IBAction)preferenceChanged:(id)sender { - int i = 0; - // update the preference registry - [[NSUserDefaults standardUserDefaults] setBool:[indent state] forKey:[PreferenceController keyNameForKeyNumber:0]]; - [[NSUserDefaults standardUserDefaults] setBool:[omit state] forKey:[PreferenceController keyNameForKeyNumber:1]]; - [[NSUserDefaults standardUserDefaults] setBool:[wrap state] forKey:[PreferenceController keyNameForKeyNumber:2]]; - [[NSUserDefaults standardUserDefaults] setObject:[wrapColumn stringValue] forKey:[PreferenceController keyNameForKeyNumber:3]]; - [[NSUserDefaults standardUserDefaults] setBool:[uppercase state] forKey:[PreferenceController keyNameForKeyNumber:4]]; - [[NSUserDefaults standardUserDefaults] setBool:[clean state] forKey:[PreferenceController keyNameForKeyNumber:5]]; - [[NSUserDefaults standardUserDefaults] setBool:[bare state] forKey:[PreferenceController keyNameForKeyNumber:6]]; - [[NSUserDefaults standardUserDefaults] setBool:[numeric state] forKey:[PreferenceController keyNameForKeyNumber:7]]; - [[NSUserDefaults standardUserDefaults] setBool:[xmlOutput state] forKey:[PreferenceController keyNameForKeyNumber:8]]; - [[NSUserDefaults standardUserDefaults] setInteger:[encoding indexOfSelectedItem] forKey:[PreferenceController keyNameForKeyNumber:9]]; - - if ([saving1 state]) i = 1; - if ([saving2 state]) i = 2; - [[NSUserDefaults standardUserDefaults] setInteger:i forKey:[PreferenceController keyNameForKeyNumber:10]]; - [[NSUserDefaults standardUserDefaults] setBool:[savingWarn state] forKey:[PreferenceController keyNameForKeyNumber:11]]; - // send the notification that a saving preference has changed! - [[NSNotificationCenter defaultCenter] postNotificationName:@"JSDSavePrefChange" object:nil]; - - [[NSUserDefaults standardUserDefaults] setInteger:0 forKey:[PreferenceController keyNameForKeyNumber:14]]; - if ([batchSaving1 state]) [[NSUserDefaults standardUserDefaults] setInteger:1 forKey:[PreferenceController keyNameForKeyNumber:14]]; - if ([batchSaving2 state]) [[NSUserDefaults standardUserDefaults] setInteger:2 forKey:[PreferenceController keyNameForKeyNumber:14]]; -} - -@end diff --git a/Classes/Support Pieces/JSDTableColumn.h b/Classes/Support Pieces/JSDTableColumn.h new file mode 100644 index 00000000..c75b864e --- /dev/null +++ b/Classes/Support Pieces/JSDTableColumn.h @@ -0,0 +1,28 @@ +/*************************************************************************************** + JSDTableColumn.h + + implement dataCellForRow so that we can use different cells in any row of a table. + + FOR SOME REASON, you cannot implement this in IB -- you'll have to swap out the + type in awakeFromNib in the controller that you use. See these methods to assist: + initReplacingColumn: + initReplacingColumnId: + swapForTableColumn: + ***************************************************************************************/ + +#import + +@interface JSDTableColumn : NSTableColumn { + +} + +- (id)initReplacingColumn:(NSTableColumn *)aColumn; // initializer that replaces an existing column with this one. + +- (id)dataCellForRow:(int)row; // calls the delegate for each column to get the data cell. +- (void)swapForTableColumn:(NSTableColumn *)aColumn; // swaps this instance of JSDTableColumn for an existing one. + +-(NSCell *)usefulCheckCell; +-(NSCell *)usefulRadioCell; +-(NSCell *)usefulPopUpCell:(NSArray *)picks; + +@end diff --git a/Classes/Support Pieces/JSDTableColumn.m b/Classes/Support Pieces/JSDTableColumn.m new file mode 100644 index 00000000..02ea0aae --- /dev/null +++ b/Classes/Support Pieces/JSDTableColumn.m @@ -0,0 +1,121 @@ +/*************************************************************************************** + JSDTableColumn.m + + implement dataCellForRow so that we can use different cells in any row of a table. + + FOR SOME REASON, you cannot implement this in IB -- you'll have to swap out the + type in awakeFromNib in the controller that you use. You can use the method + swapForTableColumn: for this purpose. + ***************************************************************************************/ + +#import +#import "JSDTableColumn.h" + +@implementation JSDTableColumn : NSTableColumn + +/******************************************************************** + initReplacingColumn: + initialize ourself and replace "aColumn" in its table. +*********************************************************************/ +- (id)initReplacingColumn:(NSTableColumn *)aColumn { + if ([super initWithIdentifier:[aColumn identifier]]) { + [self swapForTableColumn:aColumn]; + } + return self; +} // initReplacingColumn + + +/******************************************************************** + dataCellForRow: + we're going to call the delegate for a cell, if one exists. +*********************************************************************/ +- (id)dataCellForRow:(int)row { + + // make sure there's a tableview and a delegate and that the row isn't -1. + if ( ([self tableView] == nil) || ([[self tableView] delegate] == nil) || (row == -1) ) + return [super dataCellForRow:row]; + + // see if the routine exists + if ( ! [ [ [self tableView] delegate] respondsToSelector:@selector(tableColumn:customDataCellForRow:)] ) + return [super dataCellForRow:row]; + + // try getting the cell we want from the delegate routine -- ignore the compiler warning. + id cell = [[[self tableView] delegate] tableColumn:self customDataCellForRow:row]; + if (cell != nil) + return cell; // not nil, so return what we got. + + return [super dataCellForRow:row]; // nothing there, so call the inherited method. +} // dataCellForRow + + +/******************************************************************** + swapForTableColumn: + convenience method that allows us to substitute ourself for + an existing table column. +*********************************************************************/ +- (void)swapForTableColumn:(NSTableColumn *)oldTableColumn { + NSTableView *table = [oldTableColumn tableView]; // get the tableview the old column is part of + if (table == nil) // do nothing if there's no table + return; + + // copy the old column properties. + [self setWidth:[oldTableColumn width]]; + [self setMinWidth:[oldTableColumn minWidth]]; + [self setMaxWidth:[oldTableColumn maxWidth]]; + [self setResizable:[oldTableColumn isResizable]]; + [self setEditable:[oldTableColumn isEditable]]; + [self setHeaderCell:[oldTableColumn headerCell]]; + [self setDataCell:[oldTableColumn dataCell]]; + + // Swap table column + [table addTableColumn:self]; + // put the new column in the correct spot + [table moveColumn:[[table tableColumns] indexOfObject:self] toColumn:[[table tableColumns] indexOfObject:oldTableColumn]]; + // remove the old column -- we know it's position was i + [table removeTableColumn:oldTableColumn]; +} // swapForTableColumn + + +/******************************************************************** + usefulCheckCell: + return a useful cell type. +*********************************************************************/ +-(NSCell *)usefulCheckCell { + NSButtonCell *myCell = [[[NSButtonCell alloc] initTextCell: @""] autorelease]; + [myCell setEditable: YES]; + [myCell setButtonType:NSSwitchButton]; + [myCell setImagePosition:NSImageOnly]; + [myCell setControlSize:NSSmallControlSize]; + return myCell; +} // usefulCheckCell; + + +/******************************************************************** + usefulRadioCell: + return a useful cell type. +*********************************************************************/ +-(NSCell *)usefulRadioCell { + NSButtonCell *myCell = [[[NSButtonCell alloc] initTextCell: @""] autorelease]; + [myCell setEditable: YES]; + [myCell setButtonType:NSRadioButton]; + [myCell setImagePosition:NSImageOnly]; + [myCell setControlSize:NSSmallControlSize]; + return myCell; +} // usefulRadioCell + + +/******************************************************************** + usefulPopUpCell: + return a useful cell type. +*********************************************************************/ +-(NSCell *)usefulPopUpCell:(NSArray *)picks { + NSPopUpButtonCell *myCell = [[[NSPopUpButtonCell alloc] initTextCell: @"" pullsDown:NO] autorelease]; + [myCell setEditable: YES]; + [myCell setBordered:YES]; + [myCell addItemsWithTitles:picks]; + [myCell setControlSize:NSSmallControlSize]; + [myCell setFont:[NSFont menuFontOfSize:10]]; + return myCell; +} // usefulPopCell + +@end \ No newline at end of file diff --git a/Classes/Support Pieces/JSDTableView.h b/Classes/Support Pieces/JSDTableView.h new file mode 100644 index 00000000..3bdb1383 --- /dev/null +++ b/Classes/Support Pieces/JSDTableView.h @@ -0,0 +1,22 @@ +/*************************************************************************************** + JSDTableView.h + + override TextDidEndEditing so that after changing a value, the selection doesn't + advance to the next text field. + + FOR SOME REASON, you cannot implement this in IB -- you'll have to swap out the + type in awakeFromNib in the controller that you use. See these methods to assist: + initReplacingTableView: + ***************************************************************************************/ + +#import + + +@interface JSDTableView : NSTableView { + +} + +- (void)textDidEndEditing:(NSNotification *)notification; // overridden to prevent auto-advancing of cell focus + + +@end diff --git a/Classes/Support Pieces/JSDTableView.m b/Classes/Support Pieces/JSDTableView.m new file mode 100644 index 00000000..65767dea --- /dev/null +++ b/Classes/Support Pieces/JSDTableView.m @@ -0,0 +1,42 @@ +/*************************************************************************************** + JSDTableView.h + + override TextDidEndEditing so that after changing a value, the selection doesn't + advance to the next text field. + + FOR SOME REASON, you cannot implement this in IB -- you'll have to swap out the + type in awakeFromNib in the controller that you use. See these methods to assist: + initReplacingTableView: + ***************************************************************************************/ + + +#import "JSDTableView.h" + + +@implementation JSDTableView + +/******************************************************************** + textDidEndEditing: + make the tableview not advance to the next focusable item unless + the user uses the tab/shift-tab key. +*********************************************************************/ +- (void)textDidEndEditing:(NSNotification *)aNotification { + //This is ugly, but just about the only way to do it. NSTableView + //is determined to select and edit something else, even the text field + //that it just finished editing, unless we mislead it about what key + //was pressed to end editing. + NSMutableDictionary *newUserInfo; + NSNotification *newNotification; + + newUserInfo = [NSMutableDictionary dictionaryWithDictionary:[aNotification userInfo]]; + [newUserInfo setObject:[NSNumber numberWithInt:0] forKey:@"NSTextMovement"]; + newNotification = [NSNotification notificationWithName:[aNotification name] object:[aNotification object] userInfo:newUserInfo]; + [super textDidEndEditing:newNotification]; + [[self window] makeFirstResponder:self]; + [NSApp sendAction:_action to:_target from:self]; // good thing the inherited _action and _target are so named! doing this + // override doesn't send the action unless we send it ourself! + +} // textDidEndEditing + + +@end diff --git a/Classes/Support Pieces/JSDTextView.h b/Classes/Support Pieces/JSDTextView.h new file mode 100644 index 00000000..3aa06b0a --- /dev/null +++ b/Classes/Support Pieces/JSDTextView.h @@ -0,0 +1,90 @@ +/*************************************************************************************** + JSDTextView.h + + Modify NSTextView for a single, special purpose. We will: + o non-wrapping text with a line counter to the left. + o self contained (hence multiple classes in this header) + + We will: + o hand-build an NSScrollView, NSTextView, NSLayoutManager, NSTextContainer, + and NSTextStorage for textView, and add a JSDNumberView for numberView + o allow turning wrapping of text to YES or NO. + o allow turning line number counting to YES or NO. + o allow highlighting a given row and column. + ***************************************************************************************/ + +#import + +@class JSDTextView; + +//======================================================================================================== +// JSDTextViewSub -- this NSTextView subclass overrides drawRect: in order to force it to +// update the associated NSView in addition to the inherited method. +//======================================================================================================== +@interface JSDTextViewSub : NSTextView { + NSView *_friendView; + + int _litLine; // current line to highlight, or 0 if none. + int _litColumn; // current character to highlight, or 0 if none. +} +-(NSView *)friendView; // return the associated view +-(void)setFriendView:(NSView *)theView; // set the associated view + +-(void)setHighlightedLine:(int)line column:(int)column; // sets current line to highlight + +@end + + +//======================================================================================================== +// JSDNumberView -- this NSView subclass draws its own line numbers in drawRect: based on the associated +// Text view in _owner. Provide accessor methods for _textView. +//======================================================================================================== +@interface JSDNumberView : NSView { + JSDTextView *_owner; + BOOL _showLineNumbers; // show line numbers or not? Default YES +} +-(JSDTextView *)owner; // return the associated JSDTextView +-(void)setOwner:(JSDTextView *)theView; // set the associate JSDTextView + +-(BOOL)showLineNumbers; // returns whether we're showing line numbers or not. +-(void)setShowLineNumbers:(BOOL)value; // set whether we're showing line numbers or not. + +@end + +//======================================================================================================== +// JSDTextView -- this NSTextView is just a REGULAR NSView subclass that does everything relates to a +// textview internally. The NSTextView is exposed so that all of the regular messages +// can be sent to it for setup without having to duplicate them in this wrapper. +//======================================================================================================== +@interface JSDTextView : NSView { + NSScrollView *_scrollView; // the enclosing scrollview. + NSLayoutManager *_layoutManager; // the layout manager + NSTextContainer *_textContainer; // the text container. + JSDTextViewSub *_textView; // the text view + JSDNumberView *_numberView; // the number view + + BOOL _wordWrap; // current word-wrap state. + + IBOutlet id delegate; // expose the NSTextView's delegate +} + +-(NSScrollView *)scrollView; // expose the enclosing scrollview. +-(NSLayoutManager *)layoutManager; // expose the layout manager +-(NSTextContainer *)textContainer; // expose the text container. +-(NSTextView *)textView; // expose the text view +-(JSDNumberView *)numberView; // expose the number view + +-(NSString *)string; // convenience method to get the NSTextView string +-(void)setString:(NSString *)aString; // convenience method to set the NSTextView string + +- (void)setDelegate:(id)anObject; // convenience to allow setting of TextView delegate in IB +- (id)delegate; // complement to above + +-(BOOL)showLineNumbers; // get this from the numberview that we're hosting. +-(void)setShowLineNumbers:(BOOL)value; // set this in the numberview that we're hosting. + +-(BOOL)wordWrap; // returns the word-wrap state +-(void)setWordWrap:(BOOL)value; // sets the word-wrap state. + +-(void)setHighlightedLine:(int)line column:(int)column; // sets current line to highlight +@end diff --git a/Classes/Support Pieces/JSDTextView.m b/Classes/Support Pieces/JSDTextView.m new file mode 100644 index 00000000..40a70afb --- /dev/null +++ b/Classes/Support Pieces/JSDTextView.m @@ -0,0 +1,504 @@ +/*************************************************************************************** + JSDTextView.m + + Modify NSTextView for a single, special purpose. We will: + o non-wrapping text with a line counter to the left. + o self contained (hence multiple classes in this header) + + We will: + o hand-build an NSScrollView, NSTextView, NSLayoutManager, NSTextContainer, + and NSTextStorage for textView, and add a JSDNumberView for numberView + o allow turning wrapping of text to YES or NO. + o allow turning line number counting to YES or NO. + o allow highlighting a given row and column. +***************************************************************************************/ + +#import "JSDTextView.h" + +const float LargeNumberForText = 1.0e7; + +//======================================================================================================== +// IMPLEMENTATION JSDNumberView +//======================================================================================================== + +@implementation JSDNumberView + +/******************************************************************** + textView: + accessor get method for _owner +*********************************************************************/ +-(JSDTextView *)owner { + return _owner; +} // textView + +/******************************************************************** + setTextView: + accessor set method for _owner -- NOT retained. +*********************************************************************/ +-(void)setOwner:(JSDTextView *)theView { + _owner = theView; +} // setTextView + +/******************************************************************** + setWidth: + sets a new width for the number drawing. +*********************************************************************/ +-(void)setWidth:(float)value { + float adjWidth = (value - [self frame].size.width); // amount to adjust -- pos=bigger, neg=smaller. + + NSRect tmpFrame = [[_owner scrollView] frame]; // get the scrollView frame. + tmpFrame.origin.x += adjWidth; // new origin position. + tmpFrame.size.width += -adjWidth; // new width. + [[_owner scrollView] setFrame:tmpFrame]; // set the new frame. + + tmpFrame = [self frame]; // get the current frame + tmpFrame.size.width += adjWidth; // new width. + [self setFrame:tmpFrame]; + + [_owner setNeedsDisplay:YES]; // flag _owner needs updated. + [self setNeedsDisplay:YES]; // flag we need updated. +} // setTextView + + +/******************************************************************** + drawRect: + overridden drawRect does the drawing of the line numbers. +*********************************************************************/ +- (void)drawRect:(NSRect)rect { + // fill in the background + [[NSColor windowBackgroundColor] set]; // use Mac OS X' background stripe + [NSBezierPath fillRect:rect]; // fill the rect + + // only draw if there's an associated _owner. This means it's assigned -- hope it's not released! Any ideas to check? + // also only draw if _showLineNumbers is true + if ((_owner) && (_showLineNumbers)) { + + // adjust rect so we won't later draw into the scrollbar area + if ([[_owner scrollView] hasHorizontalScroller]) { + float j = [[[_owner scrollView] horizontalScroller] frame].size.height / 2; // get size of the scroller + rect.origin.y += j; // shift the drawing frame reference up. + rect.size.height += -j; // and shrink it the same distance. + } // if scrollview present + + // setup drawing attributes for the font size and color. Later we could add accessors to do this dynamically. + NSMutableDictionary *attr = [[NSMutableDictionary alloc] init]; + [attr setObject:[NSFont fontWithName: @"Courier" size: 12] forKey: NSFontAttributeName]; + [attr setObject:[NSColor controlTextColor] forKey: NSForegroundColorAttributeName]; + + // setup the variables we need for the loop + NSRange aRange; // a range for counting lines + NSString *s; // a temporary string + int i = 0; // glyph counter + int j = 1; // line counter + float reqWidth; // width calculator holder -- width needed to show string + float widest = 1; // to calculate widest width needed - MIN 1! + float myWidth; // width calculator holder -- my current width + NSRect r; // rectange holder + NSPoint p; // point holder + NSLayoutManager *lm = [[_owner textView] layoutManager]; // get _owner's layout manager. + + // the line number counting and drawing loop + while ( i < [lm numberOfGlyphs] ) { + + // get the coordinates for the current glyph's entire-line rectangle, and converts to local coordinates. + r = [self convertRect:[lm lineFragmentRectForGlyphAtIndex:i effectiveRange:&aRange] fromView:[_owner textView]]; + r.origin.x = rect.origin.x; // don't care about x -- just force it into the rect + + // if true, we should draw because we're in the rectangle being updated. + if (NSPointInRect(r.origin, rect)) { + s = [NSString stringWithFormat:@"%d", j, nil]; // make a string from the line counter. + + reqWidth = [s sizeWithAttributes:attr].width; // width required to draw the string. + if (reqWidth > widest) // get widest width there is. + widest = reqWidth; + myWidth = [self frame].size.width; // get my own, current width. + if (myWidth < reqWidth) + [self setWidth:reqWidth]; // set a wider width if needed. + + p = NSMakePoint((myWidth - reqWidth), r.origin.y); // calculate to right-align and vertically place the string + [s drawAtPoint:p withAttributes:attr]; // draw the current line number. + } // if okay to draw + + i += [[[[_owner textView] string] substringWithRange:aRange] length]; // advance glyph counter to EOL + j ++; // increment the line number + } // while + [self setWidth:widest]; // set to the widest width needed, which could be narrower than before. + [attr release]; // free up the no-longer-needed attributes + } // if owner +} // drawRect + +/******************************************************************** + showLineNumbers: + we're going return _showLineNumbers +*********************************************************************/ +-(BOOL)showLineNumbers { + return _showLineNumbers; +} // showLineNumbers + +/******************************************************************** + setShowLineNumbers: + we're going to set whether we're showing line numbers or not. +*********************************************************************/ +-(void)setShowLineNumbers:(BOOL)value { + if (value != _showLineNumbers) { + _showLineNumbers = !_showLineNumbers; + if (!_showLineNumbers) + [self setWidth:0]; // hides it effectively. + else + [self setWidth:1]; // just to open it up. + [self setNeedsDisplay:YES]; + } // if +} // setShowLineNumbers + +@end; // JSDNumberView + + + +//======================================================================================================== +// IMPLEMENTATION JSDTextView +//======================================================================================================== + +@implementation JSDTextView + +/******************************************************************** + scrollView: + expose the enclosing scrollview. +*********************************************************************/ +-(NSScrollView *)scrollView { + return _scrollView; +} // scrollView + +/******************************************************************** + layoutManager: + expose the layout manager +*********************************************************************/ +-(NSLayoutManager *)layoutManager { + return _layoutManager; +} // layoutManager + +/******************************************************************** + textContainer: + expose the text container +*********************************************************************/ +-(NSTextContainer *)textContainer { + return _textContainer; +} // textContainer + +/******************************************************************** + textView: + expose the text view +*********************************************************************/ +-(NSTextView *)textView { + return _textView; +} // textView + +/******************************************************************** + numberView: + expose the number view +*********************************************************************/ +-(JSDNumberView *)numberView { + return _numberView; +} // numberView + + +/******************************************************************** + setupViews: + let's build the text system by hand. +*********************************************************************/ +-(void)setupViews { + // setup the items we need to make this work. + NSRect textFrame; // the frame for textView. + NSRect numberFrame; // the frame for numberView. + NSRect scrollFrame; // the frame for the scrollView. + + // Create our text storage for the NSTextView + NSTextStorage *textStorage = [[NSTextStorage alloc] init]; // NSTextView's text storage. + + // Create and configure the numberView + numberFrame = [self bounds]; // get our frame. + numberFrame.origin = NSMakePoint(0.0, 0.0); // set our origin. + numberFrame.size.width = 1; // default width (about invisible). + _numberView = [[JSDNumberView allocWithZone:[self zone]] initWithFrame:numberFrame];// initialize it. + [_numberView setAutoresizingMask:NSViewHeightSizable]; // set it's vertical resizing. + [_numberView setShowLineNumbers:YES]; // show line numbers by default. + [_numberView setOwner:self]; // set the numberView's owner + [self addSubview:_numberView]; // add it to us. + + // Create NSScrollView -- this will enclose everything else. + scrollFrame = [self bounds]; // get our frame. + scrollFrame.origin.x = 1+1; // adjust the origin. + scrollFrame.size.width = (scrollFrame.size.width - (1+1)); // adjust the width. + _scrollView = [[NSScrollView allocWithZone:[self zone]] initWithFrame:scrollFrame]; // create and initialize it. + [_scrollView setBorderType:NSBezelBorder]; // make the border normal. + [_scrollView setHasVerticalScroller:YES]; // put in the Vertical scroller. + [_scrollView setHasHorizontalScroller:YES]; // put in the Horizontal scroller. + [_scrollView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; // resize mask for the scroll view. + [[_scrollView contentView] setAutoresizesSubviews:YES]; // the contentview will autoresize subviews. + [self addSubview:_scrollView]; // add the scrollview as our subview. + + // Create NSSLayoutManager + _layoutManager = [[NSLayoutManager allocWithZone:[self zone]] init]; // create the TextView's layout manager. + [textStorage addLayoutManager:_layoutManager]; // add it to the text storage we already created. + + // Create and configure NSTextContainer + _textContainer = [[NSTextContainer allocWithZone:[self zone]] initWithContainerSize:NSMakeSize(LargeNumberForText, LargeNumberForText)]; + [_textContainer setWidthTracksTextView:NO]; // we don't want to be the same width as view! + [_textContainer setHeightTracksTextView:NO]; // we don't want to be the same height as view! + [_layoutManager addTextContainer:_textContainer]; // add the text container to the layout manager. + + // Create and configure NSTextView + textFrame.origin = NSMakePoint(0.0, 0.0); // get our origin. + textFrame.size = [_scrollView contentSize]; // frame will start at upper left. + _textView = [[JSDTextViewSub allocWithZone:[self zone]] initWithFrame:textFrame textContainer:_textContainer]; // initialize it. + [_textView setMinSize:textFrame.size]; // set the minimum size. + [_textView setMaxSize:NSMakeSize(LargeNumberForText, LargeNumberForText)]; // set the maximum size. + [_textView setHorizontallyResizable:YES]; // it's resizable horizontally. + [_textView setVerticallyResizable:YES]; // it's resizable vertically. + [_textView setAutoresizingMask:NSViewNotSizable]; // don't let it autosize, though. + [_scrollView setDocumentView:_textView]; // make this the documentview of the scroller. + + // update friend views. + [_textView setFriendView:_numberView]; // the textview will also update our friend. + + // release things retained by the system + [_textContainer release]; // release it -- already retained by adding it. + [_scrollView release]; // release the scrollview -- already retained. + [_textView release]; // decrease the reference count. +} // setupViews + +/******************************************************************** + initWithFrame: + initialize the view. +*********************************************************************/ +- (id)initWithFrame:(NSRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self setupViews]; // setup all of the views we need! + if (delegate) + [self setDelegate:delegate]; + } + return self; +} // initWithFrame; + + +/******************************************************************** + string: + we're going to pass to _textView:string (convenience) +*********************************************************************/ +-(NSString *)string { + return[ _textView string]; +} // string + +/******************************************************************** + setString: + we're going to pass to _textView:setString (convenience) +*********************************************************************/ +-(void)setString:(NSString *)aString { + [_textView setString:aString]; +} // setString + +/******************************************************************** + setDelegate: + set the delegate for this class, which really sets the + delegate for the TextView underneath! We only want to + support this for Interface Builder's sake. +*********************************************************************/ +- (void)setDelegate:(id)anObject { + [anObject retain]; + [delegate release]; + delegate = anObject; + [_textView setDelegate:anObject]; +} // setDelegate + +/******************************************************************** + initWithFrame: + return the current delegate of the textview underneath. + *********************************************************************/ +- (id)delegate { + return [_textView delegate]; +} // delegate + +/******************************************************************** + showLineNumbers: + pass this to the numberview we're hosting below. + *********************************************************************/ +-(BOOL)showLineNumbers { + if (_numberView) + return [_numberView showLineNumbers]; + else + return NO; +} // showLineNumbers + +/******************************************************************** + setShowLineNumbers: + set this in the numberview we're hosting below. + *********************************************************************/ +-(void)setShowLineNumbers:(BOOL)value { + if (_numberView) + [_numberView setShowLineNumbers:value]; +} // setShowLineNumbers + +/******************************************************************** + wordWrap: + returns the word-wrap state +*********************************************************************/ +-(BOOL)wordWrap { + return _wordWrap; +} // wordWrap + +/******************************************************************** + adjustTextFrameSize: + if we're word wrapping, adjust the size of the textcontainer + to account for the presence of the numberview. Right now + it's ONLY called by setWordWrap, but it's applied here + in case I discover I need to manually force the width + adjustment at some time. + *********************************************************************/ +-(void)adjustTextFrameSize { + if (_wordWrap) { + int i = [_scrollView frame].size.width; // width of the enclosing scrollview + if ([_numberView showLineNumbers]) + i -= ( [_numberView frame].size.width + 2 ); // account for numberView size if applicable + + [_textContainer setContainerSize:NSMakeSize(i, LargeNumberForText)]; // set the frame size + } // if _wordWrap +} // adjustTextFrameSize + +/******************************************************************** + setWordWrap: + sets wordwrap to YES or NO + *********************************************************************/ +-(void)setWordWrap:(BOOL)value { + if (_wordWrap != value) { + _wordWrap = value; // YES = wordWrap + if (_wordWrap) { + [_scrollView setHasHorizontalScroller:NO]; // don't need horizontal scroller + [_textView setAutoresizingMask:NSViewWidthSizable]; // let it autosize. + [self adjustTextFrameSize]; + [_textContainer setWidthTracksTextView:YES]; // will follow the width of the textview. + [_textView sizeToFit]; + } // if wordwrap + else { + [_scrollView setHasHorizontalScroller:YES]; // need horizontal scroller + [_textContainer setWidthTracksTextView:NO]; // will NOT follow the width of the textview - stays static. + [_textContainer setContainerSize:NSMakeSize(LargeNumberForText, LargeNumberForText)]; // set the frame size + [_textView setAutoresizingMask:NSViewNotSizable]; // don't let it autosize, though. + } // else no wordwrap + [self setNeedsDisplay:YES]; + } //if +} // setWordWrap + +/******************************************************************** + setHighlightedLine: + sets a line to be highlighted -- passed to the textview + *********************************************************************/ +-(void)setHighlightedLine:(int)line column:(int)column{ + [_textView setHighlightedLine:line column:column]; +} // setHighlightedLine + +@end // JSDTextview + + +//======================================================================================================== +// IMPLEMENTATION JSDTextViewSub +//======================================================================================================== +@implementation JSDTextViewSub + +/******************************************************************** + highlightLightedLine: + sets _litLine to be highlighted. + *********************************************************************/ +-(void)highlightLightedLine { + // setup the variables we need for the loop + NSRange aRange; // a range for counting lines + NSRange lineCharRange; // a range for counting lines + int i = 0; // glyph counter + int j = 1; // line counter + int k; // column counter + NSRect r; // rectange holder + NSLayoutManager *lm = [self layoutManager]; // get layout manager. + + // Remove any existing coloring. + [lm removeTemporaryAttribute:NSBackgroundColorAttributeName forCharacterRange:NSMakeRange(0, [[self textStorage] length])]; + + // only highlight if there's a row to highlight. + if (_litLine >= 1) { + // the line number counting loop + while ( i < [lm numberOfGlyphs] ) { + r = [lm lineFragmentRectForGlyphAtIndex:i effectiveRange:&aRange]; // get the range for the current line. + // if the current line is what we're looking for, then highlight it! + if (j == _litLine) { + k = [lm characterIndexForGlyphAtIndex:i] + _litColumn - 1; // the column position + lineCharRange = [lm characterRangeForGlyphRange:aRange actualGlyphRange:NULL]; // the whole role range + // color them + [lm addTemporaryAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSColor cyanColor], NSBackgroundColorAttributeName, nil] forCharacterRange:lineCharRange]; + [lm addTemporaryAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[NSColor magentaColor], NSBackgroundColorAttributeName, nil] forCharacterRange:NSMakeRange(k, 1)]; + } // if + i += [[[self string] substringWithRange:aRange] length]; // advance glyph counter to EOL + j ++; // increment the line number + } // while + } // if +} // highlightLightedLine + +/******************************************************************** + scrollIntoView: + scrolls to line + *********************************************************************/ +-(void)scrollIntoView:(int)line { + // setup the variables we need for the loop + NSRange aRange; // a range for counting lines + int i = 0; // glyph counter + int j = 1; // line counter + NSRect r; // rectange holder + NSLayoutManager *lm = [self layoutManager]; // layout manager. + if (line >= 1) { + // the line number counting loop + while ( i < [lm numberOfGlyphs] ) { + r = [lm lineFragmentRectForGlyphAtIndex:i effectiveRange:&aRange]; // get the range for the current line. + // if the current line is what we're looking for, then scroll to it + if (j == line) { + [self scrollRangeToVisible:aRange]; // scroll it into view + } // if + i += [[[self string] substringWithRange:aRange] length]; // advance glyph counter to EOL + j ++; // increment the line number + } // while + } // if +} // scrollIntoView + + +/******************************************************************** + get the friend view, i.e., who else to update with me. + *********************************************************************/ +-(NSView *)friendView { + return _friendView; +} // friendView + +/******************************************************************** + set the friend view, i.e., who else to update with me. + *********************************************************************/ +-(void)setFriendView:(NSView *)theView { + _friendView = theView; +} // setFriendView + +/******************************************************************** + also draw the friend view. + *********************************************************************/ +-(void)drawRect:(NSRect)rect { +// [self highlightLightedLine]; + [super drawRect:rect]; + [_friendView setNeedsDisplay:YES]; +} // drawRect + +/******************************************************************** + setHighlightedLine: + sets a line to be highlighted. + *********************************************************************/ +-(void)setHighlightedLine:(int)line column:(int)column { + _litLine = line; + _litColumn = column; + [self scrollIntoView:line]; // scroll it into view + [_friendView display]; + [self highlightLightedLine]; // highlight the line +} // setHighlightedLine + +@end // JSDTextViewSub diff --git a/Classes/TreeNode.h b/Classes/Support Pieces/TreeNode.h old mode 100755 new mode 100644 similarity index 100% rename from Classes/TreeNode.h rename to Classes/Support Pieces/TreeNode.h diff --git a/Classes/TreeNode.m b/Classes/Support Pieces/TreeNode.m old mode 100755 new mode 100644 similarity index 100% rename from Classes/TreeNode.m rename to Classes/Support Pieces/TreeNode.m diff --git a/English.lproj/Batch.nib/classes.nib b/English.lproj/Batch.nib/classes.nib old mode 100755 new mode 100644 index 20d1f38f..748b5874 --- a/English.lproj/Batch.nib/classes.nib +++ b/English.lproj/Batch.nib/classes.nib @@ -1,9 +1,10 @@ { IBClasses = ( { + ACTIONS = {startBatch = id; }; CLASS = BatchController; LANGUAGE = ObjC; - OUTLETS = {fileList = NSOutlineView; }; + OUTLETS = {fileList = NSOutlineView; optionPane = NSView; }; SUPERCLASS = NSWindowController; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } diff --git a/English.lproj/Batch.nib/info.nib b/English.lproj/Batch.nib/info.nib old mode 100755 new mode 100644 index 4acfd440..63aa274b --- a/English.lproj/Batch.nib/info.nib +++ b/English.lproj/Batch.nib/info.nib @@ -3,7 +3,7 @@ IBDocumentLocation - 163 111 356 240 0 0 1152 848 + 182 78 356 240 0 0 1152 848 IBFramework Version 286.0 IBOpenObjects @@ -11,6 +11,6 @@ 22 IBSystem Version - 6D52 + 6I32 diff --git a/English.lproj/Batch.nib/keyedobjects.nib b/English.lproj/Batch.nib/keyedobjects.nib old mode 100755 new mode 100644 index 80e7585f..3ee30ba9 Binary files a/English.lproj/Batch.nib/keyedobjects.nib and b/English.lproj/Batch.nib/keyedobjects.nib differ diff --git a/English.lproj/Batch~.nib/classes.nib b/English.lproj/Batch~.nib/classes.nib old mode 100755 new mode 100644 index 20d1f38f..748b5874 --- a/English.lproj/Batch~.nib/classes.nib +++ b/English.lproj/Batch~.nib/classes.nib @@ -1,9 +1,10 @@ { IBClasses = ( { + ACTIONS = {startBatch = id; }; CLASS = BatchController; LANGUAGE = ObjC; - OUTLETS = {fileList = NSOutlineView; }; + OUTLETS = {fileList = NSOutlineView; optionPane = NSView; }; SUPERCLASS = NSWindowController; }, {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; } diff --git a/English.lproj/Batch~.nib/info.nib b/English.lproj/Batch~.nib/info.nib old mode 100755 new mode 100644 index 4acfd440..7890d795 --- a/English.lproj/Batch~.nib/info.nib +++ b/English.lproj/Batch~.nib/info.nib @@ -11,6 +11,6 @@ 22 IBSystem Version - 6D52 + 6G30 diff --git a/English.lproj/Batch~.nib/keyedobjects.nib b/English.lproj/Batch~.nib/keyedobjects.nib old mode 100755 new mode 100644 index 726acb06..f6a61948 Binary files a/English.lproj/Batch~.nib/keyedobjects.nib and b/English.lproj/Batch~.nib/keyedobjects.nib differ diff --git a/English.lproj/InfoPlist.strings b/English.lproj/InfoPlist.strings old mode 100755 new mode 100644 index 1cee91a2..7a55d570 Binary files a/English.lproj/InfoPlist.strings and b/English.lproj/InfoPlist.strings differ diff --git a/English.lproj/Localizable.strings b/English.lproj/Localizable.strings old mode 100755 new mode 100644 index 4209da37..a3ba5e52 Binary files a/English.lproj/Localizable.strings and b/English.lproj/Localizable.strings differ diff --git a/English.lproj/MainMenu.nib/classes.nib b/English.lproj/MainMenu.nib/classes.nib old mode 100755 new mode 100644 index ea5ed73e..8ff436d4 --- a/English.lproj/MainMenu.nib/classes.nib +++ b/English.lproj/MainMenu.nib/classes.nib @@ -1,19 +1,34 @@ -{ - IBClasses = ( - { - ACTIONS = {showBatch = id; showPreferences = id; }; - CLASS = AppController; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = {optionChanged = id; }; - CLASS = MyDocument; - LANGUAGE = ObjC; - OUTLETS = {errorView = NSTextView; sourceView = NSTextView; tidyView = NSTextView; }; - SUPERCLASS = NSDocument; - } - ); - IBVersion = 1; -} \ No newline at end of file + + + + + IBClasses + + + CLASS + FirstResponder + LANGUAGE + ObjC + SUPERCLASS + NSObject + + + ACTIONS + + showBatch + id + showPreferences + id + + CLASS + AppController + LANGUAGE + ObjC + SUPERCLASS + NSObject + + + IBVersion + 1 + + diff --git a/English.lproj/MainMenu.nib/info.nib b/English.lproj/MainMenu.nib/info.nib old mode 100755 new mode 100644 index cdb6a043..42fbe4af --- a/English.lproj/MainMenu.nib/info.nib +++ b/English.lproj/MainMenu.nib/info.nib @@ -1,21 +1,18 @@ - + - IBDocumentLocation - 88 84 356 240 0 0 1152 848 - IBEditorPositions - - 29 - 393 485 305 44 0 0 1152 848 - IBFramework Version - 286.0 + 629 + IBLastKnownRelativeProjectPath + ../../Balthisar Tidy.xcodeproj + IBOldestOS + 5 IBOpenObjects - - 29 - + IBSystem Version - 6D52 + 9B18 + targetFramework + IBCocoaFramework diff --git a/English.lproj/MainMenu.nib/keyedobjects.nib b/English.lproj/MainMenu.nib/keyedobjects.nib old mode 100755 new mode 100644 index fc67d06c..685b2dc9 Binary files a/English.lproj/MainMenu.nib/keyedobjects.nib and b/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/English.lproj/MainMenu~.nib/classes.nib b/English.lproj/MainMenu~.nib/classes.nib deleted file mode 100755 index d79cea3b..00000000 --- a/English.lproj/MainMenu~.nib/classes.nib +++ /dev/null @@ -1,14 +0,0 @@ -{ - IBClasses = ( - {CLASS = AppController; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = {optionChanged = id; }; - CLASS = MyDocument; - LANGUAGE = ObjC; - OUTLETS = {errorView = NSTextView; sourceView = NSTextView; tidyView = NSTextView; }; - SUPERCLASS = NSDocument; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/English.lproj/MainMenu~.nib/keyedobjects.nib b/English.lproj/MainMenu~.nib/keyedobjects.nib deleted file mode 100755 index 8cc92f3d..00000000 Binary files a/English.lproj/MainMenu~.nib/keyedobjects.nib and /dev/null differ diff --git a/English.lproj/MyDocument.nib/classes.nib b/English.lproj/MyDocument.nib/classes.nib deleted file mode 100755 index 01ad64cd..00000000 --- a/English.lproj/MyDocument.nib/classes.nib +++ /dev/null @@ -1,27 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = {optionChanged = id; }; - CLASS = MyDocument; - LANGUAGE = ObjC; - OUTLETS = { - checkBare = NSButton; - checkClean = NSButton; - checkIndent = NSButton; - checkNumeric = NSButton; - checkOmit = NSButton; - checkUppercase = NSButton; - checkWrap = NSButton; - checkXML = NSButton; - errorView = NSTextView; - menuEncoding = NSPopUpButton; - sourceView = NSTextView; - tidyView = NSTextView; - valWrap = NSTextField; - }; - SUPERCLASS = NSDocument; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/English.lproj/MyDocument.nib/keyedobjects.nib b/English.lproj/MyDocument.nib/keyedobjects.nib deleted file mode 100755 index a246d17a..00000000 Binary files a/English.lproj/MyDocument.nib/keyedobjects.nib and /dev/null differ diff --git a/English.lproj/MyDocument~.nib/classes.nib b/English.lproj/MyDocument~.nib/classes.nib deleted file mode 100755 index 01ad64cd..00000000 --- a/English.lproj/MyDocument~.nib/classes.nib +++ /dev/null @@ -1,27 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = {optionChanged = id; }; - CLASS = MyDocument; - LANGUAGE = ObjC; - OUTLETS = { - checkBare = NSButton; - checkClean = NSButton; - checkIndent = NSButton; - checkNumeric = NSButton; - checkOmit = NSButton; - checkUppercase = NSButton; - checkWrap = NSButton; - checkXML = NSButton; - errorView = NSTextView; - menuEncoding = NSPopUpButton; - sourceView = NSTextView; - tidyView = NSTextView; - valWrap = NSTextField; - }; - SUPERCLASS = NSDocument; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/English.lproj/MyDocument~.nib/keyedobjects.nib b/English.lproj/MyDocument~.nib/keyedobjects.nib deleted file mode 100755 index 9953453d..00000000 Binary files a/English.lproj/MyDocument~.nib/keyedobjects.nib and /dev/null differ diff --git a/English.lproj/OptionPane.nib/classes.nib b/English.lproj/OptionPane.nib/classes.nib new file mode 100644 index 00000000..ae0dc087 --- /dev/null +++ b/English.lproj/OptionPane.nib/classes.nib @@ -0,0 +1,26 @@ +{ + IBClasses = ( + {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + {CLASS = JSDTableView; LANGUAGE = ObjC; SUPERCLASS = NSTableView; }, + { + ACTIONS = {optionChanged = id; }; + CLASS = OptionPaneController; + LANGUAGE = ObjC; + OUTLETS = {myView = NSView; theDescription = NSTextField; theTable = NSTableView; }; + SUPERCLASS = NSObject; + }, + { + ACTIONS = {optionChanged = id; }; + CLASS = TidyDocument; + LANGUAGE = ObjC; + OUTLETS = { + errorView = NSTextView; + optionPane = NSView; + sourceView = NSTextView; + tidyView = NSTextView; + }; + SUPERCLASS = NSDocument; + } + ); + IBVersion = 1; +} \ No newline at end of file diff --git a/English.lproj/MainMenu~.nib/info.nib b/English.lproj/OptionPane.nib/info.nib old mode 100755 new mode 100644 similarity index 71% rename from English.lproj/MainMenu~.nib/info.nib rename to English.lproj/OptionPane.nib/info.nib index 4ab21a9d..75182071 --- a/English.lproj/MainMenu~.nib/info.nib +++ b/English.lproj/OptionPane.nib/info.nib @@ -3,19 +3,19 @@ IBDocumentLocation - 88 84 356 240 0 0 1152 848 + 293 116 356 240 0 0 1152 848 IBEditorPositions - 29 - 370 322 305 44 0 0 1152 848 + 21 + 408 381 335 403 0 0 1152 848 IBFramework Version 286.0 IBOpenObjects - 29 + 21 IBSystem Version - 6D52 + 6G30 diff --git a/English.lproj/OptionPane.nib/keyedobjects.nib b/English.lproj/OptionPane.nib/keyedobjects.nib new file mode 100644 index 00000000..98215d56 Binary files /dev/null and b/English.lproj/OptionPane.nib/keyedobjects.nib differ diff --git a/English.lproj/OptionPane~.nib/classes.nib b/English.lproj/OptionPane~.nib/classes.nib new file mode 100644 index 00000000..7ed28e25 --- /dev/null +++ b/English.lproj/OptionPane~.nib/classes.nib @@ -0,0 +1,25 @@ +{ + IBClasses = ( + {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + { + ACTIONS = {optionChanged = id; }; + CLASS = OptionPaneController; + LANGUAGE = ObjC; + OUTLETS = {myView = NSView; theDescription = NSTextField; theTable = NSTableView; }; + SUPERCLASS = NSObject; + }, + { + ACTIONS = {optionChanged = id; }; + CLASS = TidyDocument; + LANGUAGE = ObjC; + OUTLETS = { + errorView = NSTextView; + optionPane = NSView; + sourceView = NSTextView; + tidyView = NSTextView; + }; + SUPERCLASS = NSDocument; + } + ); + IBVersion = 1; +} \ No newline at end of file diff --git a/English.lproj/OptionPane~.nib/info.nib b/English.lproj/OptionPane~.nib/info.nib new file mode 100644 index 00000000..2c6026d7 --- /dev/null +++ b/English.lproj/OptionPane~.nib/info.nib @@ -0,0 +1,21 @@ + + + + + IBDocumentLocation + 349 115 356 240 0 0 1152 848 + IBEditorPositions + + 21 + 408 381 335 403 0 0 1152 848 + + IBFramework Version + 286.0 + IBOpenObjects + + 21 + + IBSystem Version + 6G30 + + diff --git a/English.lproj/OptionPane~.nib/keyedobjects.nib b/English.lproj/OptionPane~.nib/keyedobjects.nib new file mode 100644 index 00000000..2dc040e2 Binary files /dev/null and b/English.lproj/OptionPane~.nib/keyedobjects.nib differ diff --git a/English.lproj/Preferences.nib/classes.nib b/English.lproj/Preferences.nib/classes.nib old mode 100755 new mode 100644 index e6abe241..6699dcb0 --- a/English.lproj/Preferences.nib/classes.nib +++ b/English.lproj/Preferences.nib/classes.nib @@ -1,29 +1,51 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = {preferenceChanged = id; radioBatchChanged = id; radioSavingChanged = id; }; - CLASS = PreferenceController; - LANGUAGE = ObjC; - OUTLETS = { - bare = NSButton; - batchSaving1 = NSButton; - batchSaving2 = NSButton; - clean = NSButton; - encoding = NSPopUpButton; - indent = NSButton; - numeric = NSButton; - omit = NSButton; - saving1 = NSButton; - saving2 = NSButton; - savingWarn = NSButton; - uppercase = NSButton; - wrap = NSButton; - wrapColumn = NSTextField; - xmlOutput = NSButton; - }; - SUPERCLASS = NSWindowController; - } - ); - IBVersion = 1; -} \ No newline at end of file + + + + + IBClasses + + + ACTIONS + + preferenceChanged + id + radioBatchChanged + id + radioSavingChanged + id + + CLASS + PreferenceController + LANGUAGE + ObjC + OUTLETS + + batchSaving1 + NSButton + batchSaving2 + NSButton + optionPane + NSView + saving1 + NSButton + saving2 + NSButton + savingWarn + NSButton + + SUPERCLASS + NSWindowController + + + CLASS + FirstResponder + LANGUAGE + ObjC + SUPERCLASS + NSObject + + + IBVersion + 1 + + diff --git a/English.lproj/Preferences.nib/info.nib b/English.lproj/Preferences.nib/info.nib old mode 100755 new mode 100644 index 7668af11..42fbe4af --- a/English.lproj/Preferences.nib/info.nib +++ b/English.lproj/Preferences.nib/info.nib @@ -1,16 +1,18 @@ - + - IBDocumentLocation - 238 70 356 240 0 0 1024 746 IBFramework Version - 286.0 + 629 + IBLastKnownRelativeProjectPath + ../../Balthisar Tidy.xcodeproj + IBOldestOS + 5 IBOpenObjects - - 5 - + IBSystem Version - 6D52 + 9B18 + targetFramework + IBCocoaFramework diff --git a/English.lproj/Preferences.nib/keyedobjects.nib b/English.lproj/Preferences.nib/keyedobjects.nib old mode 100755 new mode 100644 index 11cda6a9..c6af4eea Binary files a/English.lproj/Preferences.nib/keyedobjects.nib and b/English.lproj/Preferences.nib/keyedobjects.nib differ diff --git a/English.lproj/Preferences~.nib/classes.nib b/English.lproj/Preferences~.nib/classes.nib old mode 100755 new mode 100644 index e6abe241..401219a5 --- a/English.lproj/Preferences~.nib/classes.nib +++ b/English.lproj/Preferences~.nib/classes.nib @@ -6,21 +6,12 @@ CLASS = PreferenceController; LANGUAGE = ObjC; OUTLETS = { - bare = NSButton; batchSaving1 = NSButton; batchSaving2 = NSButton; - clean = NSButton; - encoding = NSPopUpButton; - indent = NSButton; - numeric = NSButton; - omit = NSButton; + optionPane = NSView; saving1 = NSButton; saving2 = NSButton; savingWarn = NSButton; - uppercase = NSButton; - wrap = NSButton; - wrapColumn = NSTextField; - xmlOutput = NSButton; }; SUPERCLASS = NSWindowController; } diff --git a/English.lproj/Preferences~.nib/info.nib b/English.lproj/Preferences~.nib/info.nib old mode 100755 new mode 100644 index 7668af11..de568cc3 --- a/English.lproj/Preferences~.nib/info.nib +++ b/English.lproj/Preferences~.nib/info.nib @@ -3,7 +3,7 @@ IBDocumentLocation - 238 70 356 240 0 0 1024 746 + 284 84 356 240 0 0 1152 848 IBFramework Version 286.0 IBOpenObjects @@ -11,6 +11,6 @@ 5 IBSystem Version - 6D52 + 6G30 diff --git a/English.lproj/Preferences~.nib/keyedobjects.nib b/English.lproj/Preferences~.nib/keyedobjects.nib old mode 100755 new mode 100644 index c3b08831..9703ce35 Binary files a/English.lproj/Preferences~.nib/keyedobjects.nib and b/English.lproj/Preferences~.nib/keyedobjects.nib differ diff --git a/English.lproj/TidyDocument.nib/classes.nib b/English.lproj/TidyDocument.nib/classes.nib new file mode 100644 index 00000000..89846f8f --- /dev/null +++ b/English.lproj/TidyDocument.nib/classes.nib @@ -0,0 +1,35 @@ +{ + IBClasses = ( + {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + {CLASS = JSDNumberView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, + { + CLASS = JSDTextView; + LANGUAGE = ObjC; + OUTLETS = {delegate = id; }; + SUPERCLASS = NSView; + }, + {CLASS = JSDTextViewSub; LANGUAGE = ObjC; SUPERCLASS = NSTextView; }, + {CLASS = NSTextView; LANGUAGE = ObjC; SUPERCLASS = NSText; }, + { + ACTIONS = {optionChanged = id; }; + CLASS = OptionPane; + LANGUAGE = ObjC; + OUTLETS = {descriptionView = NSTextField; optionTable = NSTableView; }; + SUPERCLASS = NSView; + }, + { + ACTIONS = {errorClicked = id; optionChanged = id; }; + CLASS = TidyDocument; + LANGUAGE = ObjC; + OUTLETS = { + errorView = NSTableView; + optionPane = NSView; + sourceView = JSDTextView; + tidyView = JSDTextView; + }; + SUPERCLASS = NSDocument; + }, + {CLASS = testpane; LANGUAGE = ObjC; SUPERCLASS = NSView; } + ); + IBVersion = 1; +} \ No newline at end of file diff --git a/English.lproj/MyDocument.nib/info.nib b/English.lproj/TidyDocument.nib/info.nib old mode 100755 new mode 100644 similarity index 85% rename from English.lproj/MyDocument.nib/info.nib rename to English.lproj/TidyDocument.nib/info.nib index e8048deb..3245116c --- a/English.lproj/MyDocument.nib/info.nib +++ b/English.lproj/TidyDocument.nib/info.nib @@ -3,7 +3,7 @@ IBDocumentLocation - 162 94 356 240 0 0 1152 848 + 322 73 356 240 0 0 1152 848 IBFramework Version 286.0 IBLockedObjects @@ -13,6 +13,6 @@ 5 IBSystem Version - 6D52 + 6I32 diff --git a/English.lproj/TidyDocument.nib/keyedobjects.nib b/English.lproj/TidyDocument.nib/keyedobjects.nib new file mode 100644 index 00000000..e43a9f21 Binary files /dev/null and b/English.lproj/TidyDocument.nib/keyedobjects.nib differ diff --git a/English.lproj/TidyDocument~.nib/classes.nib b/English.lproj/TidyDocument~.nib/classes.nib new file mode 100644 index 00000000..cb40a027 --- /dev/null +++ b/English.lproj/TidyDocument~.nib/classes.nib @@ -0,0 +1,35 @@ +{ + IBClasses = ( + {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, + {CLASS = JSDNumberView; LANGUAGE = ObjC; SUPERCLASS = NSView; }, + { + CLASS = JSDTextView; + LANGUAGE = ObjC; + OUTLETS = {delegate = id; }; + SUPERCLASS = NSView; + }, + {CLASS = JSDTextViewSub; LANGUAGE = ObjC; SUPERCLASS = NSTextView; }, + {CLASS = NSTextView; LANGUAGE = ObjC; SUPERCLASS = NSText; }, + { + ACTIONS = {optionChanged = id; }; + CLASS = OptionPane; + LANGUAGE = ObjC; + OUTLETS = {descriptionView = NSTextField; optionTable = NSTableView; }; + SUPERCLASS = NSView; + }, + { + ACTIONS = {erorClicked = id; optionChanged = id; }; + CLASS = TidyDocument; + LANGUAGE = ObjC; + OUTLETS = { + errorView = NSTableView; + optionPane = NSView; + sourceView = JSDTextView; + tidyView = JSDTextView; + }; + SUPERCLASS = NSDocument; + }, + {CLASS = testpane; LANGUAGE = ObjC; SUPERCLASS = NSView; } + ); + IBVersion = 1; +} \ No newline at end of file diff --git a/English.lproj/MyDocument~.nib/info.nib b/English.lproj/TidyDocument~.nib/info.nib old mode 100755 new mode 100644 similarity index 85% rename from English.lproj/MyDocument~.nib/info.nib rename to English.lproj/TidyDocument~.nib/info.nib index e8048deb..3245116c --- a/English.lproj/MyDocument~.nib/info.nib +++ b/English.lproj/TidyDocument~.nib/info.nib @@ -3,7 +3,7 @@ IBDocumentLocation - 162 94 356 240 0 0 1152 848 + 322 73 356 240 0 0 1152 848 IBFramework Version 286.0 IBLockedObjects @@ -13,6 +13,6 @@ 5 IBSystem Version - 6D52 + 6I32 diff --git a/English.lproj/TidyDocument~.nib/keyedobjects.nib b/English.lproj/TidyDocument~.nib/keyedobjects.nib new file mode 100644 index 00000000..fa559fbd Binary files /dev/null and b/English.lproj/TidyDocument~.nib/keyedobjects.nib differ diff --git a/English.lproj/optionsInEffect.txt b/English.lproj/optionsInEffect.txt new file mode 100644 index 00000000..1a780305 --- /dev/null +++ b/English.lproj/optionsInEffect.txt @@ -0,0 +1,80 @@ +# any line that isn't valid according to TidyLib is ignored. Hence, feel free to "comment out" items we don't want to support. +# additionally, change the appearance order by rearranging them in this file. DON'T LEAVE SPACES at the ends of lines! +wrap +indent-spaces +tab-size +input-encoding +output-encoding +newline +repeated-attributes +alt-text +indent +hide-endtags +uppercase-tags +uppercase-attributes +bare +clean +doctype-mode +#doctype +input-xml +output-xml +output-xhtml +output-html +add-xml-decl +logical-emphasis +drop-proprietary-attributes +drop-font-tags +drop-empty-para +fix-bad-comments +break-before-br +numeric-entities +quote-marks +quote-nbsp +quote-ampersand +wrap-attributes +wrap-script-literals +wrap-sections +wrap-asp +wrap-jste +wrap-php +fix-backslash +indent-attributes +assume-xml-procins +add-xml-space +enclose-text +enclose-block-text +word-2000 +tidy-mark +gnu-emacs +literal-attributes +show-body-only +fix-uri +lower-literals +hide-comments +indent-cdata +force-output +show-errors +ascii-chars +join-classes +join-styles +escape-cdata +ncr +output-bom +replace-color +css-prefix +new-inline-tags +new-blocklevel-tags +new-empty-tags +new-pre-tags +accessibility-check +#char-encoding +#error-file +#write-back +#markup +#show-warnings +#quiet +#keep-time +#gnu-emacs-file +#language +#slide-style +#split \ No newline at end of file diff --git a/English.lproj/optionsTypesExceptions.txt b/English.lproj/optionsTypesExceptions.txt new file mode 100644 index 00000000..cbad2810 --- /dev/null +++ b/English.lproj/optionsTypesExceptions.txt @@ -0,0 +1,12 @@ +# being that one of the design goals is to use TidyLib intact, we're going to define options here that have datatypes +# that are IN CONTRARY to how they are defined in TidyLib's config.c definitions. We COULD simplify matters and +# change the config.c, but purity dictates otherwise. Items listed here will be processed as STRINGS +# +# doctype takes a string for a user-specified string. Use doctype-mode for the picklist. +doctype +# the new-*-tags options have YES/NO picklists -- I don't know why. They're strings of comma-separated +# values used for teaching Tidy about new tags. Null should automatically mean NO +new-inline-tags +new-blocklevel-tags +new-empty-tags +new-pre-tags \ No newline at end of file diff --git a/Graphics, Included/iconbroom.icns b/Graphics, Included/iconbroom.icns old mode 100755 new mode 100644 diff --git a/Graphics, Included/iconhtm.icns b/Graphics, Included/iconhtm.icns old mode 100755 new mode 100644 diff --git a/Graphics, Included/iconhtml.icns b/Graphics, Included/iconhtml.icns old mode 100755 new mode 100644 diff --git a/Graphics, Included/iconphp.icns b/Graphics, Included/iconphp.icns old mode 100755 new mode 100644 diff --git a/README.rtf b/README.rtf new file mode 100644 index 00000000..2a8e13a9 --- /dev/null +++ b/README.rtf @@ -0,0 +1,43 @@ +{\rtf1\mac\ansicpg10000\cocoartf102 +{\fonttbl\f0\fswiss\fcharset77 ArialMT;} +{\colortbl;\red255\green255\blue255;} +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc + +\f0\fs48 \cf0 Balthisar Tidy +\fs26 \ +and\ + +\fs48 JSDTidyDocument +\fs26 (a Cocoa adaptation of TidyLib)\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural +\cf0 \ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc +\cf0 \'a92003 by James S. Derry\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural +\cf0 \ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li1440\ri-5020\qc +\cf0 portions \CocoaLigature0 Copyright \'a91998-2003 World Wide Web Consortium (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved.\ +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural +\cf0 \ +\ + +\fs48 Welcome +\fs26 \ + Welcome to Balthisar Tidy and JSDTidyDocument. You've successfully uncovered the source code, so good luck using it. At this point you should be aware that is an almalgamation of two separate projects with very different groups working on them. TidyLib, in the "tidylib-src" group is a product of the fine people at http://tidy.sourceforge.net, and they have full responsibility for that code. The Cocoa portions are my work, and comments, suggestions, bug fixes, code contributions, and so on can be addressed to me.\ + I can't guarantee complete or prompt support, but I'll do what I can. Please try to understand the source code before you ask too many questions!\ +\ + +\fs48 TidyLib Licensing +\fs26 \ + TidyLib is licensed under the MIT license. In short, it means you can do what you want with the code providing you leave the original copyright notice in place. This covers everything in this distribution that's found in the "tidylib-src" group. For full details of the MIT license, you could see \CocoaLigature1 http://www.opensource.org/licenses/mit-license.php\CocoaLigature0 \ +\ + +\fs48 JSDTidyDocument Licensing +\fs26 \ + JSDTidyDocument files and class are also licensed under the MIT license. Do what you want with them in the bounds of the license, but please consider giving credit where it's due, and bounce any positive changes back to me. This covers the contents of the "JSDTidy" files in the "JSDTidy" group. For full details of the MIT license, you could see \CocoaLigature1 http://www.opensource.org/licenses/mit-license.php\CocoaLigature0 for the MIT license.\ +\ + +\fs48 Balthisar Tidy Licensing +\fs26 \ + With the exception of the libraries and codes listed above, the entire remaining portion of Balthisar Tidy is licensed under the Gnu GPL. Call it a viral license if you will, but it's my baby and I'd like not to let anyone big-and-fancy take it away from me. If you're big-and-fancy and are interested in Balthisar Tidy under a different license, well, then we can talk. And don't forget you can use the above-named libraries outside this license. Please see \CocoaLigature1 http://www.opensource.org/licenses/gpl-license.php for all the complex details about the Gnu General Public License.\CocoaLigature0 \ +} \ No newline at end of file diff --git a/main.m b/main.m old mode 100755 new mode 100644 diff --git a/tidylib-src/MakeDLL.vc6 b/tidylib-src/MakeDLL.vc6 deleted file mode 100755 index 614f1ecc..00000000 --- a/tidylib-src/MakeDLL.vc6 +++ /dev/null @@ -1,179 +0,0 @@ -# Makefile.vc6 - for tidy - HTML parser and pretty printer -# For use with Microsoft's Visual C++ 6 nmake tool -# -# CVS Info : -# -# $Author: creitzel $ -# $Date: 2002/07/09 01:53:39 $ -# $Revision: 1.2.2.4 $ -# -# Copyright (c) 1998-2002 World Wide Web Consortium -# (Massachusetts Institute of Technology, Institut National de -# Recherche en Informatique et en Automatique, Keio University). -# All Rights Reserved. -# -# Contributing Author(s): -# -# Dave Raggett -# Terry Teague -# Mark Hale -# Philippe Lhoste -# -# The contributing author(s) would like to thank all those who -# helped with testing, bug fixes, and patience. This wouldn't -# have been possible without all of you. -# -# COPYRIGHT NOTICE: -# -# This software and documentation is provided "as is," and -# the copyright holders and contributing author(s) make no -# representations or warranties, express or implied, including -# but not limited to, warranties of merchantability or fitness -# for any particular purpose or that the use of the software or -# documentation will not infringe any third party patents, -# copyrights, trademarks or other rights. -# -# The copyright holders and contributing author(s) will not be -# liable for any direct, indirect, special or consequential damages -# arising out of any use of the software or documentation, even if -# advised of the possibility of such damage. -# -# Permission is hereby granted to use, copy, modify, and distribute -# this source code, or portions hereof, documentation and executables, -# for any purpose, without fee, subject to the following restrictions: -# -# 1. The origin of this source code must not be misrepresented. -# 2. Altered versions must be plainly marked as such and must -# not be misrepresented as being the original source. -# 3. This Copyright notice may not be removed or altered from any -# source or altered source distribution. -# -# The copyright holders and contributing author(s) specifically -# permit, without fee, and encourage the use of this source code -# as a component for supporting the Hypertext Markup Language in -# commercial products. If you use this source code in a product, -# acknowledgment is not required but would be appreciated. -# -# Usage: -# nmake -f Makefile.vc6 -# or -# nmake -f Makefile.vc6 DEBUG=1 - -CC=cl -RC=rc -LD=link - -BINDIR=.\bin -INCLDIR=./include/ -SRCDIR=./src/ -TIDYEXT=/D SUPPORT_ACCESSIBILITY_CHECKS=1 /D SUPPORT_UTF16_ENCODINGS=1 /D SUPPORT_ASIAN_ENCODINGS=1 - -## General flags for compilation -# /W4 Sets warning level 4 (max) -# /Za Disables Microsoft extensions (aka ANSI) -# /FD Generate file dependencies -# /c Compiles without linking -# /MD Use DLL version of multi-threaded C runtime library -# /MDd Uses debug DLL version of multi-threaded CRT. -# /MT Use statically linked, multi-threaded C runtime library -# /MTd Uses debug version of statically linked, multi-threaded CRT. -# In the following, replace /D "_CONSOLE" by /D "_WINDOWS" for Windows programs - -CFLAGS=/nologo /TC /W4 /FD /c /D "WIN32" /D "_MBCS" $(TIDYEXT) /I $(INCLDIR) - -## Additional flags for debug compilation -# /Gm Enables minimal rebuild -# /GZ Catch release-build errors in debug build -# /Zi Generates complete debugging information -# /Od Disables optimization - -CDEBUG=/Gm /GZ /Zi /Od /MD /D "DEBUG" /D "_DEBUG" - -## Additional flags for release compilation -# /O1 Creates small code -# /O2 Creates fast code -# /Ox Uses maximum optimization (/Ob1gity /Gs) - -CNDEBUG=/Ox /MD /D "NDEBUG" - - -NAMEFLAG=/Fo -## General flags for link -LDFLAGS= /nologo /machine:I386 /libpath:"." -LIBFLAGS= /DLL /IMPLIB:$(OBJDIR)/libtidy.lib /SUBSYSTEM:WINDOWS - -## Additional flags for debug link -LDDEBUG=/debug /pdbtype:sept /nodefaultlib:LIBC - -## Additional flags for release link -LDNDEBUG=/opt:nowin98 /opt:ref /pdb:none - -#LIBS=KERNEL32.lib USER32.lib GDI32.lib COMDLG32.lib COMCTL32.lib ADVAPI32.lib IMM32.lib SHELL32.LIB OLE32.LIB -LIBS= -DEBUGLIBS= - -!IFDEF DEBUG -CFLAGS=$(CFLAGS) $(CDEBUG) -LDFLAGS=$(LDFLAGS) $(LDDEBUG) -OBJDIR= .\debugDLL -DLLFLAG=/LDd /D _USRDLL -!ELSE -CFLAGS=$(CFLAGS) $(CNDEBUG) -LDFLAGS=$(LDFLAGS) $(LDNDEBUG) -OBJDIR= .\releaseDLL -DLLFLAG=/LD /D _USRDLL -!ENDIF - -OBJFILES=$(OBJDIR)\access.obj $(OBJDIR)\attrs.obj $(OBJDIR)\istack.obj\ - $(OBJDIR)\parser.obj $(OBJDIR)\tags.obj $(OBJDIR)\entities.obj\ - $(OBJDIR)\lexer.obj $(OBJDIR)\pprint.obj $(OBJDIR)\clean.obj\ - $(OBJDIR)\localize.obj $(OBJDIR)\config.obj $(OBJDIR)\alloc.obj\ - $(OBJDIR)\attrask.obj $(OBJDIR)\attrget.obj $(OBJDIR)\buffio.obj\ - $(OBJDIR)\tagask.obj $(OBJDIR)\fileio.obj $(OBJDIR)\streamio.obj\ - $(OBJDIR)\tmbstr.obj $(OBJDIR)\utf8.obj $(OBJDIR)\tidylib.obj - -CFILES= $(SRCDIR)access.c $(SRCDIR)attrs.c $(SRCDIR)istack.c \ - $(SRCDIR)parser.c $(SRCDIR)tags.c $(SRCDIR)entities.c \ - $(SRCDIR)lexer.c $(SRCDIR)pprint.c $(SRCDIR)clean.c \ - $(SRCDIR)localize.c $(SRCDIR)config.c $(SRCDIR)alloc.c \ - $(SRCDIR)attrask.c $(SRCDIR)attrget.c $(SRCDIR)buffio.c \ - $(SRCDIR)tagask.c $(SRCDIR)fileio.c $(SRCDIR)streamio.c\ - $(SRCDIR)tmbstr.c $(SRCDIR)utf8.c $(SRCDIR)tidylib.c - -HFILES= $(INCLDIR)platform.h $(INCLDIR)buffio.h \ - $(INCLDIR)fileio.h $(INCLDIR)tidy.h $(INCLDIR)tidyenum.h - -LIBHFILES= \ - $(SRCDIR)access.h \ - $(SRCDIR)attrs.h $(SRCDIR)clean.h \ - $(SRCDIR)config.h $(SRCDIR)entities.h \ - $(SRCDIR)forward.h $(SRCDIR)lexer.h $(SRCDIR)message.h \ - $(SRCDIR)parser.h $(SRCDIR)pprint.h $(SRCDIR)streamio.h \ - $(SRCDIR)tags.h \ - $(SRCDIR)tmbstr.h $(SRCDIR)utf8.h $(SRCDIR)tidy-int.h - -$(OBJDIR) : - if not exist $(OBJDIR) md $(OBJDIR) - -$(BINDIR) : - if not exist $(BINDIR) md $(BINDIR) - -$(BINDIR)/libtidy.dll: $(OBJFILES) $(BINDIR) - $(LD) $(LIBFLAGS) $(OBJFILES) /OUT:$(BINDIR)/libtidy.dll - -$(BINDIR)/tidy.exe: ./console/tidy.c $(HFILES) $(BINDIR)/libtidy.dll MakeDLL.vc6 - $(CC) /D "_CONSOLE" $(CFLAGS) ./console/tidy.c $(NAMEFLAG)$(OBJDIR)/ - $(LD) /subsystem:console $(LDFLAGS) $(OBJDIR)\tidy.obj $(LIBS) $(OBJDIR)/libtidy.lib /OUT:$(BINDIR)/tidy.exe - -$(OBJFILES): $(HFILES) $(LIBHFILES) $(CFILES) MakeDLL.vc6 $(OBJDIR) - $(CC) -c $(DLLFLAG) $(CFLAGS) $(CFILES) $(NAMEFLAG)$(OBJDIR)/ - -all: $(BINDIR)/libtidy.dll $(BINDIR)/tidy.exe - -clean: - del $(OBJFILES) $(OBJDIR)\*.* $(BINDIR)\*.* - rd $(OBJDIR) - rd $(BINDIR) - - - diff --git a/tidylib-src/Makefile b/tidylib-src/Makefile deleted file mode 100755 index fa30b611..00000000 --- a/tidylib-src/Makefile +++ /dev/null @@ -1,178 +0,0 @@ -# Makefile - for tidy - HTML parser and pretty printer -# -# CVS Info : -# -# $Author: creitzel $ -# $Date: 2002/10/20 19:00:17 $ -# $Revision: 1.9.2.5 $ -# -# Copyright (c) 1998-2002 World Wide Web Consortium -# (Massachusetts Institute of Technology, Institut National de -# Recherche en Informatique et en Automatique, Keio University). -# All Rights Reserved. -# -# Contributing Author(s): -# -# Dave Raggett -# Terry Teague -# Pradeep Padala -# -# The contributing author(s) would like to thank all those who -# helped with testing, bug fixes, and patience. This wouldn't -# have been possible without all of you. -# -# COPYRIGHT NOTICE: -# -# This software and documentation is provided "as is," and -# the copyright holders and contributing author(s) make no -# representations or warranties, express or implied, including -# but not limited to, warranties of merchantability or fitness -# for any particular purpose or that the use of the software or -# documentation will not infringe any third party patents, -# copyrights, trademarks or other rights. -# -# The copyright holders and contributing author(s) will not be -# liable for any direct, indirect, special or consequential damages -# arising out of any use of the software or documentation, even if -# advised of the possibility of such damage. -# -# Permission is hereby granted to use, copy, modify, and distribute -# this source code, or portions hereof, documentation and executables, -# for any purpose, without fee, subject to the following restrictions: -# -# 1. The origin of this source code must not be misrepresented. -# 2. Altered versions must be plainly marked as such and must -# not be misrepresented as being the original source. -# 3. This Copyright notice may not be removed or altered from any -# source or altered source distribution. -# -# The copyright holders and contributing author(s) specifically -# permit, without fee, and encourage the use of this source code -# as a component for supporting the Hypertext Markup Language in -# commercial products. If you use this source code in a product, -# acknowledgment is not required but would be appreciated. -# - -SHELL=/bin/sh - -# Installation variables. Spaces OK, only dir create and file copy operations. -runinst_prefix=/usr -devinst_prefix=/usr - -bininst = ${runinst_prefix}/bin -libinst = ${devinst_prefix}/lib -incinst = ${devinst_prefix}/include -maninst = ${devinst_prefix}/man - -# Internal variables. - No spaces allowed: libtool chokes on spaces in directory names. -TOPDIR = . -INCDIR = ${TOPDIR}/include -APPDIR = ${TOPDIR}/console -SRCDIR = ${TOPDIR}/src -OBJDIR = ${TOPDIR}/obj -LIBDIR = ${TOPDIR}/lib -BINDIR = ${TOPDIR}/bin - -# CFLAGS etc.. -CC= gcc -CFLAGS= -Wall -Wno-switch -Wno-parentheses -Wno-unused -I $(INCDIR) -OTHERCFLAGS= -DSUPPORT_ACCESSIBILITY_CHECKS=1 -DSUPPORT_UTF16_ENCODINGS=1 -DSUPPORT_ASIAN_ENCODINGS=1 -DEBUGFLAGS=-g -DDMALLOC - -LIBS=-lc -DEBUGLIBS=-ldmalloc - -# Tidy lib related variables -TIDY_MAJOR = 1 -TIDY_MINOR = 0 - -# This will come from autoconf again -LIBPREFIX = lib -LIBSUFFIX = .a - -LIBRARY = $(LIBDIR)/$(LIBPREFIX)tidy$(LIBSUFFIX) -LIBTOOL=libtool - -EXES = $(BINDIR)/tidy $(BINDIR)/tab2space - -OBJFILES=\ - $(OBJDIR)/access.o $(OBJDIR)/attrs.o $(OBJDIR)/istack.o\ - $(OBJDIR)/parser.o $(OBJDIR)/tags.o $(OBJDIR)/entities.o\ - $(OBJDIR)/lexer.o $(OBJDIR)/pprint.o $(OBJDIR)/clean.o\ - $(OBJDIR)/localize.o $(OBJDIR)/config.o $(OBJDIR)/alloc.o\ - $(OBJDIR)/attrask.o $(OBJDIR)/attrget.o $(OBJDIR)/buffio.o\ - $(OBJDIR)/fileio.o $(OBJDIR)/streamio.o $(OBJDIR)/tagask.o\ - $(OBJDIR)/tmbstr.o $(OBJDIR)/utf8.o\ - $(OBJDIR)/tidylib.o - -CFILES= \ - $(SRCDIR)/access.c $(SRCDIR)/attrs.c $(SRCDIR)/istack.c \ - $(SRCDIR)/parser.c $(SRCDIR)/tags.c $(SRCDIR)/entities.c \ - $(SRCDIR)/lexer.c $(SRCDIR)/pprint.c $(SRCDIR)/clean.c \ - $(SRCDIR)/localize.c $(SRCDIR)/config.c $(SRCDIR)/alloc.c \ - $(SRCDIR)/attrask.c $(SRCDIR)/attrget.c $(SRCDIR)/buffio.c \ - $(SRCDIR)/fileio.c $(SRCDIR)/streamio.c $(SRCDIR)/tagask.c \ - $(SRCDIR)/tagget.c $(SRCDIR)/tmbstr.c $(SRCDIR)/utf8.c \ - $(SRCDIR)/tidylib.c - -HFILES= $(INCDIR)/platform.h $(INCDIR)/tidy.h $(INCDIR)/tidyenum.h \ - $(INCDIR)/fileio.h $(INCDIR)/buffio.h - -LIBHFILES= \ - $(SRCDIR)/access.h \ - $(SRCDIR)/attrs.h $(SRCDIR)/clean.h \ - $(SRCDIR)/config.h $(SRCDIR)/entities.h \ - $(SRCDIR)/forward.h $(SRCDIR)/lexer.h $(SRCDIR)/message.h \ - $(SRCDIR)/parser.h $(SRCDIR)/pprint.h $(SRCDIR)/streamio.h \ - $(SRCDIR)/tags.h \ - $(SRCDIR)/tmbstr.h $(SRCDIR)/utf8.h $(SRCDIR)/tidy-int.h - - - -all: $(LIBRARY) $(EXES) - -$(LIBRARY): $(OBJFILES) - if [ ! -d $(LIBDIR) ]; then mkdir $(LIBDIR); fi - $(LIBTOOL) $(CC) -o $@ $(OBJFILES) - -$(OBJDIR)/%.o: $(SRCDIR)/%.c $(HFILES) $(LIBHFILES) Makefile - if [ ! -d $(OBJDIR) ]; then mkdir $(OBJDIR); fi - $(LIBTOOL) $(CC) -o $@ -c $(CFLAGS) $(OTHERCFLAGS) $< - -$(BINDIR)/tidy: $(APPDIR)/tidy.c $(HFILES) $(LIBRARY) - if [ ! -d $(BINDIR) ]; then mkdir $(BINDIR); fi - $(CC) $(CFLAGS) $(OTHERCFLAGS) -o $@ $(APPDIR)/tidy.c -I$(INCDIR) -L$(LIBDIR) -ltidy - -$(BINDIR)/tab2space: $(APPDIR)/tab2space.c - if [ ! -d $(BINDIR) ]; then mkdir $(BINDIR); fi - $(CC) $(CFLAGS) $(OTHERCFLAGS) -o $@ $(APPDIR)/tab2space.c $(LIBS) - -debug: - @$(MAKE) CFLAGS='$(CFLAGS) $(DEBUGFLAGS)' LIBS='$(LIBS) $(DEBUGLIBS)' all - -clean: - rm -f $(OBJFILES) $(EXES) $(LIBRARY) $(OBJDIR)/*.lo - if [ -d $(OBJDIR)/.libs ]; then rmdir $(OBJDIR)/.libs; fi - if [ "$(OBJDIR)" != "$(TOPDIR)" -a -d $(OBJDIR) ]; then rmdir $(OBJDIR); fi - if [ "$(LIBDIR)" != "$(TOPDIR)" -a -d $(LIBDIR) ]; then rmdir $(LIBDIR); fi - if [ "$(BINDIR)" != "$(TOPDIR)" -a -d $(BINDIR) ]; then rmdir $(BINDIR); fi - -installhdrs: $(HFILES) - if [ ! -d "$(incinst)" ]; then mkdir -p "$(incinst)"; fi - cp -f $(HFILES) "$(incinst)/" - -installib: $(LIBRARY) - if [ ! -d "$(libinst)" ]; then mkdir -p "$(libinst)"; fi - cp -f $(LIBRARY) "$(libinst)/" - -installexes: $(EXES) - if [ ! -d "$(bininst)" ]; then mkdir -p "$(bininst)"; fi - cp -f $(EXES) "$(bininst)/" - -installmanpage: - if [ -f "man_page.txt" ] ; then \ - if [ ! -d "$(maninst)/man1" ]; then mkdir -p "$(maninst)/man1"; fi; \ - cp -f man_page.txt "$(maninst)/man1/tidy.1"; \ - fi - -install: installhdrs installib installmanpage installexes diff --git a/tidylib-src/Makefile.vc6 b/tidylib-src/Makefile.vc6 deleted file mode 100755 index 4db46806..00000000 --- a/tidylib-src/Makefile.vc6 +++ /dev/null @@ -1,181 +0,0 @@ -# Makefile.vc6 - for tidy - HTML parser and pretty printer -# For use with Microsoft's Visual C++ 6 nmake tool -# -# CVS Info : -# -# $Author: creitzel $ -# $Date: 2002/11/08 18:36:13 $ -# $Revision: 1.2.2.8 $ -# -# Copyright (c) 1998-2002 World Wide Web Consortium -# (Massachusetts Institute of Technology, Institut National de -# Recherche en Informatique et en Automatique, Keio University). -# All Rights Reserved. -# -# Contributing Author(s): -# -# Dave Raggett -# Terry Teague -# Mark Hale -# Philippe Lhoste -# -# The contributing author(s) would like to thank all those who -# helped with testing, bug fixes, and patience. This wouldn't -# have been possible without all of you. -# -# COPYRIGHT NOTICE: -# -# This software and documentation is provided "as is," and -# the copyright holders and contributing author(s) make no -# representations or warranties, express or implied, including -# but not limited to, warranties of merchantability or fitness -# for any particular purpose or that the use of the software or -# documentation will not infringe any third party patents, -# copyrights, trademarks or other rights. -# -# The copyright holders and contributing author(s) will not be -# liable for any direct, indirect, special or consequential damages -# arising out of any use of the software or documentation, even if -# advised of the possibility of such damage. -# -# Permission is hereby granted to use, copy, modify, and distribute -# this source code, or portions hereof, documentation and executables, -# for any purpose, without fee, subject to the following restrictions: -# -# 1. The origin of this source code must not be misrepresented. -# 2. Altered versions must be plainly marked as such and must -# not be misrepresented as being the original source. -# 3. This Copyright notice may not be removed or altered from any -# source or altered source distribution. -# -# The copyright holders and contributing author(s) specifically -# permit, without fee, and encourage the use of this source code -# as a component for supporting the Hypertext Markup Language in -# commercial products. If you use this source code in a product, -# acknowledgment is not required but would be appreciated. -# -# Usage: -# nmake -f Makefile.vc6 -# or -# nmake -f Makefile.vc6 DEBUG=1 - -CC=cl -RC=rc -LD=link - -BINDIR= .\bin -INCLDIR= ./include/ -SRCDIR= ./src/ -TIDYEXT= /D SUPPORT_ACCESSIBILITY_CHECKS=1 /D SUPPORT_UTF16_ENCODINGS=1 /D SUPPORT_ASIAN_ENCODINGS=1 - -## General flags for compilation -# /W4 Sets warning level 4 (max) -# /Za Disables Microsoft extensions (aka ANSI) -# /FD Generate file dependencies -# /c Compiles without linking -# In the following, replace /D "_CONSOLE" by /D "_WINDOWS" for Windows programs - -CFLAGS=/nologo /TC /W4 /Za /FD /c /D "WIN32" /D "_CONSOLE" /D "_MBCS" $(TIDYEXT) /I $(INCLDIR) - -## Additional flags for debug compilation -# /Gm Enables minimal rebuild -# /GZ Catch release-build errors in debug build -# /Zi Generates complete debugging information -# /Od Disables optimization -# /MTd Uses debug version of statically linked, multi-threaded CRT. -# /MDd Uses debug version of multi-threaded CRT DLL. - -CDEBUG=/Gm /GZ /Zi /Od /MD /D "DEBUG" /D "_DEBUG" - -## Additional flags for release compilation -# /O1 Creates small code -# /O2 Creates fast code -# /Ox Uses maximum optimization (/Ob1gity /Gs) -# /MT Use statically linked, multi-threaded C runtime library -# /MD Uses multi-threaded CRT DLL. - -CNDEBUG=/Ox /MD /D "NDEBUG" - - -NAMEFLAG=/Fo -## General flags for link -# In the following, replace /subsystem:console by /subsystem:windows for Windows programs -LDFLAGS= /nologo /subsystem:console /machine:I386 /libpath:"." -LIBFLAGS= -lib - -## Additional flags for debug link -LDDEBUG=/debug /pdbtype:sept /nodefaultlib:LIBC - -## Additional flags for release link -LDNDEBUG=/opt:nowin98 /opt:ref /pdb:none - -#LIBS=KERNEL32.lib USER32.lib GDI32.lib COMDLG32.lib COMCTL32.lib ADVAPI32.lib IMM32.lib SHELL32.LIB OLE32.LIB -LIBS= -DEBUGLIBS= - -!IFDEF DEBUG -CFLAGS=$(CFLAGS) $(CDEBUG) -LDFLAGS=$(LDFLAGS) $(LDDEBUG) -OBJDIR= .\debug -!ELSE -CFLAGS=$(CFLAGS) $(CNDEBUG) -LDFLAGS=$(LDFLAGS) $(LDNDEBUG) -OBJDIR= .\release -!ENDIF - - -OBJFILES=$(OBJDIR)\access.obj $(OBJDIR)\attrs.obj $(OBJDIR)\istack.obj\ - $(OBJDIR)\parser.obj $(OBJDIR)\tags.obj $(OBJDIR)\entities.obj\ - $(OBJDIR)\lexer.obj $(OBJDIR)\pprint.obj $(OBJDIR)\clean.obj\ - $(OBJDIR)\localize.obj $(OBJDIR)\config.obj $(OBJDIR)\alloc.obj\ - $(OBJDIR)\attrask.obj $(OBJDIR)\attrget.obj $(OBJDIR)\buffio.obj\ - $(OBJDIR)\tagask.obj $(OBJDIR)\fileio.obj $(OBJDIR)\streamio.obj\ - $(OBJDIR)\tmbstr.obj $(OBJDIR)\utf8.obj $(OBJDIR)\tidylib.obj - -CFILES= $(SRCDIR)access.c $(SRCDIR)attrs.c $(SRCDIR)istack.c \ - $(SRCDIR)parser.c $(SRCDIR)tags.c $(SRCDIR)entities.c \ - $(SRCDIR)lexer.c $(SRCDIR)pprint.c $(SRCDIR)clean.c \ - $(SRCDIR)localize.c $(SRCDIR)config.c $(SRCDIR)alloc.c \ - $(SRCDIR)attrask.c $(SRCDIR)attrget.c $(SRCDIR)buffio.c \ - $(SRCDIR)tagask.c $(SRCDIR)fileio.c $(SRCDIR)streamio.c\ - $(SRCDIR)tmbstr.c $(SRCDIR)utf8.c $(SRCDIR)tidylib.c - -HFILES= $(INCLDIR)platform.h $(INCLDIR)buffio.h \ - $(INCLDIR)fileio.h $(INCLDIR)tidy.h $(INCLDIR)tidyenum.h - -LIBHFILES= \ - $(SRCDIR)access.h \ - $(SRCDIR)attrs.h $(SRCDIR)clean.h \ - $(SRCDIR)config.h $(SRCDIR)entities.h \ - $(SRCDIR)forward.h $(SRCDIR)lexer.h $(SRCDIR)message.h \ - $(SRCDIR)parser.h $(SRCDIR)pprint.h $(SRCDIR)streamio.h \ - $(SRCDIR)tags.h \ - $(SRCDIR)tmbstr.h $(SRCDIR)utf8.h $(SRCDIR)tidy-int.h - -$(OBJDIR) : - if not exist $(OBJDIR) mkdir $(OBJDIR) - -$(BINDIR) : - if not exist $(BINDIR) mkdir $(BINDIR) - -$(OBJDIR)/libtidy.lib: $(OBJFILES) - $(LD) $(LIBFLAGS) $(OBJFILES) /OUT:$(OBJDIR)/libtidy.lib - -$(BINDIR)/tidy.exe: ./console/tidy.c $(HFILES) $(OBJDIR)/libtidy.lib $(BINDIR) - $(CC) $(CFLAGS) ./console/tidy.c $(NAMEFLAG)$(OBJDIR)/ - $(LD) $(LDFLAGS) $(OBJDIR)/tidy.obj $(LIBS) $(OBJDIR)/libtidy.lib /OUT:$(BINDIR)/tidy.exe - -$(OBJFILES): $(HFILES) $(LIBHFILES) $(CFILES) Makefile.vc6 $(OBJDIR) - $(CC) $(CFLAGS) $(CFILES) $(NAMEFLAG)$(OBJDIR)/ - -$(BINDIR)/tab2space.exe: ./console/tab2space.c $(BINDIR) - $(CC) $(CFLAGS) ./console/tab2space.c $(NAMEFLAG)$(OBJDIR)/ - $(LD) $(LDFLAGS) $(OBJDIR)/tab2space.obj $(LIBS) /OUT:$(BINDIR)/tab2space.exe - -clean: - -del $(OBJFILES) $(OBJDIR)\tab2space.obj $(OBJDIR)\tidy.obj $(OBJDIR)\libtidy.lib $(BINDIR)\tidy.exe $(BINDIR)\tab2space.exe - -rd $(OBJDIR) - -rd $(BINDIR) - -all: $(OBJDIR)/libtidy.lib $(BINDIR)/tidy.exe $(BINDIR)/tab2space.exe - diff --git a/tidylib-src/console/tab2space.c b/tidylib-src/console/tab2space.c old mode 100755 new mode 100644 index 64c383ff..413f5227 --- a/tidylib-src/console/tab2space.c +++ b/tidylib-src/console/tab2space.c @@ -1,16 +1,16 @@ #include -#include +#include #include #include "platform.h" -#define true 1 -#define false 0 -#define TABSIZE 4 +#define true 1 +#define false 0 +#define TABSIZE 4 -#define CRLF 0 -#define UNIX 1 -#define MAC 2 +#define DOS_CRLF 0 +#define UNIX_LF 1 +#define MAC_CR 2 typedef struct { @@ -28,7 +28,7 @@ typedef struct } Stream; int tabsize = TABSIZE; -int endline = CRLF; +int endline = DOS_CRLF; Bool tabs = false; /* @@ -228,14 +228,14 @@ void WriteFile(Stream *in, FILE *fout) if (c == '\n') { - if (endline == CRLF) + if (endline == DOS_CRLF) { putc('\r', fout); putc('\n', fout); } - else if (endline == UNIX) + else if (endline == UNIX_LF) putc('\n', fout); - else /* Macs which use CR */ + else if (endline == MAC_CR) putc('\r', fout); continue; @@ -247,23 +247,23 @@ void WriteFile(Stream *in, FILE *fout) void HelpText(FILE *errout, char *prog) { - fprintf(errout, "%s: file1 file2 ...\n", prog); - fprintf(errout, "Utility to expand tabs and ensure consistent line ends\n"); - fprintf(errout, "options for tab2space vers: 3rd January 2002\n"); - fprintf(errout, " -t8 set tabs to 8 (default is 4)\n"); - fprintf(errout, " -crlf set line ends to CRLF (PC-DOS/Windows - default)\n"); + fprintf(errout, "%s: [options] [infile [outfile]] ...\n", prog); + fprintf(errout, "Utility to expand tabs and ensure consistent line endings\n"); + fprintf(errout, "options for tab2space vers: 6th February 2003\n"); + fprintf(errout, " -help or -h display this help message\n"); + fprintf(errout, " -dos or -crlf set line ends to CRLF (PC-DOS/Windows - default)\n"); + fprintf(errout, " -mac or -cr set line ends to CR (classic Mac OS)\n"); fprintf(errout, " -unix or -lf set line ends to LF (Unix)\n"); - fprintf(errout, " -cr set line ends to CR (classic Mac OS)\n"); fprintf(errout, " -tabs preserve tabs, e.g. for Makefile\n"); - fprintf(errout, " -help or -h display this help message\n"); + fprintf(errout, " -t set tabs to (default is 4) spaces\n"); fprintf(errout, "\nNote this utility doesn't map spaces to tabs!\n"); } int main(int argc, char **argv) { - char *file, *prog; + char *infile, *outfile, *prog; FILE *fin, *fout; - Stream *in; + Stream *in = null; prog = argv[0]; @@ -277,46 +277,23 @@ int main(int argc, char **argv) return 1; } - if (strncmp(argv[1], "-t", 2) == 0) - { - sscanf(argv[1]+2, "%d", &tabsize); - --argc; - ++argv; - continue; - } - - if (strcmp(argv[1], "-unix") == 0 || - strcmp(argv[1], "-lf") == 0) - { - endline = UNIX; - --argc; - ++argv; - continue; - } + if (strcmp(argv[1], "-dos") == 0 || + strcmp(argv[1], "-crlf") == 0) + endline = DOS_CRLF; - if (strcmp(argv[1], "-crlf") == 0) - { - endline = CRLF; - --argc; - ++argv; - continue; - } + else if (strcmp(argv[1], "-mac") == 0 || + strcmp(argv[1], "-cr") == 0) + endline = MAC_CR; - if (strcmp(argv[1], "-cr") == 0) - { - endline = MAC; - --argc; - ++argv; - continue; - } + else if (strcmp(argv[1], "-unix") == 0 || + strcmp(argv[1], "-lf") == 0) + endline = UNIX_LF; - if (strcmp(argv[1], "-tabs") == 0) - { + else if (strcmp(argv[1], "-tabs") == 0) tabs = true; - --argc; - ++argv; - continue; - } + + else if (strncmp(argv[1], "-t", 2) == 0) + sscanf(argv[1]+2, "%d", &tabsize); --argc; ++argv; @@ -325,50 +302,56 @@ int main(int argc, char **argv) if (argc > 1) { - file = argv[1]; - fin = fopen(file, "rb"); + infile = argv[1]; + fin = fopen(infile, "rb"); } else { + infile = "stdin"; fin = stdin; - file = "stdin"; } - if (fin != null) + if (argc > 2) + { + outfile = argv[2]; + fout = null; + --argc; + ++argv; + } + else + { + outfile = "stdout"; + fout = stdout; + } + + if (fin) { in = ReadFile(fin); if (fin != stdin) fclose(fin); - - if (argc > 0) - { - file = argv[1]; - fout = fopen(file, "wb"); - } - else - { - fout = stdin; - file = "stdin"; - } - + + if (fout != stdout) + fout = fopen(outfile, "wb"); + if (fout) { - WriteFile(in, fout); - fclose(fout); + WriteFile(in, fout); + + if (fout != stdout) + fclose(fout); } else - fprintf(stderr, "%s - can't open \"%s\" for writing\n", prog, file); + fprintf(stderr, "%s - can't open \"%s\" for writing\n", prog, outfile); FreeStream(in); - } else - fprintf(stderr, "%s - can't open \"%s\" for reading\n", prog, file); + fprintf(stderr, "%s - can't open \"%s\" for reading\n", prog, infile); --argc; ++argv; - + if (argc <= 1) break; } diff --git a/tidylib-src/console/tidy.c b/tidylib-src/console/tidy.c old mode 100755 new mode 100644 index afbff783..b2ee69ea --- a/tidylib-src/console/tidy.c +++ b/tidylib-src/console/tidy.c @@ -1,7 +1,7 @@ /* cmmdline.c - HTML Tidy command line driver - Copyright (c) 1998-2002 World Wide Web Consortium + Copyright (c) 1998-2003 World Wide Web Consortium (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. @@ -9,8 +9,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/11/02 20:10:47 $ - $Revision: 1.1.2.7 $ + $Date: 2003/02/16 19:33:04 $ + $Revision: 1.2 $ */ #include "tidy.h" @@ -20,11 +20,21 @@ uint contentWarnings = 0; uint optionErrors = 0; uint accessWarnings = 0; -FILE* errout = null; /* set to stderr or stdout */ +FILE* errout = null; /* set to stderr */ +FILE* txtout = null; /* set to stdout */ + +Bool samefile( ctmbstr filename1, ctmbstr filename2 ) +{ +#if FILENAMES_CASE_SENSITIVE + return ( strcmp( filename1, filename2 ) == 0 ); +#else + return ( strcasecmp( filename1, filename2 ) == 0 ); +#endif +} void help( TidyDoc tdoc, ctmbstr prog ) { - printf( "%s [option...] [file...]\n", prog ); + printf( "%s [option...] [file...] [option...] [file...]\n", prog ); printf( "Utility to clean up and pretty print HTML/XHTML/XML\n"); printf( "see http://tidy.sourgeforge.net/\n"); printf( "\n"); @@ -37,66 +47,68 @@ void help( TidyDoc tdoc, ctmbstr prog ) #endif printf( "\n"); + printf( "File manipulation\n"); + printf( "-----------------\n"); + printf( " -out or -o specify the output markup file\n"); + printf( " -config set configuration options from the specified \n"); + printf( " -f write errors to the specified \n"); + printf( " -modify or -m modify the original input files\n"); + printf( "\n"); + printf( "Processing directives\n"); printf( "---------------------\n"); - printf( " -indent or -i to indent element content\n"); - printf( " -omit or -o to omit optional end tags\n"); - printf( " -wrap to wrap text at the specified (default is 68)\n"); - printf( " -upper or -u to force tags to upper case (default is lower case)\n"); - printf( " -clean or -c to replace FONT, NOBR and CENTER tags by CSS\n"); - printf( " -bare or -b to strip out smart quotes and em dashes, etc.\n"); - printf( " -numeric or -n to output numeric rather than named entities\n"); - printf( " -errors or -e to only show errors\n"); - printf( " -quiet or -q to suppress nonessential output\n"); - printf( " -xml to specify the input is well formed XML\n"); - printf( " -asxml to convert HTML to well formed XHTML\n"); - printf( " -asxhtml to convert HTML to well formed XHTML\n"); - printf( " -ashtml to force XHTML to well formed HTML\n"); + printf( " -indent or -i indent element content\n"); + printf( " -wrap wrap text at the specified (default is 68)\n"); + printf( " -upper or -u force tags to upper case (default is lower case)\n"); + printf( " -clean or -c replace FONT, NOBR and CENTER tags by CSS\n"); + printf( " -bare or -b strip out smart quotes and em dashes, etc.\n"); + printf( " -numeric or -n output numeric rather than named entities\n"); + printf( " -errors or -e only show errors\n"); + printf( " -quiet or -q suppress nonessential output\n"); + printf( " -omit omit optional end tags\n"); + printf( " -xml specify the input is well formed XML\n"); + printf( " -asxml convert HTML to well formed XHTML\n"); + printf( " -asxhtml convert HTML to well formed XHTML\n"); + printf( " -ashtml force XHTML to well formed HTML\n"); /* TRT */ #if SUPPORT_ACCESSIBILITY_CHECKS - printf( " -access to do additional accessibility checks ( = 1, 2, 3)\n"); + printf( " -access do additional accessibility checks ( = 1, 2, 3)\n"); #endif printf( "\n"); printf( "Character encodings\n"); printf( "-------------------\n"); - printf( " -raw to output values above 127 without conversion to entities\n"); - printf( " -ascii to use US-ASCII for output, ISO-8859-1 for input\n"); - printf( " -latin1 to use ISO-8859-1 for both input and output\n"); - printf( " -iso2022 to use ISO-2022 for both input and output\n"); - printf( " -utf8 to use UTF-8 for both input and output\n"); - printf( " -mac to use MacRoman for input, US-ASCII for output\n"); + printf( " -raw output values above 127 without conversion to entities\n"); + printf( " -ascii use US-ASCII for output, ISO-8859-1 for input\n"); + printf( " -latin0 use US-ASCII for output, ISO-8859-1 for input\n"); + printf( " -latin1 use ISO-8859-1 for both input and output\n"); + printf( " -iso2022 use ISO-2022 for both input and output\n"); + printf( " -utf8 use UTF-8 for both input and output\n"); + printf( " -mac use MacRoman for input, US-ASCII for output\n"); + printf( " -win1252 use Windows-1252 for input, US-ASCII for output\n"); + printf( " -ibm858 use IBM-858 (CP850+Euro) for input, US-ASCII for output\n"); #if SUPPORT_UTF16_ENCODINGS - printf( " -utf16le to use UTF-16LE for both input and output\n"); - printf( " -utf16be to use UTF-16BE for both input and output\n"); - printf( " -utf16 to use UTF-16 for both input and output\n"); + printf( " -utf16le use UTF-16LE for both input and output\n"); + printf( " -utf16be use UTF-16BE for both input and output\n"); + printf( " -utf16 use UTF-16 for both input and output\n"); #endif - printf( " -win1252 to use Windows-1252 for input, US-ASCII for output\n"); - -#if SUPPORT_ASIAN_ENCODINGS - printf( " -big5 to use Big5 for both input and output\n"); /* #431953 - RJ */ - printf( " -shiftjis to use Shift_JIS for both input and output\n"); /* #431953 - RJ */ - printf( " -language to set the two-letter language code (for future use)\n"); /* #431953 - RJ */ +#if SUPPORT_ASIAN_ENCODINGS /* #431953 - RJ */ + printf( " -big5 use Big5 for both input and output\n"); + printf( " -shiftjis use Shift_JIS for both input and output\n"); + printf( " -language set the two-letter language code (for future use)\n"); #endif printf( "\n"); - printf( "File manipulation\n"); - printf( "-----------------\n"); - printf( " -config to set configuration options from the specified \n"); - printf( " -f to write errors to the specified \n"); - printf( " -modify or -m to modify the original input files\n"); - printf( "\n"); - printf( "Miscellaneous\n"); printf( "-------------\n"); - printf( " -version or -v to show the version of Tidy\n"); - printf( " -help, -h or -? to list the command line options\n"); - printf( " -help-config to list all configuration options\n"); - printf( " -show-config to list the current configuration settings\n"); + printf( " -version or -v show the version of Tidy\n"); + printf( " -help, -h or -? list the command line options\n"); + printf( " -help-config list all configuration options\n"); + printf( " -show-config list the current configuration settings\n"); printf( "\n"); printf( "Use --blah blarg for any configuration option \"blah\" with argument \"blarg\"\n"); printf( "\n"); @@ -118,7 +130,13 @@ void optionhelp( TidyDoc tdoc, ctmbstr prog ) { TidyIterator pos = tidyGetOptionList( tdoc ); - printf( "\nConfiguration File Settings:\n\n" ); + printf( "\nHTML Tidy Configuration Settings\n\n" ); + printf( "Within a file, use the form:\n\n" ); + printf( "wrap: 72\n" ); + printf( "split: no\n\n" ); + printf( "When specified on the command line, use the form:\n\n" ); + printf( "--wrap 72 --split no\n\n"); + printf( fmt, "Name", "Type", "Allowable values" ); printf( fmt, ul, ul, ul ); @@ -141,7 +159,9 @@ void optionhelp( TidyDoc tdoc, ctmbstr prog ) switch ( optId ) { case TidyIndentContent: +#if SUPPORT_UTF16_ENCODINGS case TidyOutputBOM: +#endif type = "AutoBool"; vals = "auto, y/n, yes/no, t/f, true/false, 1/0"; break; @@ -177,7 +197,7 @@ void optionhelp( TidyDoc tdoc, ctmbstr prog ) case TidyInCharEncoding: case TidyOutCharEncoding: type = "Encoding"; - vals = "ascii, latin1, raw, utf8, iso2022, mac,"; + vals = "ascii, latin0, latin1, raw, utf8, iso2022,"; printf( fmt, name, type, vals ); name = ""; type = ""; @@ -187,12 +207,17 @@ void optionhelp( TidyDoc tdoc, ctmbstr prog ) printf( fmt, name, type, vals ); #endif #if SUPPORT_ASIAN_ENCODINGS - vals = "win1252, big5, shiftjis"; + vals = "mac, win1252, ibm858, big5, shiftjis"; #else - vals = "win1252"; + vals = "mac, win1252, ibm858"; #endif break; + case TidyNewline: + type = "enum"; + vals = "LF, CRLF, CR"; + break; + /* General case will handle remaining */ default: switch ( optTyp ) @@ -252,7 +277,9 @@ void optionvalues( TidyDoc tdoc, ctmbstr prog ) switch ( optId ) { case TidyIndentContent: +#if SUPPORT_UTF16_ENCODINGS case TidyOutputBOM: +#endif type = "AutoBool"; vals = (tmbstr) tidyOptGetCurrPick( tdoc, optId ); break; @@ -306,6 +333,11 @@ void optionvalues( TidyDoc tdoc, ctmbstr prog ) vals = (tmbstr) sval; break; + case TidyNewline: + type = "enum"; + vals = (tmbstr) tidyOptGetCurrPick( tdoc, optId ); + break; + /* General case will handle remaining */ default: switch ( optTyp ) @@ -367,6 +399,10 @@ int main( int argc, char** argv ) errout = stderr; /* initialize to stderr */ +#ifdef CONFIG_FILE + tidyLoadConfig( tdoc, CONFIG_FILE ); +#endif /* CONFIG_FILE */ + /* look for env var "HTML_TIDY" */ /* then for ~/.tidyrc (on platforms defining $HOME) */ @@ -398,7 +434,7 @@ int main( int argc, char** argv ) else if ( strcasecmp(arg, "indent") == 0 ) { - tidyOptSetInt( tdoc, TidyIndentContent, TidyAutoState ); + tidyOptSetInt( tdoc, TidyIndentContent, TidyYesState ); } else if ( strcasecmp(arg, "omit") == 0 ) tidyOptSetBool( tdoc, TidyHideEndTags, yes ); @@ -412,22 +448,24 @@ int main( int argc, char** argv ) else if ( strcasecmp(arg, "bare") == 0 ) tidyOptSetBool( tdoc, TidyMakeBare, yes ); - else if ( strcasecmp(arg, "raw") == 0 || - strcasecmp(arg, "ascii") == 0 || - strcasecmp(arg, "latin1") == 0 || - strcasecmp(arg, "utf8") == 0 || - strcasecmp(arg, "iso2022") == 0 || + else if ( strcasecmp(arg, "raw") == 0 || + strcasecmp(arg, "ascii") == 0 || + strcasecmp(arg, "latin0") == 0 || + strcasecmp(arg, "latin1") == 0 || + strcasecmp(arg, "utf8") == 0 || + strcasecmp(arg, "iso2022") == 0 || #if SUPPORT_UTF16_ENCODINGS - strcasecmp(arg, "utf16le") == 0 || - strcasecmp(arg, "utf16be") == 0 || - strcasecmp(arg, "utf16") == 0 || + strcasecmp(arg, "utf16le") == 0 || + strcasecmp(arg, "utf16be") == 0 || + strcasecmp(arg, "utf16") == 0 || #endif #if SUPPORT_ASIAN_ENCODINGS strcasecmp(arg, "shiftjis") == 0 || strcasecmp(arg, "big5") == 0 || #endif - strcasecmp(arg, "mac") == 0 || - strcasecmp(arg, "win1252") == 0 ) + strcasecmp(arg, "mac") == 0 || + strcasecmp(arg, "win1252") == 0 || + strcasecmp(arg, "ibm858") == 0 ) { tidySetCharEncoding( tdoc, arg ); } @@ -469,7 +507,18 @@ int main( int argc, char** argv ) { if ( argc >= 3 ) { + ctmbstr post; + tidyLoadConfig( tdoc, argv[2] ); + + /* Set new error output stream if setting changed */ + post = tidyOptGetValue( tdoc, TidyErrFile ); + if ( post && (!errfil || !samefile(errfil, post)) ) + { + errfil = post; + errout = tidySetErrorFile( tdoc, post ); + } + --argc; ++argv; } @@ -488,6 +537,17 @@ int main( int argc, char** argv ) } #endif + else if ( strcasecmp(arg, "output") == 0 || + strcasecmp(arg, "-output-file") == 0 || + strcasecmp(arg, "o") == 0 ) + { + if ( argc >= 3 ) + { + tidyOptSetValue( tdoc, TidyOutFile, argv[2] ); + --argc; + ++argv; + } + } else if ( strcasecmp(arg, "file") == 0 || strcasecmp(arg, "-file") == 0 || strcasecmp(arg, "f") == 0 ) @@ -555,12 +615,14 @@ int main( int argc, char** argv ) switch ( c ) { case 'i': - tidyOptSetInt(tdoc, TidyIndentContent, TidyAutoState); + tidyOptSetInt(tdoc, TidyIndentContent, TidyYesState); break; + /* Usurp -o for output file. Anyone hiding end tags? case 'o': tidyOptSetBool( tdoc, TidyHideEndTags, yes ); break; + */ case 'u': tidyOptSetBool( tdoc, TidyUpperCaseTags, yes ); @@ -605,6 +667,8 @@ int main( int argc, char** argv ) if ( argc > 1 ) { htmlfil = argv[1]; + if ( tidyOptGetBool(tdoc, TidyEmacs) ) + tidyOptSetValue( tdoc, TidyEmacsFile, htmlfil ); status = tidyParseFile( tdoc, htmlfil ); } else @@ -624,8 +688,13 @@ int main( int argc, char** argv ) if ( tidyOptGetBool(tdoc, TidyWriteBack) ) status = tidySaveFile( tdoc, htmlfil ); else - status = tidySaveStdout( tdoc ); - + { + ctmbstr outfil = tidyOptGetValue( tdoc, TidyOutFile ); + if ( outfil ) + status = tidySaveFile( tdoc, outfil ); + else + status = tidySaveStdout( tdoc ); + } } contentErrors += tidyErrorCount( tdoc ); diff --git a/tidylib-src/export.cmd b/tidylib-src/export.cmd deleted file mode 100755 index 41e050f8..00000000 --- a/tidylib-src/export.cmd +++ /dev/null @@ -1,4 +0,0 @@ -rm -R Makefile Makefile.vc6 include src console test -cvs -d :pserver:anonymous@cvs.tidy.sourceforge.net:/cvsroot/tidy login -cvs -d :pserver:anonymous@cvs.tidy.sourceforge.net:/cvsroot/tidy export -r TIDYLIB_0_1 -d d:\tidyexport Makefile Makefile.vc6 include src console test -cp \tidytag\MakeDLL.vc6 . diff --git a/tidylib-src/include/buffio.h b/tidylib-src/include/buffio.h old mode 100755 new mode 100644 index 71ffab33..78bc8ff4 --- a/tidylib-src/include/buffio.h +++ b/tidylib-src/include/buffio.h @@ -1,7 +1,7 @@ #ifndef __BUFFIO_H__ #define __BUFFIO_H__ -/* buffio.h -- Treat buffer as an I/O stream. +/** @file buffio.h - Treat buffer as an I/O stream. (c) 1998-2002 (W3C) MIT, INRIA, Keio University See tidy.h for the copyright notice. @@ -9,8 +9,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/10/15 19:46:52 $ - $Revision: 1.1.2.3 $ + $Date: 2003/02/16 19:33:08 $ + $Revision: 1.2 $ Requires buffer to automatically grow as bytes are added. Must keep track of current read and write points. @@ -24,31 +24,58 @@ extern "C" { #endif +/** TidyBuffer - A chunk of memory */ TIDY_STRUCT struct _TidyBuffer { - byte* bp; - uint size; - uint allocated; - uint next; + byte* bp; /**< Pointer to bytes */ + uint size; /**< # bytes currently in use */ + uint allocated; /**< # bytes allocated */ + uint next; /**< Offset of current input position */ }; +/** Zero out data structure */ TIDY_EXPORT void tidyBufInit( TidyBuffer* buf ); + +/** Free current buffer, allocate given amount, reset input pointer */ TIDY_EXPORT void tidyBufAlloc( TidyBuffer* buf, uint allocSize ); + +/** Expand buffer to given size. +** Chunk size is minimum growth. Pass 0 for default of 256 bytes. +*/ TIDY_EXPORT void tidyBufCheckAlloc( TidyBuffer* buf, uint allocSize, uint chunkSize ); + +/** Free current contents and zero out */ TIDY_EXPORT void tidyBufFree( TidyBuffer* buf ); +/** Set buffer bytes to 0 */ TIDY_EXPORT void tidyBufClear( TidyBuffer* buf ); + +/** Attach to existing buffer */ TIDY_EXPORT void tidyBufAttach( TidyBuffer* buf, void* bp, uint size ); + +/** Detach from buffer. Caller must free. */ TIDY_EXPORT void tidyBufDetach( TidyBuffer* buf ); + +/** Append bytes to buffer. Expand if necessary. */ TIDY_EXPORT void tidyBufAppend( TidyBuffer* buf, void* vp, uint size ); + +/** Append one byte to buffer. Expand if necessary. */ TIDY_EXPORT void tidyBufPutByte( TidyBuffer* buf, byte bv ); + +/** Get byte from end of buffer */ TIDY_EXPORT int tidyBufPopByte( TidyBuffer* buf ); + +/** Get byte from front of buffer. Increment input offset. */ TIDY_EXPORT int tidyBufGetByte( TidyBuffer* buf ); + +/** At end of buffer? */ TIDY_EXPORT Bool tidyBufEndOfInput( TidyBuffer* buf ); + +/** Put a byte back into the buffer. Decrement input offset. */ TIDY_EXPORT void tidyBufUngetByte( TidyBuffer* buf, byte bv ); @@ -59,7 +86,10 @@ TIDY_EXPORT void tidyBufUngetByte( TidyBuffer* buf, byte bv ); /* Forward declarations */ +/** Initialize a buffer input source */ TIDY_EXPORT void initInputBuffer( TidyInputSource* inp, TidyBuffer* buf ); + +/** Initialize a buffer output sink */ TIDY_EXPORT void initOutputBuffer( TidyOutputSink* outp, TidyBuffer* buf ); #ifdef __cplusplus diff --git a/tidylib-src/include/fileio.h b/tidylib-src/include/fileio.h old mode 100755 new mode 100644 index 4fb5d111..e8f78268 --- a/tidylib-src/include/fileio.h +++ b/tidylib-src/include/fileio.h @@ -1,20 +1,18 @@ #ifndef __FILEIO_H__ #define __FILEIO_H__ -/* fileio.h -- does standard I/O +/** @file fileio.h - does standard C I/O + + Implementation of a FILE* based TidyInputSource and + TidyOutputSink. (c) 1998-2002 (W3C) MIT, INRIA, Keio University See tidy.h for the copyright notice. - CVS Info : - + CVS Info: $Author: creitzel $ - $Date: 2002/07/28 18:10:16 $ - $Revision: 1.1.2.1 $ - - Implementation of a FILE* based TidyInputSource and - TidyOutputSink. - + $Date: 2003/02/16 19:33:08 $ + $Revision: 1.2 $ */ #include "buffio.h" @@ -22,11 +20,16 @@ extern "C" { #endif +/** Allocate and initialize file input source */ void initFileSource( TidyInputSource* source, FILE* fp ); + +/** Free file input source */ void freeFileSource( TidyInputSource* source, Bool closeIt ); +/** Initialize file output sink */ void initFileSink( TidyOutputSink* sink, FILE* fp ); +/* Needed for internal declarations */ void filesink_putByte( uint sinkData, byte bv ); #ifdef __cplusplus diff --git a/tidylib-src/include/platform.h b/tidylib-src/include/platform.h old mode 100755 new mode 100644 index 1e77ff75..56d17887 --- a/tidylib-src/include/platform.h +++ b/tidylib-src/include/platform.h @@ -3,14 +3,14 @@ /* platform.h -- Platform specifics - (c) 1998-2002 (W3C) MIT, INRIA, Keio University + (c) 1998-2003 (W3C) MIT, INRIA, Keio University See tidy.h for the copyright notice. CVS Info : - $Author: terry_teague $ - $Date: 2002/10/06 19:08:41 $ - $Revision: 1.30.2.8 $ + $Author: creitzel $ + $Date: 2003/02/16 19:33:09 $ + $Revision: 1.35 $ */ @@ -80,15 +80,6 @@ extern "C" { #define PLATFORM_NAME "Mac OS" #endif -#elif defined(__linux__) && defined(__powerpc__) -#if #system(linux) -/* MkLinux on PPC - gcc (egcs) compiler */ -#define MAC_OS_MKLINUX -#ifndef PLATFORM_NAME -#define PLATFORM_NAME "MkLinux" -#endif -#endif - #elif defined(__APPLE__) && defined(__MACH__) /* Mac OS X (client) 10.x (or server 1.x/10.x) - gcc or Metrowerks MachO compilers */ #define MAC_OS_X @@ -97,7 +88,7 @@ extern "C" { #endif #endif -#if defined(MAC_OS_CLASSIC) || defined(MAC_OS_MKLINUX) || defined(MAC_OS_X) +#if defined(MAC_OS_CLASSIC) || defined(MAC_OS_X) /* Any OS on Mac platform */ #define MAC_OS #define FILENAMES_CASE_SENSITIVE 0 @@ -177,10 +168,24 @@ extern "C" { #elif defined(linux) && defined(__powerpc__) /* Linux on PPC - gcc compiler */ #define LINUX_OS + +#if defined(__linux__) && defined(__powerpc__) + +/* #if #system(linux) */ +/* MkLinux on PPC - gcc (egcs) compiler */ +/* #define MAC_OS_MKLINUX */ +#ifndef PLATFORM_NAME +#define PLATFORM_NAME "MkLinux" +#endif + +#else + #ifndef PLATFORM_NAME #define PLATFORM_NAME "Linux/PPC" #endif +#endif + #elif defined(linux) || defined(__linux__) /* generic Linux */ #define LINUX_OS @@ -225,6 +230,7 @@ extern "C" { #define PLATFORM_NAME "OS/2" #endif #define FILENAMES_CASE_SENSITIVE 0 +#define strcasecmp stricmp #endif /* Convenience defines for IRIX */ @@ -284,6 +290,29 @@ extern "C" { #endif #endif +/* Convenience defines for ARM platforms */ + +#if defined(__arm) +#define ARM_OS + +#if defined(forARM) && defined(__NEWTON_H) + +/* Using Newton C++ Tools ARMCpp compiler */ +#define NEWTON_OS +#ifndef PLATFORM_NAME +#define PLATFORM_NAME "Newton" +#endif + +#else + +#ifndef PLATFORM_NAME +#define PLATFORM_NAME "ARM" +#endif + +#endif + +#endif + #include #include #include /* for longjmp on error exit */ @@ -307,7 +336,7 @@ extern "C" { #endif /* This can be set at compile time. Usually Windows, -** except for MacIntosh builds. +** except for Macintosh builds. */ #ifndef DFLT_REPL_CHARENC #define DFLT_REPL_CHARENC WIN1252 diff --git a/tidylib-src/include/tidy.h b/tidylib-src/include/tidy.h old mode 100755 new mode 100644 index 5b7c6f67..e0f4e673 --- a/tidylib-src/include/tidy.h +++ b/tidylib-src/include/tidy.h @@ -1,7 +1,7 @@ #ifndef __TIDY_H__ #define __TIDY_H__ -/* tidy.h -- Defines HTML Tidy API implemented by tidy library. +/** @file tidy.h - Defines HTML Tidy API implemented by tidy library. Public interface is const-correct and doesn't explicitly depend on any globals. Thus, thread-safety may be introduced w/out @@ -19,8 +19,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/10/15 19:46:52 $ - $Revision: 1.1.2.10 $ + $Date: 2003/02/16 19:33:09 $ + $Revision: 1.2 $ Contributing Author(s): @@ -74,112 +74,286 @@ extern "C" { #endif -/* Opaque data structures. -* Cast to implementation types within lib. -* Reduces inter-dependencies/conflicts w/ application code. +/** @defgroup Opaque Opaque Types +** +** Cast to implementation types within lib. +** Reduces inter-dependencies/conflicts w/ application code. +** @{ +*/ + +/** @struct TidyDoc +** Opaque document datatype */ opaque( TidyDoc ); + +/** @struct TidyOption +** Opaque option datatype +*/ opaque( TidyOption ); + +/** @struct TidyNode +** Opaque node datatype +*/ opaque( TidyNode ); + +/** @struct TidyAttr +** Opaque attribute datatype +*/ opaque( TidyAttr ); +/** @} */ + TIDY_STRUCT struct _TidyBuffer; typedef struct _TidyBuffer TidyBuffer; -/* Tidy public interface + +/** @defgroup Basic Basic Operations ** -** Most functions return an integer: +** Tidy public interface ** +** Several functions return an integer document status: +** +**
 ** 0    -> SUCCESS
-** >0   -> WARNING
-** <0   -> ERROR
+** >0   -> 1 == TIDY WARNING, 2 == TIDY ERROR
+** <0   -> SEVERE ERROR
+** 
** +The following is a short example program. + +
+#include <tidy.h>
+#include <buffio.h>
+#include <stdio.h>
+#include <errno.h>
+
+
+int main(int argc, char **argv )
+{
+  const char* input = "<title>Foo</title><p>Foo!";
+  TidyBuffer output = {0};
+  TidyBuffer errbuf = {0};
+  int rc = -1;
+  Bool ok;
+
+  TidyDoc tdoc = tidyCreate();                     // Initialize "document"
+  printf( "Tidying:\t\%s\\n", input );
+
+  ok = tidyOptSetBool( tdoc, TidyXhtmlOut, yes );  // Convert to XHTML
+  if ( ok )
+    rc = tidySetErrorBuffer( tdoc, &errbuf );      // Capture diagnostics
+  if ( rc >= 0 )
+    rc = tidyParseString( tdoc, input );           // Parse the input
+  if ( rc >= 0 )
+    rc = tidyCleanAndRepair( tdoc );               // Tidy it up!
+  if ( rc >= 0 )
+    rc = tidyRunDiagnostics( tdoc );               // Kvetch
+  if ( rc > 1 )                                    // If error, force output.
+    rc = ( tidyOptSetBool(tdoc, TidyForceOutput, yes) ? rc : -1 );
+  if ( rc >= 0 )
+    rc = tidySaveBuffer( tdoc, &output );          // Pretty Print
+
+  if ( rc >= 0 )
+  {
+    if ( rc > 0 )
+      printf( "\\nDiagnostics:\\n\\n\%s", errbuf.bp );
+    printf( "\\nAnd here is the result:\\n\\n\%s", output.bp );
+  }
+  else
+    printf( "A severe error (\%d) occurred.\\n", rc );
+
+  tidyBufFree( &output );
+  tidyBufFree( &errbuf );
+  tidyRelease( tdoc );
+  return rc;
+}
+
+** @{ */ TIDY_EXPORT TidyDoc tidyCreate(); TIDY_EXPORT void tidyRelease( TidyDoc tdoc ); -/* Let application store a chunk of data w/ each Tidy instance. -** Useful for callbacks. +/** Let application store a chunk of data w/ each Tidy instance. +** Useful for callbacks. */ TIDY_EXPORT void tidySetAppData( TidyDoc tdoc, uint appData ); + +/** Get application data set previously */ TIDY_EXPORT uint tidyGetAppData( TidyDoc tdoc ); +/** Get release date (version) for current library */ TIDY_EXPORT ctmbstr tidyReleaseDate(); -/* Diagnostics and Repair */ +/* Diagnostics and Repair +*/ + +/** Get status of current document. */ TIDY_EXPORT int tidyStatus( TidyDoc tdoc ); -TIDY_EXPORT int tidyDetectedHtmlVersion( TidyDoc tdoc ); /* 0, 2, 3 or 4 */ + +/** Detected HTML version: 0, 2, 3 or 4 */ +TIDY_EXPORT int tidyDetectedHtmlVersion( TidyDoc tdoc ); + +/** Input is XHTML? */ TIDY_EXPORT Bool tidyDetectedXhtml( TidyDoc tdoc ); + +/** Input is generic XML (not HTML or XHTML)? */ TIDY_EXPORT Bool tidyDetectedGenericXml( TidyDoc tdoc ); +/** Number of Tidy errors encountered. If > 0, output is suppressed +** unless TidyForceOutput is set. +*/ TIDY_EXPORT uint tidyErrorCount( TidyDoc tdoc ); + +/** Number of Tidy warnings encountered. */ TIDY_EXPORT uint tidyWarningCount( TidyDoc tdoc ); + +/** Number of Tidy accessibility warnings encountered. */ TIDY_EXPORT uint tidyAccessWarningCount( TidyDoc tdoc ); + +/** Number of Tidy configuration errors encountered. */ TIDY_EXPORT uint tidyConfigErrorCount( TidyDoc tdoc ); /* Get/Set configuration options */ +/** Load an ASCII Tidy configuration file */ TIDY_EXPORT int tidyLoadConfig( TidyDoc tdoc, ctmbstr configFile ); -TIDY_EXPORT int tidyLoadConfigEnc( TidyDoc tdoc, - ctmbstr configFile, ctmbstr charenc ); +/** Load a Tidy configuration file with the specified character encoding */ +TIDY_EXPORT int tidyLoadConfigEnc( TidyDoc tdoc, ctmbstr configFile, + ctmbstr charenc ); + +/** Set the input/output character encoding for parsing markup. +** Values include: ascii, latin1, raw, utf8, iso2022, mac, +** win1252, utf16le, utf16be, utf16, big5 and shiftjis. Case in-sensitive. +*/ TIDY_EXPORT int tidySetCharEncoding( TidyDoc tdoc, ctmbstr encnam ); -/* Enumerate configuration options +/** @} end Basic group */ + + +/** @defgroup Configuration Configuration Options +** +** Functions for getting and setting Tidy configuration options. +** @{ */ +/** Applications using TidyLib may want to augment command-line and +** configuration file options. Setting this callback allows an application +** developer to examine command-line and configuration file options after +** TidyLib has examined them and failed to recognize them. +**/ + +typedef Bool (*TidyOptCallback)( ctmbstr option, ctmbstr value ); + +TIDY_EXPORT Bool tidySetOptionCallback( TidyDoc tdoc, TidyOptCallback pOptCallback ); + +/** Get option ID by name */ TIDY_EXPORT TidyOptionId tidyOptGetIdForName( ctmbstr optnam ); +/** Get iterator for list of option */ +/** +Example: +
+TidyIterator itOpt = tidyGetOptionList( tdoc );
+while ( itOpt )
+{
+  TidyOption opt = tidyGetNextOption( tdoc, &itOpt );
+  .. get/set option values ..
+}
+
+*/ + TIDY_EXPORT TidyIterator tidyGetOptionList( TidyDoc tdoc ); +/** Get next Option */ TIDY_EXPORT TidyOption tidyGetNextOption( TidyDoc tdoc, TidyIterator* pos ); +/** Lookup option by ID */ TIDY_EXPORT TidyOption tidyGetOption( TidyDoc tdoc, TidyOptionId optId ); +/** Lookup option by name */ TIDY_EXPORT TidyOption tidyGetOptionByName( TidyDoc tdoc, ctmbstr optnam ); +/** Get ID of given Option */ TIDY_EXPORT TidyOptionId tidyOptGetId( TidyOption opt ); + +/** Get name of given Option */ TIDY_EXPORT ctmbstr tidyOptGetName( TidyOption opt ); + +/** Get datatype of given Option */ TIDY_EXPORT TidyOptionType tidyOptGetType( TidyOption opt ); + +/** Is Option read-only? */ TIDY_EXPORT Bool tidyOptIsReadOnly( TidyOption opt ); + +/** Get category of given Option */ TIDY_EXPORT TidyConfigCategory tidyOptGetCategory( TidyOption opt ); + +/** Get default value of given Option as a string */ TIDY_EXPORT ctmbstr tidyOptGetDefault( TidyOption opt ); + +/** Get default value of given Option as an unsigned integer */ TIDY_EXPORT uint tidyOptGetDefaultInt( TidyOption opt ); + +/** Get default value of given Option as a Boolean value */ TIDY_EXPORT Bool tidyOptGetDefaultBool( TidyOption opt ); +/** Iterate over Option "pick list" */ TIDY_EXPORT TidyIterator tidyOptGetPickList( TidyOption opt ); +/** Get next string value of Option "pick list" */ TIDY_EXPORT ctmbstr tidyOptGetNextPick( TidyOption opt, TidyIterator* pos ); +/** Get current Option value as a string */ TIDY_EXPORT ctmbstr tidyOptGetValue( TidyDoc tdoc, TidyOptionId optId ); +/** Set Option value as a string */ TIDY_EXPORT Bool tidyOptSetValue( TidyDoc tdoc, TidyOptionId optId, ctmbstr val ); +/** Set named Option value as a string. Good if not sure of type. */ TIDY_EXPORT Bool tidyOptParseValue( TidyDoc tdoc, ctmbstr optnam, ctmbstr val ); +/** Get current Option value as an integer */ TIDY_EXPORT uint tidyOptGetInt( TidyDoc tdoc, TidyOptionId optId ); +/** Set Option value as an integer */ TIDY_EXPORT Bool tidyOptSetInt( TidyDoc tdoc, TidyOptionId optId, uint val ); +/** Get current Option value as a Boolean flag */ TIDY_EXPORT Bool tidyOptGetBool( TidyDoc tdoc, TidyOptionId optId ); +/** Set Option value as a Boolean flag */ TIDY_EXPORT Bool tidyOptSetBool( TidyDoc tdoc, TidyOptionId optId, Bool val ); +/** Reset option to default value by ID */ TIDY_EXPORT Bool tidyOptResetToDefault( TidyDoc tdoc, TidyOptionId opt ); +/** Reset all options to their default values */ TIDY_EXPORT Bool tidyOptResetAllToDefault( TidyDoc tdoc ); -/* reset to config (after document processing) */ +/** Take a snapshot of current config settings */ TIDY_EXPORT Bool tidyOptSnapshot( TidyDoc tdoc ); +/** Reset config settings to snapshot (after document processing) */ TIDY_EXPORT Bool tidyOptResetToSnapshot( TidyDoc tdoc ); +/** Any settings different than default? */ TIDY_EXPORT Bool tidyOptDiffThanDefault( TidyDoc tdoc ); +/** Any settings different than snapshot? */ TIDY_EXPORT Bool tidyOptDiffThanSnapshot( TidyDoc tdoc ); +/** Copy current configuration settings from one document to another */ TIDY_EXPORT Bool tidyOptCopyConfig( TidyDoc tdocTo, TidyDoc tdocFrom ); +/** Get character encoding name. Used with TidyCharEncoding, +** TidyOutCharEncoding, TidyInCharEncoding */ TIDY_EXPORT ctmbstr tidyOptGetEncName( TidyDoc tdoc, TidyOptionId optId ); + +/** Get current pick list value for option by ID. Useful for enum types. */ TIDY_EXPORT ctmbstr tidyOptGetCurrPick( TidyDoc tdoc, TidyOptionId optId); +/** Iterate over user declared tags */ TIDY_EXPORT TidyIterator tidyOptGetDeclTagList( TidyDoc tdoc ); +/** Get next declared tag of specified type: TidyInlineTags, TidyBlockTags, +** TidyEmptyTags, TidyPreTags */ TIDY_EXPORT ctmbstr tidyOptGetNextDeclTag( TidyDoc tdoc, TidyOptionId optId, TidyIterator* iter ); +/** @} end Configuration group */ -/* I/O and Message handling interface +/** @defgroup IO I/O and Messages ** ** By default, Tidy will define, create and use ** instances of input and output handlers for @@ -189,32 +363,42 @@ TIDY_EXPORT ctmbstr tidyOptGetNextDeclTag( TidyDoc tdoc, ** respectively. A FILE* cfgFile input handler ** will be used for config files. Command line ** options will just be set directly. +** +** @{ */ /***************** Input Source *****************/ +/** Input Callback: get next byte of input */ typedef int (*TidyGetByteFunc)( uint sourceData ); + +/** Input Callback: unget a byte of input */ typedef void (*TidyUngetByteFunc)( uint sourceData, byte bt ); + +/** Input Callback: is end of input? */ typedef Bool (*TidyEOFFunc)( uint sourceData ); +/** End of input "character" */ #define EndOfStream (~0u) +/** TidyInputSource - Delivers raw bytes of input +*/ TIDY_STRUCT typedef struct _TidyInputSource { /* Instance data */ - uint sourceData; + uint sourceData; /**< Input context. Passed to callbacks */ /* Methods */ - TidyGetByteFunc getByte; - TidyUngetByteFunc ungetByte; - TidyEOFFunc eof; + TidyGetByteFunc getByte; /**< Pointer to "get byte" callback */ + TidyUngetByteFunc ungetByte; /**< Pointer to "unget" callback */ + TidyEOFFunc eof; /**< Pointer to "eof" callback */ } TidyInputSource; -/* Facilitates user defined source by providing -** an entry point to marshal pointers-to-functions. -** Needed by .NET and possibly other language bindings. +/** Facilitates user defined source by providing +** an entry point to marshal pointers-to-functions. +** Needed by .NET and possibly other language bindings. */ TIDY_EXPORT Bool tidyInitSource( TidyInputSource* source, void* srcData, @@ -222,54 +406,72 @@ TIDY_EXPORT Bool tidyInitSource( TidyInputSource* source, TidyUngetByteFunc ugbFunc, TidyEOFFunc endFunc ); +/** Helper: get next byte from input source */ TIDY_EXPORT uint tidyGetByte( TidyInputSource* source ); + +/** Helper: unget byte back to input source */ TIDY_EXPORT void tidyUngetByte( TidyInputSource* source, uint byteValue ); + +/** Helper: check if input source at end */ TIDY_EXPORT Bool tidyIsEOF( TidyInputSource* source ); /**************** Output Sink ****************/ +/** Output callback: send a byte to output */ typedef void (*TidyPutByteFunc)( uint sinkData, byte bt ); + +/** TidyOutputSink - accepts raw bytes of output +*/ TIDY_STRUCT typedef struct _TidyOutputSink { /* Instance data */ - uint sinkData; + uint sinkData; /**< Output context. Passed to callbacks */ /* Methods */ - TidyPutByteFunc putByte; + TidyPutByteFunc putByte; /**< Pointer to "put byte" callback */ } TidyOutputSink; -/* Facilitates user defined sinks by providing -** an entry point to marshal pointers-to-functions. -** Needed by .NET and possibly other language bindings. +/** Facilitates user defined sinks by providing +** an entry point to marshal pointers-to-functions. +** Needed by .NET and possibly other language bindings. */ TIDY_EXPORT Bool tidyInitSink( TidyOutputSink* sink, void* snkData, TidyPutByteFunc pbFunc ); + +/** Helper: send a byte to output */ TIDY_EXPORT void tidyPutByte( TidyOutputSink* sink, uint byteValue ); -/* Use TidyReportFilter to filter messages by diagnostic level: -** info, warning, etc. Just set diagnostic output -** handler to redirect all diagnostics output. Return true -** to proceed with output, false to cancel. +/** Callback to filter messages by diagnostic level: +** info, warning, etc. Just set diagnostic output +** handler to redirect all diagnostics output. Return true +** to proceed with output, false to cancel. */ -typedef Bool (*TidyReportFilter)( TidyDoc tdoc, - TidyReportLevel lvl, uint line, uint col, ctmbstr mssg ); +typedef Bool (*TidyReportFilter)( TidyDoc tdoc, TidyReportLevel lvl, + uint line, uint col, ctmbstr mssg ); +/** Give Tidy a filter callback to use */ TIDY_EXPORT Bool tidySetReportFilter( TidyDoc tdoc, TidyReportFilter filtCallback ); - +/** Set error sink to named file */ TIDY_EXPORT FILE* tidySetErrorFile( TidyDoc tdoc, ctmbstr errfilnam ); +/** Set error sink to given buffer */ TIDY_EXPORT int tidySetErrorBuffer( TidyDoc tdoc, TidyBuffer* errbuf ); +/** Set error sink to given generic sink */ TIDY_EXPORT int tidySetErrorSink( TidyDoc tdoc, TidyOutputSink* sink ); +/** @} end IO group */ -/* By default, Tidy will use its own wrappers + +/** @defgroup Memory Memory Allocation +** +** By default, Tidy will use its own wrappers ** around standard C malloc/free calls. ** These wrappers will abort upon any failures. ** If any are set, all must be set. @@ -277,61 +479,189 @@ TIDY_EXPORT int tidySetErrorSink( TidyDoc tdoc, TidyOutputSink* sink ); ** ** May be used to set environment-specific allocators ** such as used by web server plugins, etc. +** +** @{ */ + +/** Callback for "malloc" replacement */ typedef void* (*TidyMalloc)( size_t len ); +/** Callback for "realloc" replacement */ typedef void* (*TidyRealloc)( void* buf, size_t len ); +/** Callback for "free" replacement */ typedef void (*TidyFree)( void* buf ); +/** Callback for "out of memory" panic state */ typedef void (*TidyPanic)( ctmbstr mssg ); +/** Give Tidy a malloc() replacement */ TIDY_EXPORT Bool tidySetMallocCall( TidyMalloc fmalloc ); +/** Give Tidy a realloc() replacement */ TIDY_EXPORT Bool tidySetReallocCall( TidyRealloc frealloc ); +/** Give Tidy a free() replacement */ TIDY_EXPORT Bool tidySetFreeCall( TidyFree ffree ); +/** Give Tidy an "out of memory" handler */ TIDY_EXPORT Bool tidySetPanicCall( TidyPanic fpanic ); +/** @} end Memory group */ + /* TODO: Catalog all messages for easy translation TIDY_EXPORT ctmbstr tidyLookupMessage( int errorNo ); */ -/* Parse/load Functions +/** @defgroup Parse Document Parse ** -** HTML/XHTML version determined from input. +** Parse markup from a given input source. String and filename +** functions added for convenience. HTML/XHTML version determined +** from input. +** @{ */ +/** Parse markup in named file */ TIDY_EXPORT int tidyParseFile( TidyDoc tdoc, ctmbstr filename ); + +/** Parse markup from the standard input */ TIDY_EXPORT int tidyParseStdin( TidyDoc tdoc ); + +/** Parse markup in given string */ TIDY_EXPORT int tidyParseString( TidyDoc tdoc, ctmbstr content ); + +/** Parse markup in given buffer */ TIDY_EXPORT int tidyParseBuffer( TidyDoc tdoc, TidyBuffer* buf ); -TIDY_EXPORT int tidyParseSource( TidyDoc tdoc, TidyInputSource* source ); -/* Diagnostics and Repair */ +/** Parse markup in given generic input source */ +TIDY_EXPORT int tidyParseSource( TidyDoc tdoc, TidyInputSource* source); + +/** @} End Parse group */ + + +/** @defgroup Clean Diagnostics and Repair +** +** @{ +*/ +/** Execute configured cleanup and repair operations on parsed markup */ TIDY_EXPORT int tidyCleanAndRepair( TidyDoc tdoc ); + +/** Run configured diagnostics on parsed and repaired markup. +** Must call tidyCleanAndRepair() first. +*/ TIDY_EXPORT int tidyRunDiagnostics( TidyDoc tdoc ); -/* Document save Functions +/** @} end Clean group */ + + +/** @defgroup Save Document Save Functions ** -** If buffer is not big enough, ENOMEM will be returned and -** the necessary buffer size will be placed in *buflen. +** Save currently parsed document to the given output sink. File name +** and string/buffer functions provided for convenience. +** @{ */ + +/** Save to named file */ TIDY_EXPORT int tidySaveFile( TidyDoc tdoc, ctmbstr filename ); + +/** Save to standard output (FILE*) */ TIDY_EXPORT int tidySaveStdout( TidyDoc tdoc ); + +/** Save to given TidyBuffer object */ TIDY_EXPORT int tidySaveBuffer( TidyDoc tdoc, TidyBuffer* buf ); -TIDY_EXPORT int tidySaveString( TidyDoc tdoc, tmbstr buffer, uint* buflen ); + +/** Save document to application buffer. If buffer is not big enough, +** ENOMEM will be returned and the necessary buffer size will be placed +** in *buflen. +*/ +TIDY_EXPORT int tidySaveString( TidyDoc tdoc, + tmbstr buffer, uint* buflen ); + +/** Save to given generic output sink */ TIDY_EXPORT int tidySaveSink( TidyDoc tdoc, TidyOutputSink* sink ); -/* Save Config +/** @} end Save group */ + + +/** @addtogroup Basic +** @{ */ +/** Save current settings to named file. + Only non-default values are written. */ TIDY_EXPORT int tidyOptSaveFile( TidyDoc tdoc, ctmbstr cfgfil ); + +/** Save current settings to given output sink. + Only non-default values are written. */ TIDY_EXPORT int tidyOptSaveSink( TidyDoc tdoc, TidyOutputSink* sink ); + /* Error reporting functions */ + +/** Write more complete information about errors to current error sink. */ TIDY_EXPORT void tidyErrorSummary( TidyDoc tdoc ); + +/** Write more general information about markup to current error sink. */ TIDY_EXPORT void tidyGeneralInfo( TidyDoc tdoc ); +/** @} end Basic group (again) */ + + +/** @defgroup Tree Document Tree +** +** A parsed and, optionally, repaired document is +** represented by Tidy as a Tree, much like a W3C DOM. +** This tree may be traversed using these functions. +** The following snippet gives a basic idea how these +** functions can be used. +** +
+void dumpNode( TidyNode tnod, int indent )
+{
+  TidyNode child;
+
+  for ( child = tidyGetChild(tnod); child; child = tidyGetNext(child) )
+  {
+    ctmbstr name = tidyNodeGetName( child );
+    if ( !name )
+    {
+      switch ( tidyNodeGetType(child) )
+      {
+      case TidyNode_Root:       name = "Root";                    break;
+      case TidyNode_DocType:    name = "DOCTYPE";                 break;
+      case TidyNode_Comment:    name = "Comment";                 break;
+      case TidyNode_ProcIns:    name = "Processing Instruction";  break;
+      case TidyNode_Text:       name = "Text";                    break;
+      case TidyNode_CDATA:      name = "CDATA";                   break;
+      case TidyNode_Section:    name = "XML Section";             break;
+      case TidyNode_Asp:        name = "ASP";                     break;
+      case TidyNode_Jste:       name = "JSTE";                    break;
+      case TidyNode_Php:        name = "PHP";                     break;
+      case TidyNode_XmlDecl:    name = "XML Declaration";         break;
+
+      case TidyNode_Start:
+      case TidyNode_End:
+      case TidyNode_StartEnd:
+      default:
+        assert( name != NULL ); // Shouldn't get here
+        break;
+      }
+    }
+    assert( name != NULL );
+    printf( "\%*.*sNode: \%s\\n", indent, indent, tidy );
+    dumpNode( child, indent + 4 );
+  }
+}
+
+void dumpDoc( TidyDoc tdoc )
+{
+  dumpNode( tidyGetRoot(tdoc), 0 );
+}
+
+void dumpBody( TidyDoc tdoc )
+{
+  dumpNode( tidyGetBody(tdoc), 0 );
+}
+
+ +@{ -/* Document tree traversal functions */ TIDY_EXPORT TidyNode tidyGetRoot( TidyDoc tdoc ); @@ -347,10 +677,6 @@ TIDY_EXPORT TidyNode tidyGetChild( TidyNode tnod ); TIDY_EXPORT TidyNode tidyGetNext( TidyNode tnod ); TIDY_EXPORT TidyNode tidyGetPrev( TidyNode tnod ); -/* Node info */ -TIDY_EXPORT TidyNodeType tidyNodeGetType( TidyNode tnod ); -TIDY_EXPORT ctmbstr tidyNodeGetName( TidyNode tnod ); - /* Null for non-element nodes and all pure HTML TIDY_EXPORT ctmbstr tidyNodeNsLocal( TidyNode tnod ); TIDY_EXPORT ctmbstr tidyNodeNsPrefix( TidyNode tnod ); @@ -370,11 +696,19 @@ TIDY_EXPORT ctmbstr tidyAttrNsPrefix( TidyAttr tattr ); TIDY_EXPORT ctmbstr tidyAttrNsUri( TidyAttr tattr ); */ +/** @} end Tree group */ -/* Node interrogation +/** @defgroup NodeAsk Node Interrogation +** +** Get information about any givent node. +** @{ */ +/* Node info */ +TIDY_EXPORT TidyNodeType tidyNodeGetType( TidyNode tnod ); +TIDY_EXPORT ctmbstr tidyNodeGetName( TidyNode tnod ); + TIDY_EXPORT Bool tidyNodeIsText( TidyNode tnod ); TIDY_EXPORT Bool tidyNodeIsProp( TidyDoc tdoc, TidyNode tnod ); TIDY_EXPORT Bool tidyNodeIsHeader( TidyNode tnod ); /* h1, h2, ... */ @@ -465,8 +799,13 @@ TIDY_EXPORT Bool tidyNodeIsSTRIKE( TidyNode tnod ); TIDY_EXPORT Bool tidyNodeIsU( TidyNode tnod ); TIDY_EXPORT Bool tidyNodeIsMENU( TidyNode tnod ); +/** @} End NodeAsk group */ + -/* Attribute interrogation +/** @defgroup Attribute Attribute Interrogation +** +** Get information about any given attribute. +** @{ */ TIDY_EXPORT TidyAttrId tidyAttrGetId( TidyAttr tattr ); @@ -519,9 +858,16 @@ TIDY_EXPORT Bool tidyAttrIsABBR( TidyAttr tattr ); TIDY_EXPORT Bool tidyAttrIsCOLSPAN( TidyAttr tattr ); TIDY_EXPORT Bool tidyAttrIsROWSPAN( TidyAttr tattr ); -/* Attribute retrieval +/** @} end AttrAsk group */ + + +/** @defgroup AttrGet Attribute Retrieval +** +** Lookup an attribute from a given node +** @{ */ + TIDY_EXPORT TidyAttr tidyAttrGetHREF( TidyNode tnod ); TIDY_EXPORT TidyAttr tidyAttrGetSRC( TidyNode tnod ); TIDY_EXPORT TidyAttr tidyAttrGetID( TidyNode tnod ); @@ -568,6 +914,9 @@ TIDY_EXPORT TidyAttr tidyAttrGetABBR( TidyNode tnod ); TIDY_EXPORT TidyAttr tidyAttrGetCOLSPAN( TidyNode tnod ); TIDY_EXPORT TidyAttr tidyAttrGetROWSPAN( TidyNode tnod ); + +/** @} end AttrGet group */ + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/tidylib-src/include/tidyenum.h b/tidylib-src/include/tidyenum.h old mode 100755 new mode 100644 index 8a81e524..fc2f6a1c --- a/tidylib-src/include/tidyenum.h +++ b/tidylib-src/include/tidyenum.h @@ -14,8 +14,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/10/15 19:46:52 $ - $Revision: 1.1.2.1 $ + $Date: 2003/02/16 19:33:09 $ + $Revision: 1.2 $ Contributing Author(s): @@ -59,7 +59,9 @@ Created 2001-05-20 by Charles Reitzel Updated 2002-07-01 by Charles Reitzel - 1st Implementation +*/ +/** @file tidyenum.h - Enumerations defined for use with TidyLib. */ #ifdef __cplusplus @@ -69,150 +71,164 @@ extern "C" { /* Enumerate configuration options */ +/** Categories of Tidy configuration options +*/ typedef enum { - TidyMarkup, - TidyDiagnostics, - TidyPrettyPrint, - TidyEncoding, - TidyMiscellaneous + TidyMarkup, /**< Markup options: (X)HTML version, etc */ + TidyDiagnostics, /**< Diagnostics */ + TidyPrettyPrint, /**< Output layout */ + TidyEncoding, /**< Character encodings */ + TidyMiscellaneous /**< File handling, message format, etc. */ } TidyConfigCategory; -/* Option IDs -** -** Used to get/set option values. +/** Option IDs Used to get/set option values. */ - typedef enum { - TidyUnknownOption, /* Unknown! */ - TidyIndentSpaces, /* indentation n spaces */ - TidyWrapLen, /* wrap margin */ - TidyTabSize, /* expand tabs to n spaces */ - - TidyCharEncoding, /* in/out character encoding */ - TidyInCharEncoding, /* input character encoding (if different) */ - TidyOutCharEncoding, /* output character encoding (if different) */ - - TidyDoctypeMode, /* see doctype property */ - TidyDoctype, /* user specified doctype */ - - TidyDuplicateAttrs, /* Keep first or last duplicate attribute */ - TidyAltText, /* default text for alt attribute */ - TidySlideStyle, /* style sheet for slides: not used for anything yet */ - TidyErrFile, /* file name to write errors to */ - TidyWriteBack, /* if true then output tidied markup */ - TidyShowMarkup, /* if false, normal output is suppressed */ - TidyShowWarnings, /* however errors are always shown */ - TidyQuiet, /* no 'Parsing X', guessed DTD or summary */ - TidyIndentContent, /* indent content of appropriate tags */ - /* "auto" does text/block level content indentation */ - TidyHideEndTags, /* suppress optional end tags */ - TidyXmlTags, /* treat input as XML */ - TidyXmlOut, /* create output as XML */ - TidyXhtmlOut, /* output extensible HTML */ - TidyHtmlOut, /* output plain HTML, even for XHTML input. - Yes means set explicitly. */ - TidyXmlDecl, /* add for XML docs */ - TidyUpperCaseTags, /* output tags in upper not lower case */ - TidyUpperCaseAttrs, /* output attributes in upper not lower case */ - TidyMakeBare, /* Make bare HTML: remove Microsoft cruft */ - TidyMakeClean, /* replace presentational clutter by style rules */ - TidyLogicalEmphasis, /* replace i by em and b by strong */ - TidyDropPropAttrs, /* discard proprietary attributes */ - TidyDropFontTags, /* discard presentation tags */ - TidyDropEmptyParas, /* discard empty p elements */ - TidyFixComments, /* fix comments with adjacent hyphens */ - TidyBreakBeforeBR, /* o/p newline before
or not? */ - TidyBurstSlides, /* create slides on each h2 element */ - TidyNumEntities, /* use numeric entities */ - TidyQuoteMarks, /* output " marks as " */ - TidyQuoteNbsp, /* output non-breaking space as entity */ - TidyQuoteAmpersand, /* output naked ampersand as & */ - TidyWrapAttVals, /* wrap within attribute values */ - TidyWrapScriptlets, /* wrap within JavaScript string literals */ - TidyWrapSection, /* wrap within section tags */ - TidyWrapAsp, /* wrap within ASP pseudo elements */ - TidyWrapJste, /* wrap within JSTE pseudo elements */ - TidyWrapPhp, /* wrap within PHP pseudo elements */ - TidyFixBackslash, /* fix URLs by replacing \ with / */ - TidyIndentAttributes,/* newline+indent before each attribute */ - TidyXmlPIs, /* if set to yes PIs must end with ?> */ - TidyXmlSpace, /* if set to yes adds xml:space attr as needed */ - TidyEncloseBodyText, /* if yes text at body is wrapped in

's */ - TidyEncloseBlockText,/* if yes text in blocks is wrapped in

's */ - TidyKeepFileTimes, /* if yes last modied time is preserved */ - TidyWord2000, /* draconian cleaning for Word2000 */ - TidyMark, /* add meta element indicating tidied doc */ - TidyEmacs, /* if true format error output for GNU Emacs */ - TidyEmacsFile, /* Name of current Emacs file */ - TidyLiteralAttribs, /* if true attributes may use newlines */ - TidyBodyOnly, /* output BODY content only */ - TidyFixUri, /* applies URI encoding if necessary */ - TidyLowerLiterals, /* folds known attribute values to lower case */ - TidyHideComments, /* hides all (real) comments in output */ - TidyIndentCdata, /* indent section */ - TidyForceOutput, /* output document even if errors were found */ - TidyShowErrors, /* number of errors to put out */ - TidyAsciiChars, /* convert quotes and dashes to nearest ASCII char */ - TidyJoinClasses, /* join multiple class attributes */ - TidyJoinStyles, /* join multiple style attributes */ - TidyEscapeCdata, /* replace sections with escaped text */ + TidyUnknownOption, /**< Unknown option! */ + TidyIndentSpaces, /**< Indentation n spaces */ + TidyWrapLen, /**< Wrap margin */ + TidyTabSize, /**< Expand tabs to n spaces */ + + TidyCharEncoding, /**< In/out character encoding */ + TidyInCharEncoding, /**< Input character encoding (if different) */ + TidyOutCharEncoding, /**< Output character encoding (if different) */ + TidyNewline, /**< Output line ending (default to platform) */ + + TidyDoctypeMode, /**< See doctype property */ + TidyDoctype, /**< User specified doctype */ + + TidyDuplicateAttrs, /**< Keep first or last duplicate attribute */ + TidyAltText, /**< Default text for alt attribute */ + TidySlideStyle, /**< Style sheet for slides: not used for anything yet */ + TidyErrFile, /**< File name to write errors to */ + TidyOutFile, /**< File name to write markup to */ + TidyWriteBack, /**< If true then output tidied markup */ + TidyShowMarkup, /**< If false, normal output is suppressed */ + TidyShowWarnings, /**< However errors are always shown */ + TidyQuiet, /**< No 'Parsing X', guessed DTD or summary */ + TidyIndentContent, /**< Indent content of appropriate tags */ + /**< "auto" does text/block level content indentation */ + TidyHideEndTags, /**< Suppress optional end tags */ + TidyXmlTags, /**< Treat input as XML */ + TidyXmlOut, /**< Create output as XML */ + TidyXhtmlOut, /**< Output extensible HTML */ + TidyHtmlOut, /**< Output plain HTML, even for XHTML input. + Yes means set explicitly. */ + TidyXmlDecl, /**< Add for XML docs */ + TidyUpperCaseTags, /**< Output tags in upper not lower case */ + TidyUpperCaseAttrs, /**< Output attributes in upper not lower case */ + TidyMakeBare, /**< Make bare HTML: remove Microsoft cruft */ + TidyMakeClean, /**< Replace presentational clutter by style rules */ + TidyLogicalEmphasis, /**< Replace i by em and b by strong */ + TidyDropPropAttrs, /**< Discard proprietary attributes */ + TidyDropFontTags, /**< Discard presentation tags */ + TidyDropEmptyParas, /**< Discard empty p elements */ + TidyFixComments, /**< Fix comments with adjacent hyphens */ + TidyBreakBeforeBR, /**< Output newline before
or not? */ + TidyBurstSlides, /**< Create slides on each h2 element */ + TidyNumEntities, /**< Use numeric entities */ + TidyQuoteMarks, /**< Output " marks as " */ + TidyQuoteNbsp, /**< Output non-breaking space as entity */ + TidyQuoteAmpersand, /**< Output naked ampersand as & */ + TidyWrapAttVals, /**< Wrap within attribute values */ + TidyWrapScriptlets, /**< Wrap within JavaScript string literals */ + TidyWrapSection, /**< Wrap within section tags */ + TidyWrapAsp, /**< Wrap within ASP pseudo elements */ + TidyWrapJste, /**< Wrap within JSTE pseudo elements */ + TidyWrapPhp, /**< Wrap within PHP pseudo elements */ + TidyFixBackslash, /**< Fix URLs by replacing \ with / */ + TidyIndentAttributes,/**< Newline+indent before each attribute */ + TidyXmlPIs, /**< If set to yes PIs must end with ?> */ + TidyXmlSpace, /**< If set to yes adds xml:space attr as needed */ + TidyEncloseBodyText, /**< If yes text at body is wrapped in P's */ + TidyEncloseBlockText,/**< If yes text in blocks is wrapped in P's */ + TidyKeepFileTimes, /**< If yes last modied time is preserved */ + TidyWord2000, /**< Draconian cleaning for Word2000 */ + TidyMark, /**< Add meta element indicating tidied doc */ + TidyEmacs, /**< If true format error output for GNU Emacs */ + TidyEmacsFile, /**< Name of current Emacs file */ + TidyLiteralAttribs, /**< If true attributes may use newlines */ + TidyBodyOnly, /**< Output BODY content only */ + TidyFixUri, /**< Applies URI encoding if necessary */ + TidyLowerLiterals, /**< Folds known attribute values to lower case */ + TidyHideComments, /**< Hides all (real) comments in output */ + TidyIndentCdata, /**< Indent section */ + TidyForceOutput, /**< Output document even if errors were found */ + TidyShowErrors, /**< Number of errors to put out */ + TidyAsciiChars, /**< Convert quotes and dashes to nearest ASCII char */ + TidyJoinClasses, /**< Join multiple class attributes */ + TidyJoinStyles, /**< Join multiple style attributes */ + TidyEscapeCdata, /**< Replace sections with escaped text */ #if SUPPORT_ASIAN_ENCODINGS - TidyLanguage, /* language property: not used for anything yet */ - TidyNCR, /* allow numeric character references */ + TidyLanguage, /**< Language property: not used for anything yet */ + TidyNCR, /**< Allow numeric character references */ #endif #if SUPPORT_UTF16_ENCODINGS - TidyOutputBOM, /* output a Byte Order Mark (BOM) for UTF-16 encodings */ - /* auto: if input stream has BOM, we output a BOM */ + TidyOutputBOM, /**< Output a Byte Order Mark (BOM) for UTF-16 encodings */ + /**< auto: if input stream has BOM, we output a BOM */ #endif - TidyReplaceColor, /* replace hex color attribute values with names */ - TidyCSSPrefix, /* CSS class naming for -clean option */ + TidyReplaceColor, /**< Replace hex color attribute values with names */ + TidyCSSPrefix, /**< CSS class naming for -clean option */ - TidyInlineTags, /* Declared inline tags */ - TidyBlockTags, /* Declared block tags */ - TidyEmptyTags, /* Declared empty tags */ - TidyPreTags, /* Declared pre tags */ + TidyInlineTags, /**< Declared inline tags */ + TidyBlockTags, /**< Declared block tags */ + TidyEmptyTags, /**< Declared empty tags */ + TidyPreTags, /**< Declared pre tags */ - TidyAccessibilityCheckLevel, /* Accessibility check level - 0 (old style), or 1, 2, 3 */ + TidyAccessibilityCheckLevel, /**< Accessibility check level + 0 (old style), or 1, 2, 3 */ - N_TIDY_OPTIONS /* Must be last */ + N_TIDY_OPTIONS /**< Must be last */ } TidyOptionId; - +/** Option data types +*/ typedef enum { - TidyString, - TidyInteger, - TidyBoolean + TidyString, /**< String */ + TidyInteger, /**< Integer or enumeration */ + TidyBoolean /**< Boolean flag */ } TidyOptionType; -/* used by ParseBool, ParseTriState, ParseIndent, ParseBOM */ +/** AutoBool values used by ParseBool, ParseTriState, ParseIndent, ParseBOM +*/ typedef enum { - TidyNoState, /* maps to 'no' */ - TidyYesState, /* maps to 'yes' */ - TidyAutoState + TidyNoState, /**< maps to 'no' */ + TidyYesState, /**< maps to 'yes' */ + TidyAutoState /**< Automatic */ } TidyTriState; +/** TidyNewline option values to control output line endings. +*/ +typedef enum +{ + TidyLF, /**< Use Unix style: LF */ + TidyCRLF, /**< Use DOS/Windows style: CR+LF */ + TidyCR /**< Use Macintosh style: CR */ +} TidyLineEnding; + -/* mode controlling treatment of doctype */ +/** Mode controlling treatment of doctype +*/ typedef enum { - TidyDoctypeOmit, - TidyDoctypeAuto, - TidyDoctypeStrict, - TidyDoctypeLoose, - TidyDoctypeUser + TidyDoctypeOmit, /**< Omit DOCTYPE altogether */ + TidyDoctypeAuto, /**< Keep DOCTYPE in input. Set version to content */ + TidyDoctypeStrict, /**< Convert document to HTML 4 strict content model */ + TidyDoctypeLoose, /**< Convert document to HTML 4 transitional + content model */ + TidyDoctypeUser /**< Set DOCTYPE FPI explicitly */ } TidyDoctypeModes; -/* mode controlling treatment of duplicate Attributes */ - +/** Mode controlling treatment of duplicate Attributes +*/ typedef enum { TidyKeepFirst, @@ -232,339 +248,333 @@ typedef enum ** options will just be set directly. */ +/** Message severity level +*/ typedef enum { - TidyInfo, - TidyWarning, - TidyConfig, - TidyAccess, - TidyError, - TidyBadDocument, - TidyFatal + TidyInfo, /**< Information about markup usage */ + TidyWarning, /**< Warning message */ + TidyConfig, /**< Configuration error */ + TidyAccess, /**< Accessibility message */ + TidyError, /**< Error message - output suppressed */ + TidyBadDocument, /**< I/O or file system error */ + TidyFatal /**< Crash! */ } TidyReportLevel; -typedef enum -{ - TidyContentInput, - TidyConfigInput -} TidyInputType; - -typedef enum -{ - TidyContentOutput, - TidyDiagnosticOutput -} TidyOutputType; - /* Document tree traversal functions */ +/** Node types +*/ typedef enum { - TidyNode_Root, - TidyNode_DocType, - TidyNode_Comment, - TidyNode_ProcIns, - TidyNode_Text, - TidyNode_Start, - TidyNode_End, - TidyNode_StartEnd, - TidyNode_CDATA, - TidyNode_Section, - TidyNode_Asp, - TidyNode_Jste, - TidyNode_Php, - TidyNode_XmlDecl + TidyNode_Root, /**< Root */ + TidyNode_DocType, /**< DOCTYPE */ + TidyNode_Comment, /**< Comment */ + TidyNode_ProcIns, /**< Processing Instruction */ + TidyNode_Text, /**< Text */ + TidyNode_Start, /**< Start Tag */ + TidyNode_End, /**< End Tag */ + TidyNode_StartEnd, /**< Start/End (empty) Tag */ + TidyNode_CDATA, /**< Unparsed Text */ + TidyNode_Section, /**< XML Section */ + TidyNode_Asp, /**< ASP Source */ + TidyNode_Jste, /**< JSTE Source */ + TidyNode_Php, /**< PHP Source */ + TidyNode_XmlDecl /**< XML Declaration */ } TidyNodeType; -/* Node interrogation -*/ +/** Known HTML element types +*/ typedef enum { - TidyTag_UNKNOWN, - TidyTag_A, - TidyTag_ABBR, - TidyTag_ACRONYM, - TidyTag_ADDRESS, - TidyTag_ALIGN, - TidyTag_APPLET, - TidyTag_AREA, - TidyTag_B, - TidyTag_BASE, - TidyTag_BASEFONT, - TidyTag_BDO, - TidyTag_BGSOUND, - TidyTag_BIG, - TidyTag_BLINK, - TidyTag_BLOCKQUOTE, - TidyTag_BODY, - TidyTag_BR, - TidyTag_BUTTON, - TidyTag_CAPTION, - TidyTag_CENTER, - TidyTag_CITE, - TidyTag_CODE, - TidyTag_COL, - TidyTag_COLGROUP, - TidyTag_COMMENT, - TidyTag_DD, - TidyTag_DEL, - TidyTag_DFN, - TidyTag_DIR, - TidyTag_DIV, - TidyTag_DL, - TidyTag_DT, - TidyTag_EM, - TidyTag_EMBED, - TidyTag_FIELDSET, - TidyTag_FONT, - TidyTag_FORM, - TidyTag_FRAME, - TidyTag_FRAMESET, - TidyTag_H1, - TidyTag_H2, - TidyTag_H3, - TidyTag_H4, - TidyTag_H5, - TidyTag_H6, - TidyTag_HEAD, - TidyTag_HR, - TidyTag_HTML, - TidyTag_I, - TidyTag_IFRAME, - TidyTag_ILAYER, - TidyTag_IMG, - TidyTag_INPUT, - TidyTag_INS, - TidyTag_ISINDEX, - TidyTag_KBD, - TidyTag_KEYGEN, - TidyTag_LABEL, - TidyTag_LAYER, - TidyTag_LEGEND, - TidyTag_LI, - TidyTag_LINK, - TidyTag_LISTING, - TidyTag_MAP, - TidyTag_MARQUEE, - TidyTag_MENU, - TidyTag_META, - TidyTag_MULTICOL, - TidyTag_NOBR, - TidyTag_NOEMBED, - TidyTag_NOFRAMES, - TidyTag_NOLAYER, - TidyTag_NOSAVE, - TidyTag_NOSCRIPT, - TidyTag_OBJECT, - TidyTag_OL, - TidyTag_OPTGROUP, - TidyTag_OPTION, - TidyTag_P, - TidyTag_PARAM, - TidyTag_PLAINTEXT, - TidyTag_PRE, - TidyTag_Q, - TidyTag_RB, - TidyTag_RBC, - TidyTag_RP, - TidyTag_RT, - TidyTag_RTC, - TidyTag_RUBY, - TidyTag_S, - TidyTag_SAMP, - TidyTag_SCRIPT, - TidyTag_SELECT, - TidyTag_SERVER, - TidyTag_SERVLET, - TidyTag_SMALL, - TidyTag_SPACER, - TidyTag_SPAN, - TidyTag_STRIKE, - TidyTag_STRONG, - TidyTag_STYLE, - TidyTag_SUB, - TidyTag_SUP, - TidyTag_TABLE, - TidyTag_TBODY, - TidyTag_TD, - TidyTag_TEXTAREA, - TidyTag_TFOOT, - TidyTag_TH, - TidyTag_THEAD, - TidyTag_TITLE, - TidyTag_TR, - TidyTag_TT, - TidyTag_U, - TidyTag_UL, - TidyTag_VAR, - TidyTag_WBR, - TidyTag_XMP, - N_TIDY_TAGS /* Must be last */ + TidyTag_UNKNOWN, /**< Unknown tag! */ + TidyTag_A, /**< A */ + TidyTag_ABBR, /**< ABBR */ + TidyTag_ACRONYM, /**< ACRONYM */ + TidyTag_ADDRESS, /**< ADDRESS */ + TidyTag_ALIGN, /**< ALIGN */ + TidyTag_APPLET, /**< APPLET */ + TidyTag_AREA, /**< AREA */ + TidyTag_B, /**< B */ + TidyTag_BASE, /**< BASE */ + TidyTag_BASEFONT, /**< BASEFONT */ + TidyTag_BDO, /**< BDO */ + TidyTag_BGSOUND, /**< BGSOUND */ + TidyTag_BIG, /**< BIG */ + TidyTag_BLINK, /**< BLINK */ + TidyTag_BLOCKQUOTE, /**< BLOCKQUOTE */ + TidyTag_BODY, /**< BODY */ + TidyTag_BR, /**< BR */ + TidyTag_BUTTON, /**< BUTTON */ + TidyTag_CAPTION, /**< CAPTION */ + TidyTag_CENTER, /**< CENTER */ + TidyTag_CITE, /**< CITE */ + TidyTag_CODE, /**< CODE */ + TidyTag_COL, /**< COL */ + TidyTag_COLGROUP, /**< COLGROUP */ + TidyTag_COMMENT, /**< COMMENT */ + TidyTag_DD, /**< DD */ + TidyTag_DEL, /**< DEL */ + TidyTag_DFN, /**< DFN */ + TidyTag_DIR, /**< DIR */ + TidyTag_DIV, /**< DIF */ + TidyTag_DL, /**< DL */ + TidyTag_DT, /**< DT */ + TidyTag_EM, /**< EM */ + TidyTag_EMBED, /**< EMBED */ + TidyTag_FIELDSET, /**< FIELDSET */ + TidyTag_FONT, /**< FONT */ + TidyTag_FORM, /**< FORM */ + TidyTag_FRAME, /**< FRAME */ + TidyTag_FRAMESET, /**< FRAMESET */ + TidyTag_H1, /**< H1 */ + TidyTag_H2, /**< H2 */ + TidyTag_H3, /**< H3 */ + TidyTag_H4, /**< H4 */ + TidyTag_H5, /**< H5 */ + TidyTag_H6, /**< H6 */ + TidyTag_HEAD, /**< HEAD */ + TidyTag_HR, /**< HR */ + TidyTag_HTML, /**< HTML */ + TidyTag_I, /**< I */ + TidyTag_IFRAME, /**< IFRAME */ + TidyTag_ILAYER, /**< ILAYER */ + TidyTag_IMG, /**< IMG */ + TidyTag_INPUT, /**< INPUT */ + TidyTag_INS, /**< INS */ + TidyTag_ISINDEX, /**< ISINDEX */ + TidyTag_KBD, /**< KBD */ + TidyTag_KEYGEN, /**< KEYGEN */ + TidyTag_LABEL, /**< LABEL */ + TidyTag_LAYER, /**< LAYER */ + TidyTag_LEGEND, /**< LEGEND */ + TidyTag_LI, /**< LI */ + TidyTag_LINK, /**< LINK */ + TidyTag_LISTING, /**< LISTING */ + TidyTag_MAP, /**< MAP */ + TidyTag_MARQUEE, /**< MARQUEE */ + TidyTag_MENU, /**< MENU */ + TidyTag_META, /**< META */ + TidyTag_MULTICOL, /**< MULTICOL */ + TidyTag_NOBR, /**< NOBR */ + TidyTag_NOEMBED, /**< NOEMBED */ + TidyTag_NOFRAMES, /**< NOFRAMES */ + TidyTag_NOLAYER, /**< NOLAYER */ + TidyTag_NOSAVE, /**< NOSAVE */ + TidyTag_NOSCRIPT, /**< NOSCRIPT */ + TidyTag_OBJECT, /**< OBJECT */ + TidyTag_OL, /**< OL */ + TidyTag_OPTGROUP, /**< OPTGROUP */ + TidyTag_OPTION, /**< OPTION */ + TidyTag_P, /**< P */ + TidyTag_PARAM, /**< PARAM */ + TidyTag_PLAINTEXT, /**< PLAINTEXT */ + TidyTag_PRE, /**< PRE */ + TidyTag_Q, /**< Q */ + TidyTag_RB, /**< RB */ + TidyTag_RBC, /**< RBC */ + TidyTag_RP, /**< RP */ + TidyTag_RT, /**< RT */ + TidyTag_RTC, /**< RTC */ + TidyTag_RUBY, /**< RUBY */ + TidyTag_S, /**< S */ + TidyTag_SAMP, /**< SAMP */ + TidyTag_SCRIPT, /**< SCRIPT */ + TidyTag_SELECT, /**< SELECT */ + TidyTag_SERVER, /**< SERVER */ + TidyTag_SERVLET, /**< SERVLET */ + TidyTag_SMALL, /**< SMALL */ + TidyTag_SPACER, /**< SPACER */ + TidyTag_SPAN, /**< SPAN */ + TidyTag_STRIKE, /**< STRIKE */ + TidyTag_STRONG, /**< STRONG */ + TidyTag_STYLE, /**< STYLE */ + TidyTag_SUB, /**< SUB */ + TidyTag_SUP, /**< SUP */ + TidyTag_TABLE, /**< TABLE */ + TidyTag_TBODY, /**< TBODY */ + TidyTag_TD, /**< TD */ + TidyTag_TEXTAREA, /**< TEXTAREA */ + TidyTag_TFOOT, /**< TFOOT */ + TidyTag_TH, /**< TH */ + TidyTag_THEAD, /**< THEAD */ + TidyTag_TITLE, /**< TITLE */ + TidyTag_TR, /**< TR */ + TidyTag_TT, /**< TT */ + TidyTag_U, /**< U */ + TidyTag_UL, /**< UL */ + TidyTag_VAR, /**< VAR */ + TidyTag_WBR, /**< WBR */ + TidyTag_XMP, /**< XMP */ + N_TIDY_TAGS /**< Must be last */ } TidyTagId; /* Attribute interrogation */ +/** Known HTML attributes +*/ typedef enum { - TidyAttr_UNKNOWN, - TidyAttr_ABBR, - TidyAttr_ACCEPT, - TidyAttr_ACCEPT_CHARSET, - TidyAttr_ACCESSKEY, - TidyAttr_ACTION, - TidyAttr_ADD_DATE, - TidyAttr_ALIGN, - TidyAttr_ALINK, - TidyAttr_ALT, - TidyAttr_ARCHIVE, - TidyAttr_AXIS, - TidyAttr_BACKGROUND, - TidyAttr_BGCOLOR, - TidyAttr_BGPROPERTIES, - TidyAttr_BORDER, - TidyAttr_BORDERCOLOR, - TidyAttr_BOTTOMMARGIN, - TidyAttr_CELLPADDING, - TidyAttr_CELLSPACING, - TidyAttr_CHAR, - TidyAttr_CHAROFF, - TidyAttr_CHARSET, - TidyAttr_CHECKED, - TidyAttr_CITE, - TidyAttr_CLASS, - TidyAttr_CLASSID, - TidyAttr_CLEAR, - TidyAttr_CODE, - TidyAttr_CODEBASE, - TidyAttr_CODETYPE, - TidyAttr_COLOR, - TidyAttr_COLS, - TidyAttr_COLSPAN, - TidyAttr_COMPACT, - TidyAttr_CONTENT, - TidyAttr_COORDS, - TidyAttr_DATA, - TidyAttr_DATAFLD, - TidyAttr_DATAFORMATAS, - TidyAttr_DATAPAGESIZE, - TidyAttr_DATASRC, - TidyAttr_DATETIME, - TidyAttr_DECLARE, - TidyAttr_DEFER, - TidyAttr_DIR, - TidyAttr_DISABLED, - TidyAttr_ENCODING, - TidyAttr_ENCTYPE, - TidyAttr_FACE, - TidyAttr_FOR, - TidyAttr_FRAME, - TidyAttr_FRAMEBORDER, - TidyAttr_FRAMESPACING, - TidyAttr_GRIDX, - TidyAttr_GRIDY, - TidyAttr_HEADERS, - TidyAttr_HEIGHT, - TidyAttr_HREF, - TidyAttr_HREFLANG, - TidyAttr_HSPACE, - TidyAttr_HTTP_EQUIV, - TidyAttr_ID, - TidyAttr_ISMAP, - TidyAttr_LABEL, - TidyAttr_LANG, - TidyAttr_LANGUAGE, - TidyAttr_LAST_MODIFIED, - TidyAttr_LAST_VISIT, - TidyAttr_LEFTMARGIN, - TidyAttr_LINK, - TidyAttr_LONGDESC, - TidyAttr_LOWSRC, - TidyAttr_MARGINHEIGHT, - TidyAttr_MARGINWIDTH, - TidyAttr_MAXLENGTH, - TidyAttr_MEDIA, - TidyAttr_METHOD, - TidyAttr_MULTIPLE, - TidyAttr_NAME, - TidyAttr_NOHREF, - TidyAttr_NORESIZE, - TidyAttr_NOSHADE, - TidyAttr_NOWRAP, - TidyAttr_OBJECT, - TidyAttr_OnAFTERUPDATE, - TidyAttr_OnBEFOREUNLOAD, - TidyAttr_OnBEFOREUPDATE, - TidyAttr_OnBLUR, - TidyAttr_OnCHANGE, - TidyAttr_OnCLICK, - TidyAttr_OnDATAAVAILABLE, - TidyAttr_OnDATASETCHANGED, - TidyAttr_OnDATASETCOMPLETE, - TidyAttr_OnDBLCLICK, - TidyAttr_OnERRORUPDATE, - TidyAttr_OnFOCUS, - TidyAttr_OnKEYDOWN, - TidyAttr_OnKEYPRESS, - TidyAttr_OnKEYUP, - TidyAttr_OnLOAD, - TidyAttr_OnMOUSEDOWN, - TidyAttr_OnMOUSEMOVE, - TidyAttr_OnMOUSEOUT, - TidyAttr_OnMOUSEOVER, - TidyAttr_OnMOUSEUP, - TidyAttr_OnRESET, - TidyAttr_OnROWENTER, - TidyAttr_OnROWEXIT, - TidyAttr_OnSELECT, - TidyAttr_OnSUBMIT, - TidyAttr_OnUNLOAD, - TidyAttr_PROFILE, - TidyAttr_PROMPT, - TidyAttr_RBSPAN, - TidyAttr_READONLY, - TidyAttr_REL, - TidyAttr_REV, - TidyAttr_RIGHTMARGIN, - TidyAttr_ROWS, - TidyAttr_ROWSPAN, - TidyAttr_RULES, - TidyAttr_SCHEME, - TidyAttr_SCOPE, - TidyAttr_SCROLLING, - TidyAttr_SELECTED, - TidyAttr_SHAPE, - TidyAttr_SHOWGRID, - TidyAttr_SHOWGRIDX, - TidyAttr_SHOWGRIDY, - TidyAttr_SIZE, - TidyAttr_SPAN, - TidyAttr_SRC, - TidyAttr_STANDBY, - TidyAttr_START, - TidyAttr_STYLE, - TidyAttr_SUMMARY, - TidyAttr_TABINDEX, - TidyAttr_TARGET, - TidyAttr_TEXT, - TidyAttr_TITLE, - TidyAttr_TOPMARGIN, - TidyAttr_TYPE, - TidyAttr_USEMAP, - TidyAttr_VALIGN, - TidyAttr_VALUE, - TidyAttr_VALUETYPE, - TidyAttr_VERSION, - TidyAttr_VLINK, - TidyAttr_VSPACE, - TidyAttr_WIDTH, - TidyAttr_WRAP, - TidyAttr_XML_LANG, - TidyAttr_XML_SPACE, - TidyAttr_XMLNS, - N_TIDY_ATTRIBS /* Must be last */ + TidyAttr_UNKNOWN, /**< UNKNOWN= */ + TidyAttr_ABBR, /**< ABBR= */ + TidyAttr_ACCEPT, /**< ACCEPT= */ + TidyAttr_ACCEPT_CHARSET, /**< ACCEPT_CHARSET= */ + TidyAttr_ACCESSKEY, /**< ACCESSKEY= */ + TidyAttr_ACTION, /**< ACTION= */ + TidyAttr_ADD_DATE, /**< ADD_DATE= */ + TidyAttr_ALIGN, /**< ALIGN= */ + TidyAttr_ALINK, /**< ALINK= */ + TidyAttr_ALT, /**< ALT= */ + TidyAttr_ARCHIVE, /**< ARCHIVE= */ + TidyAttr_AXIS, /**< AXIS= */ + TidyAttr_BACKGROUND, /**< BACKGROUND= */ + TidyAttr_BGCOLOR, /**< BGCOLOR= */ + TidyAttr_BGPROPERTIES, /**< BGPROPERTIES= */ + TidyAttr_BORDER, /**< BORDER= */ + TidyAttr_BORDERCOLOR, /**< BORDERCOLOR= */ + TidyAttr_BOTTOMMARGIN, /**< BOTTOMMARGIN= */ + TidyAttr_CELLPADDING, /**< CELLPADDING= */ + TidyAttr_CELLSPACING, /**< CELLSPACING= */ + TidyAttr_CHAR, /**< CHAR= */ + TidyAttr_CHAROFF, /**< CHAROFF= */ + TidyAttr_CHARSET, /**< CHARSET= */ + TidyAttr_CHECKED, /**< CHECKED= */ + TidyAttr_CITE, /**< CITE= */ + TidyAttr_CLASS, /**< CLASS= */ + TidyAttr_CLASSID, /**< CLASSID= */ + TidyAttr_CLEAR, /**< CLEAR= */ + TidyAttr_CODE, /**< CODE= */ + TidyAttr_CODEBASE, /**< CODEBASE= */ + TidyAttr_CODETYPE, /**< CODETYPE= */ + TidyAttr_COLOR, /**< COLOR= */ + TidyAttr_COLS, /**< COLS= */ + TidyAttr_COLSPAN, /**< COLSPAN= */ + TidyAttr_COMPACT, /**< COMPACT= */ + TidyAttr_CONTENT, /**< CONTENT= */ + TidyAttr_COORDS, /**< COORDS= */ + TidyAttr_DATA, /**< DATA= */ + TidyAttr_DATAFLD, /**< DATAFLD= */ + TidyAttr_DATAFORMATAS, /**< DATAFORMATAS= */ + TidyAttr_DATAPAGESIZE, /**< DATAPAGESIZE= */ + TidyAttr_DATASRC, /**< DATASRC= */ + TidyAttr_DATETIME, /**< DATETIME= */ + TidyAttr_DECLARE, /**< DECLARE= */ + TidyAttr_DEFER, /**< DEFER= */ + TidyAttr_DIR, /**< DIR= */ + TidyAttr_DISABLED, /**< DISABLED= */ + TidyAttr_ENCODING, /**< ENCODING= */ + TidyAttr_ENCTYPE, /**< ENCTYPE= */ + TidyAttr_FACE, /**< FACE= */ + TidyAttr_FOR, /**< FOR= */ + TidyAttr_FRAME, /**< FRAME= */ + TidyAttr_FRAMEBORDER, /**< FRAMEBORDER= */ + TidyAttr_FRAMESPACING, /**< FRAMESPACING= */ + TidyAttr_GRIDX, /**< GRIDX= */ + TidyAttr_GRIDY, /**< GRIDY= */ + TidyAttr_HEADERS, /**< HEADERS= */ + TidyAttr_HEIGHT, /**< HEIGHT= */ + TidyAttr_HREF, /**< HREF= */ + TidyAttr_HREFLANG, /**< HREFLANG= */ + TidyAttr_HSPACE, /**< HSPACE= */ + TidyAttr_HTTP_EQUIV, /**< HTTP_EQUIV= */ + TidyAttr_ID, /**< ID= */ + TidyAttr_ISMAP, /**< ISMAP= */ + TidyAttr_LABEL, /**< LABEL= */ + TidyAttr_LANG, /**< LANG= */ + TidyAttr_LANGUAGE, /**< LANGUAGE= */ + TidyAttr_LAST_MODIFIED, /**< LAST_MODIFIED= */ + TidyAttr_LAST_VISIT, /**< LAST_VISIT= */ + TidyAttr_LEFTMARGIN, /**< LEFTMARGIN= */ + TidyAttr_LINK, /**< LINK= */ + TidyAttr_LONGDESC, /**< LONGDESC= */ + TidyAttr_LOWSRC, /**< LOWSRC= */ + TidyAttr_MARGINHEIGHT, /**< MARGINHEIGHT= */ + TidyAttr_MARGINWIDTH, /**< MARGINWIDTH= */ + TidyAttr_MAXLENGTH, /**< MAXLENGTH= */ + TidyAttr_MEDIA, /**< MEDIA= */ + TidyAttr_METHOD, /**< METHOD= */ + TidyAttr_MULTIPLE, /**< MULTIPLE= */ + TidyAttr_NAME, /**< NAME= */ + TidyAttr_NOHREF, /**< NOHREF= */ + TidyAttr_NORESIZE, /**< NORESIZE= */ + TidyAttr_NOSHADE, /**< NOSHADE= */ + TidyAttr_NOWRAP, /**< NOWRAP= */ + TidyAttr_OBJECT, /**< OBJECT= */ + TidyAttr_OnAFTERUPDATE, /**< OnAFTERUPDATE= */ + TidyAttr_OnBEFOREUNLOAD, /**< OnBEFOREUNLOAD= */ + TidyAttr_OnBEFOREUPDATE, /**< OnBEFOREUPDATE= */ + TidyAttr_OnBLUR, /**< OnBLUR= */ + TidyAttr_OnCHANGE, /**< OnCHANGE= */ + TidyAttr_OnCLICK, /**< OnCLICK= */ + TidyAttr_OnDATAAVAILABLE, /**< OnDATAAVAILABLE= */ + TidyAttr_OnDATASETCHANGED, /**< OnDATASETCHANGED= */ + TidyAttr_OnDATASETCOMPLETE, /**< OnDATASETCOMPLETE= */ + TidyAttr_OnDBLCLICK, /**< OnDBLCLICK= */ + TidyAttr_OnERRORUPDATE, /**< OnERRORUPDATE= */ + TidyAttr_OnFOCUS, /**< OnFOCUS= */ + TidyAttr_OnKEYDOWN, /**< OnKEYDOWN= */ + TidyAttr_OnKEYPRESS, /**< OnKEYPRESS= */ + TidyAttr_OnKEYUP, /**< OnKEYUP= */ + TidyAttr_OnLOAD, /**< OnLOAD= */ + TidyAttr_OnMOUSEDOWN, /**< OnMOUSEDOWN= */ + TidyAttr_OnMOUSEMOVE, /**< OnMOUSEMOVE= */ + TidyAttr_OnMOUSEOUT, /**< OnMOUSEOUT= */ + TidyAttr_OnMOUSEOVER, /**< OnMOUSEOVER= */ + TidyAttr_OnMOUSEUP, /**< OnMOUSEUP= */ + TidyAttr_OnRESET, /**< OnRESET= */ + TidyAttr_OnROWENTER, /**< OnROWENTER= */ + TidyAttr_OnROWEXIT, /**< OnROWEXIT= */ + TidyAttr_OnSELECT, /**< OnSELECT= */ + TidyAttr_OnSUBMIT, /**< OnSUBMIT= */ + TidyAttr_OnUNLOAD, /**< OnUNLOAD= */ + TidyAttr_PROFILE, /**< PROFILE= */ + TidyAttr_PROMPT, /**< PROMPT= */ + TidyAttr_RBSPAN, /**< RBSPAN= */ + TidyAttr_READONLY, /**< READONLY= */ + TidyAttr_REL, /**< REL= */ + TidyAttr_REV, /**< REV= */ + TidyAttr_RIGHTMARGIN, /**< RIGHTMARGIN= */ + TidyAttr_ROWS, /**< ROWS= */ + TidyAttr_ROWSPAN, /**< ROWSPAN= */ + TidyAttr_RULES, /**< RULES= */ + TidyAttr_SCHEME, /**< SCHEME= */ + TidyAttr_SCOPE, /**< SCOPE= */ + TidyAttr_SCROLLING, /**< SCROLLING= */ + TidyAttr_SELECTED, /**< SELECTED= */ + TidyAttr_SHAPE, /**< SHAPE= */ + TidyAttr_SHOWGRID, /**< SHOWGRID= */ + TidyAttr_SHOWGRIDX, /**< SHOWGRIDX= */ + TidyAttr_SHOWGRIDY, /**< SHOWGRIDY= */ + TidyAttr_SIZE, /**< SIZE= */ + TidyAttr_SPAN, /**< SPAN= */ + TidyAttr_SRC, /**< SRC= */ + TidyAttr_STANDBY, /**< STANDBY= */ + TidyAttr_START, /**< START= */ + TidyAttr_STYLE, /**< STYLE= */ + TidyAttr_SUMMARY, /**< SUMMARY= */ + TidyAttr_TABINDEX, /**< TABINDEX= */ + TidyAttr_TARGET, /**< TARGET= */ + TidyAttr_TEXT, /**< TEXT= */ + TidyAttr_TITLE, /**< TITLE= */ + TidyAttr_TOPMARGIN, /**< TOPMARGIN= */ + TidyAttr_TYPE, /**< TYPE= */ + TidyAttr_USEMAP, /**< USEMAP= */ + TidyAttr_VALIGN, /**< VALIGN= */ + TidyAttr_VALUE, /**< VALUE= */ + TidyAttr_VALUETYPE, /**< VALUETYPE= */ + TidyAttr_VERSION, /**< VERSION= */ + TidyAttr_VLINK, /**< VLINK= */ + TidyAttr_VSPACE, /**< VSPACE= */ + TidyAttr_WIDTH, /**< WIDTH= */ + TidyAttr_WRAP, /**< WRAP= */ + TidyAttr_XML_LANG, /**< XML_LANG= */ + TidyAttr_XML_SPACE, /**< XML_SPACE= */ + TidyAttr_XMLNS, /**< XMLNS= */ + N_TIDY_ATTRIBS /**< Must be last */ } TidyAttrId; #ifdef __cplusplus diff --git a/tidylib-src/src/access.c b/tidylib-src/src/access.c old mode 100755 new mode 100644 index bc4d0ab4..04fe3c56 --- a/tidylib-src/src/access.c +++ b/tidylib-src/src/access.c @@ -1,14 +1,14 @@ /* access.c -- carry out accessibility checks Copyright University of Toronto - Portions (c) 1998-2002 (W3C) MIT, INRIA, Keio University + Portions (c) 1998-2003 (W3C) MIT, INRIA, Keio University See tidy.h for the copyright notice. CVS Info : $Author: creitzel $ - $Date: 2002/08/08 21:43:22 $ - $Revision: 1.3.2.6 $ + $Date: 2003/02/16 19:33:09 $ + $Revision: 1.4 $ */ @@ -53,17 +53,17 @@ */ /* List of possible image types */ -static ctmbstr imageExtensions[] = +static const ctmbstr imageExtensions[] = {".jpg", ".gif", ".tif", ".pct", ".pic", ".iff", ".dib", ".tga", ".pcx", ".png", ".jpeg", ".tiff", ".bmp"}; #define N_IMAGE_EXTS (sizeof(imageExtensions)/sizeof(ctmbstr)) /* List of possible sound file types */ -static ctmbstr soundExtensions[] = +static const ctmbstr soundExtensions[] = {".wav", ".au", ".aiff", ".snd", ".ra", ".rm"}; -static int soundExtErrCodes[] = +static const int soundExtErrCodes[] = { AUDIO_MISSING_TEXT_WAV, AUDIO_MISSING_TEXT_AU, @@ -76,7 +76,7 @@ static int soundExtErrCodes[] = #define N_AUDIO_EXTS (sizeof(soundExtensions)/sizeof(ctmbstr)) /* List of possible media extensions */ -static ctmbstr mediaExtensions[] = +static const ctmbstr mediaExtensions[] = {".mpg", ".mov", ".asx", ".avi", ".ivf", ".m1v", ".mmm", ".mp2v", ".mpa", ".mpe", ".mpeg", ".ram", ".smi", ".smil", ".swf", ".wm", ".wma", ".wmv"}; @@ -84,14 +84,14 @@ static ctmbstr mediaExtensions[] = #define N_MEDIA_EXTS (sizeof(mediaExtensions)/sizeof(ctmbstr)) /* List of possible frame sources */ -static ctmbstr frameExtensions[] = +static const ctmbstr frameExtensions[] = {".htm", ".html", ".shtm", ".shtml", ".cfm", ".cfml", ".asp", ".cgi", ".pl", ".smil"}; #define N_FRAME_EXTS (sizeof(frameExtensions)/sizeof(ctmbstr)) /* List of possible colour values */ -static int colorValues[][3] = +static const int colorValues[][3] = { { 0, 0, 0}, {128,128,128}, @@ -114,7 +114,7 @@ static int colorValues[][3] = #define N_COLOR_VALS (sizeof(colorValues)/(sizeof(int[3])) /* These arrays are used to convert color names to their RGB values */ -static ctmbstr colorNames[] = +static const ctmbstr colorNames[] = { "black", "silver", @@ -142,7 +142,7 @@ static ctmbstr colorNames[] = List of error/warning messages. The error code corresponds to the check that is listed in the AERT (HTML specifications). */ -static ctmbstr errorMsgs[] = +static const ctmbstr errorMsgs[] = { "[1.1.1.1]: missing 'alt' text.", "[1.1.1.2]: suspicious 'alt' text (filename).", @@ -290,14 +290,16 @@ static Bool CompareColors( int rgbBG[3], int rgbFG[3] ); static int ctox( tmbchar ch ); static void DisplayHTMLTableAlgorithm( TidyDocImpl* doc); +/* static void CheckMapAccess( TidyDocImpl* doc, Node* node, Node* front); static void GetMapLinks( TidyDocImpl* doc, Node* node, Node* front); static void CompareAnchorLinks( TidyDocImpl* doc, Node* front, int counter); static void FindMissingLinks( TidyDocImpl* doc, Node* node, int counter); +*/ static void CheckFormControls( TidyDocImpl* doc, Node* node ); static void MetaDataPresent( TidyDocImpl* doc, Node* node ); static void CheckEmbed( TidyDocImpl* doc, Node* node ); -/* static void CheckListUsage( TidyDocImpl* doc, Node* node ); */ +static void CheckListUsage( TidyDocImpl* doc, Node* node ); /* GetFileExtension takes a path and returns the extension diff --git a/tidylib-src/src/access.h b/tidylib-src/src/access.h old mode 100755 new mode 100644 index 362fbe03..1d790b9d --- a/tidylib-src/src/access.h +++ b/tidylib-src/src/access.h @@ -9,9 +9,9 @@ CVS Info : - $Author: terry_teague $ - $Date: 2002/07/08 07:37:27 $ - $Revision: 1.1.2.3 $ + $Author: creitzel $ + $Date: 2003/02/16 19:33:09 $ + $Revision: 1.2 $ */ diff --git a/tidylib-src/src/alloc.c b/tidylib-src/src/alloc.c old mode 100755 new mode 100644 index de5e968b..ce7adbb9 --- a/tidylib-src/src/alloc.c +++ b/tidylib-src/src/alloc.c @@ -6,8 +6,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/07/28 18:10:15 $ - $Revision: 1.1.2.3 $ + $Date: 2003/02/16 19:33:09 $ + $Revision: 1.2 $ */ diff --git a/tidylib-src/src/attrask.c b/tidylib-src/src/attrask.c old mode 100755 new mode 100644 index 97325e46..ad5907ca --- a/tidylib-src/src/attrask.c +++ b/tidylib-src/src/attrask.c @@ -5,8 +5,8 @@ CVS Info: $Author: creitzel $ - $Date: 2002/07/08 18:03:18 $ - $Revision: 1.1.2.3 $ + $Date: 2003/02/16 19:33:09 $ + $Revision: 1.2 $ */ diff --git a/tidylib-src/src/attrget.c b/tidylib-src/src/attrget.c old mode 100755 new mode 100644 index 0259c91c..cbc63f02 --- a/tidylib-src/src/attrget.c +++ b/tidylib-src/src/attrget.c @@ -5,8 +5,8 @@ CVS Info: $Author: creitzel $ - $Date: 2002/07/08 18:03:18 $ - $Revision: 1.1.2.3 $ + $Date: 2003/02/16 19:33:09 $ + $Revision: 1.2 $ */ diff --git a/tidylib-src/src/attrs.c b/tidylib-src/src/attrs.c old mode 100755 new mode 100644 index b313d3b6..a6ab4f3e --- a/tidylib-src/src/attrs.c +++ b/tidylib-src/src/attrs.c @@ -6,8 +6,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/08/08 21:45:37 $ - $Revision: 1.53.2.6 $ + $Date: 2003/02/16 19:33:10 $ + $Revision: 1.54 $ */ @@ -55,7 +55,7 @@ /* */ -static Attribute attribute_defs [] = +static const Attribute attribute_defs [] = { {TidyAttr_UNKNOWN, "unknown!", VERS_PROPRIETARY, null}, {TidyAttr_ABBR, "abbr", VERS_HTML40, TEXT}, @@ -224,7 +224,7 @@ struct _colors ctmbstr hex; }; -static struct _colors colors[] = +static const struct _colors colors[] = { {"black", "#000000"}, {"green", "#008000"}, @@ -245,7 +245,7 @@ static struct _colors colors[] = {null, null} }; -static struct _colors fancy_colors[] = +static const struct _colors fancy_colors[] = { { "darkgreen", "#006400" }, { "antiquewhite", "#FAEBD7" }, @@ -391,11 +391,11 @@ static struct _colors fancy_colors[] = }; -static Attribute* lookup( ctmbstr atnam ) +static const Attribute* lookup( ctmbstr atnam ) { if ( atnam ) { - Attribute *np = attribute_defs; + const Attribute *np = attribute_defs; for ( /**/; np && np->name; ++np ) if ( tmbstrcmp(atnam, np->name) == 0 ) return np; @@ -419,7 +419,7 @@ AttVal* AttrGetById( Node* node, TidyAttrId id ) } /* public method for finding attribute definition by name */ -Attribute* FindAttribute( TidyDocImpl* doc, AttVal *attval ) +const Attribute* FindAttribute( TidyDocImpl* doc, AttVal *attval ) { if ( attval ) return lookup( attval->attribute ); @@ -461,7 +461,7 @@ AttVal* AddAttribute( TidyDocImpl* doc, static Bool CheckAttrType( TidyDocImpl* doc, ctmbstr attrname, AttrCheck type ) { - Attribute* np = lookup( attrname ); + const Attribute* np = lookup( attrname ); return (Bool)( np && np->attrchk == type ); } @@ -482,7 +482,7 @@ Bool IsScript( TidyDocImpl* doc, ctmbstr attrname ) Bool IsLiteralAttribute( TidyDocImpl* doc, ctmbstr attrname ) { - Attribute* np = lookup( attrname ); + const Attribute* np = lookup( attrname ); return (Bool)( np && np->literal ); } @@ -654,7 +654,7 @@ void InitAttrs( TidyDocImpl* doc ) TidyAttrId id; for ( id=1; id < N_TIDY_ATTRIBS; ++id ) { - Attribute* dict = &attribute_defs[ id ]; + const Attribute* dict = &attribute_defs[ id ]; assert( dict->id == id ); if ( prev ) assert( tmbstrcmp( prev, dict->name ) < 0 ); @@ -662,70 +662,6 @@ void InitAttrs( TidyDocImpl* doc ) } } #endif - - -#if 0 - for( ap = attrlist; ap->name != null; ++ap ) - install( attribs, ap->name, ap->versions, ap->attrchk ); - - attribs->attr_href = lookup( attribs, "href" ); - attribs->attr_src = lookup( attribs, "src" ); - attribs->attr_id = lookup( attribs, "id" ); - attribs->attr_name = lookup( attribs, "name" ); - attribs->attr_summary = lookup( attribs, "summary" ); - attribs->attr_alt = lookup( attribs, "alt" ); - attribs->attr_longdesc = lookup( attribs, "longdesc" ); - attribs->attr_usemap = lookup( attribs, "usemap" ); - attribs->attr_ismap = lookup( attribs, "ismap" ); - attribs->attr_language = lookup( attribs, "language" ); - attribs->attr_type = lookup( attribs, "type" ); - attribs->attr_title = lookup( attribs, "title" ); - attribs->attr_xmlns = lookup( attribs, "xmlns" ); - attribs->attr_datafld = lookup( attribs, "datafld" ); - attribs->attr_value = lookup( attribs, "value" ); - attribs->attr_content = lookup( attribs, "content" ); - attribs->attr_width = lookup( attribs, "width" ); - attribs->attr_height = lookup( attribs, "height" ); - -/* TRT/Mike Lam */ -#if SUPPORT_ACCESSIBILITY_CHECKS - - attribs->attr_for = lookup( attribs, "for" ); - attribs->attr_selected = lookup( attribs, "selected" ); - attribs->attr_checked = lookup( attribs, "checked" ); - attribs->attr_lang = lookup( attribs, "lang" ); - attribs->attr_target = lookup( attribs, "target" ); - attribs->attr_httpEquiv = lookup( attribs, "http-equiv" ); - attribs->attr_rel = lookup( attribs, "rel" ); - attribs->attr_onMouseMove = lookup( attribs, "onmousemove" ); - attribs->attr_onMouseDown = lookup( attribs, "onmousedown" ); - attribs->attr_onMouseUp = lookup( attribs, "onmouseup" ); - attribs->attr_onClick = lookup( attribs, "onclick" ); - attribs->attr_onMouseOver = lookup( attribs, "onmouseover" ); - attribs->attr_onMouseOut = lookup( attribs, "onmouseout" ); - attribs->attr_onKeyDown = lookup( attribs, "onkeydown" ); - attribs->attr_onKeyUp = lookup( attribs, "onkeyup" ); - attribs->attr_onKeyPress = lookup( attribs, "onkeypress" ); - attribs->attr_onFocus = lookup( attribs, "onfocus" ); - attribs->attr_onBlur = lookup( attribs, "onblur" ); - attribs->attr_bgcolor = lookup( attribs, "bgcolor" ); - attribs->attr_text = lookup( attribs, "text" ); - attribs->attr_link = lookup( attribs, "link" ); - attribs->attr_alink = lookup( attribs, "alink" ); - attribs->attr_vlink = lookup( attribs, "vlink" ); - attribs->attr_style = lookup( attribs, "style" ); - attribs->attr_abbr = lookup( attribs, "abbr" ); - attribs->attr_colspan = lookup( attribs, "colspan" ); - attribs->attr_font = lookup( attribs, "font" ); - attribs->attr_basefont = lookup( attribs, "basefont" ); - attribs->attr_rowspan = lookup( attribs, "rowspan" ); - -#endif - - SetNoWrap( attribute_defs[ TidyAttr_ALT ] ); - SetNoWrap( attribute_defs[ TidyAttr_VALUE ] ); - SetNoWrap( attribute_defs[ TidyAttr_CONTENT ] ); -#endif /* 0 */ } /* @@ -734,14 +670,14 @@ using embed with script attributes where newlines are signficant. These need to be declared and handled specially! */ -static void DeclareAttribute( TidyDocImpl* doc, - ctmbstr name, uint versions, Bool nowrap, Bool isliteral ) +static void DeclareAttribute( TidyDocImpl* doc, ctmbstr name, + uint versions, Bool nowrap, Bool isliteral ) { - TidyAttribImpl* attribs = &doc->attribs; - Attribute *dict = lookup( name ); - if ( dict == null ) + const Attribute *exist = lookup( name ); + if ( exist == null ) { - dict = (Attribute*) MemAlloc( sizeof(Attribute) ); + TidyAttribImpl* attribs = &doc->attribs; + Attribute* dict = (Attribute*) MemAlloc( sizeof(Attribute) ); ClearMemory( dict, sizeof(Attribute) ); dict->name = tmbstrdup( name ); @@ -770,32 +706,11 @@ static void FreeDeclaredAttributes( TidyDocImpl* doc ) void DeclareLiteralAttrib( TidyDocImpl* doc, ctmbstr name ) { - DeclareAttribute( doc, name, VERS_PROPRIETARY, no, yes ); + DeclareAttribute( doc, name, VERS_PROPRIETARY, no, yes ); } void FreeAttrTable( TidyDocImpl* doc ) { -#if 0 - TidyAttribImpl* attribs = &doc->attribs; - Attribute *attdef, *next; - int i; - - for (i = 0; i < ATTRIB_HASHSIZE; ++i) - { - attdef = attribs->hashtab[i]; - - while(attdef) - { - next = attdef->next; - MemFree(attdef->name); - MemFree(attdef); - attdef = next; - } - - attribs->hashtab[i] = null; - } -#endif - FreeAnchors( doc ); FreeDeclaredAttributes( doc ); } @@ -934,9 +849,9 @@ void RepairDuplicateAttributes( TidyDocImpl* doc, Node *node) /* ignore unknown attributes for proprietary elements */ -Attribute* CheckAttribute( TidyDocImpl* doc, Node *node, AttVal *attval ) +const Attribute* CheckAttribute( TidyDocImpl* doc, Node *node, AttVal *attval ) { - Attribute* attribute = attval->dict; + const Attribute* attribute = attval->dict; if ( attribute != null ) { @@ -970,14 +885,9 @@ Attribute* CheckAttribute( TidyDocImpl* doc, Node *node, AttVal *attval ) Bool IsBoolAttribute(AttVal *attval) { - Attribute *attribute; - - if ((attribute = attval->dict) != null) - { - if (attribute->attrchk == CheckBool) - return yes; - } - + const Attribute *attribute = ( attval ? attval->dict : null ); + if ( attribute && attribute->attrchk == CheckBool ) + return yes; return no; } @@ -1432,7 +1342,7 @@ void CheckColor( TidyDocImpl* doc, Node *node, AttVal *attval) Bool invalid = no; Bool found = no; tmbstr given; - struct _colors *color; + const struct _colors *color; uint i = 0; if (attval == null || attval->value == null) diff --git a/tidylib-src/src/attrs.h b/tidylib-src/src/attrs.h old mode 100755 new mode 100644 index 1745faee..cb3fd920 --- a/tidylib-src/src/attrs.h +++ b/tidylib-src/src/attrs.h @@ -9,8 +9,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/08/08 21:45:37 $ - $Revision: 1.1.2.7 $ + $Date: 2003/02/16 19:33:10 $ + $Revision: 1.2 $ */ @@ -19,9 +19,6 @@ /* declaration for methods that check attribute values */ typedef void (AttrCheck)(TidyDocImpl* doc, Node *node, AttVal *attval); -/* each tag/attribute helps to constrain the version of HTML */ -void ConstrainVersion(TidyDocImpl* doc, uint vers); - struct _Attribute { TidyAttrId id; @@ -140,9 +137,9 @@ AttrCheck CheckLang; /* public method for finding attribute definition by name */ -Attribute* CheckAttribute( TidyDocImpl* doc, Node *node, AttVal *attval ); +const Attribute* CheckAttribute( TidyDocImpl* doc, Node *node, AttVal *attval ); -Attribute* FindAttribute( TidyDocImpl* doc, AttVal *attval ); +const Attribute* FindAttribute( TidyDocImpl* doc, AttVal *attval ); AttVal* GetAttrByName( Node *node, ctmbstr name ); @@ -214,9 +211,17 @@ Bool attrIsEvent( AttVal* attval ); AttVal* AttrGetById( Node* node, TidyAttrId id ); /* 0 == TidyAttr_UNKNOWN */ -#define AttrId(av) ((av) ? ((av)->dict ? (av)->dict->id : 0) : 0) +#define AttrId(av) ((av) && (av)->dict ? (av)->dict->id : TidyAttr_UNKNOWN) #define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid)) +#define AttrHasValue(attr) ((attr) && (attr)->value) +#define AttrMatches(attr, val) (AttrHasValue(attr) && \ + tmbstrcasecmp((attr)->value, val) == 0) +#define AttrContains(attr, val) (AttrHasValue(attr) && \ + tmbsubstr((attr)->value, val) != null) +#define AttrVersions(attr) ((attr) && (attr)->dict ? (attr)->dict->versions : VERS_PROPRIETARY) + + #define attrIsABBR(av) AttrIsId( av, TidyAttr_ABBR ) #define attrIsACCEPT(av) AttrIsId( av, TidyAttr_ACCEPT ) #define attrIsACCEPT_CHARSET(av) AttrIsId( av, TidyAttr_ACCEPT_CHARSET ) diff --git a/tidylib-src/src/buffio.c b/tidylib-src/src/buffio.c old mode 100755 new mode 100644 index e58dd3de..39ec2758 --- a/tidylib-src/src/buffio.c +++ b/tidylib-src/src/buffio.c @@ -6,8 +6,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/07/28 18:10:15 $ - $Revision: 1.1.2.4 $ + $Date: 2003/02/16 19:33:10 $ + $Revision: 1.2 $ Requires buffer to automatically grow as bytes are added. Must keep track of current read and write points. @@ -160,7 +160,7 @@ int tidyBufPopByte( TidyBuffer* buf ) int bv = EOF; assert( buf != null ); if ( buf->size > 0 ) - bv = buf->bp[ buf->size-- ]; + bv = buf->bp[ --buf->size ]; return bv; } diff --git a/tidylib-src/src/clean.c b/tidylib-src/src/clean.c old mode 100755 new mode 100644 index 81798fac..0917b8c4 --- a/tidylib-src/src/clean.c +++ b/tidylib-src/src/clean.c @@ -7,8 +7,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/08/08 21:49:02 $ - $Revision: 1.18.2.7 $ + $Date: 2003/02/16 19:33:10 $ + $Revision: 1.20 $ Filters from other formats such as Microsoft Word often make excessive use of presentation markup such @@ -59,9 +59,9 @@ #include "tmbstr.h" #include "utf8.h" -static void RenameElem( Node* node, TidyTagId tid ) +void RenameElem( Node* node, TidyTagId tid ) { - Dict* dict = LookupTagDef( tid ); + const Dict* dict = LookupTagDef( tid ); MemFree( node->element ); node->element = tmbstrdup( dict->name ); node->tag = dict; @@ -217,7 +217,8 @@ static tmbstr CreatePropString(StyleProp *props) for (len = 0, prop = props; prop; prop = prop->next) { len += tmbstrlen(prop->name) + 2; - len += tmbstrlen(prop->value) + 2; + if (prop->value) + len += tmbstrlen(prop->value) + 2; } style = (tmbstr) MemAlloc(len+1); @@ -228,13 +229,15 @@ static tmbstr CreatePropString(StyleProp *props) while((*p++ = *s++)); - *--p = ':'; - *++p = ' '; - ++p; - - s = prop->value; - while((*p++ = *s++)); + if (prop->value) + { + *--p = ':'; + *++p = ' '; + ++p; + s = prop->value; + while((*p++ = *s++)); + } if (prop->next == null) break; @@ -248,7 +251,6 @@ static tmbstr CreatePropString(StyleProp *props) /* create string with merged properties -*/ static tmbstr AddProperty( ctmbstr style, ctmbstr property ) { tmbstr line; @@ -260,6 +262,7 @@ static tmbstr AddProperty( ctmbstr style, ctmbstr property ) FreeStyleProps(prop); return line; } +*/ void FreeStyles( TidyDocImpl* doc ) { @@ -646,6 +649,27 @@ static void DiscardContainer( TidyDocImpl* doc, Node *element, Node **pnode) FreeNode(doc, element); } +/* + Create new string that consists of the + combined style properties in s1 and s2 + + To merge property lists, we build a linked + list of property/values and insert properties + into the list in order, merging values for + the same property name. +*/ +static tmbstr MergeProperties( ctmbstr s1, ctmbstr s2 ) +{ + tmbstr s; + StyleProp *prop; + + prop = CreateProps(null, s1); + prop = CreateProps(prop, s2); + s = CreatePropString(prop); + FreeStyleProps(prop); + return s; +} + /* Add style property to element, creating style attribute as needed and adding ; delimiter @@ -659,7 +683,7 @@ static void AddStyleProperty(TidyDocImpl* doc, Node *node, ctmbstr property ) if ( av ) { - tmbstr s = AddProperty( av->value, property ); + tmbstr s = MergeProperties( av->value, property ); MemFree( av->value ); av->value = s; } @@ -675,27 +699,6 @@ static void AddStyleProperty(TidyDocImpl* doc, Node *node, ctmbstr property ) } } -/* - Create new string that consists of the - combined style properties in s1 and s2 - - To merge property lists, we build a linked - list of property/values and insert properties - into the list in order, merging values for - the same property name. -*/ -static tmbstr MergeProperties( ctmbstr s1, ctmbstr s2 ) -{ - tmbstr s; - StyleProp *prop; - - prop = CreateProps(null, s1); - prop = CreateProps(prop, s2); - s = CreatePropString(prop); - FreeStyleProps(prop); - return s; -} - static void MergeClasses(TidyDocImpl* doc, Node *node, Node *child) { AttVal *av; @@ -799,7 +802,7 @@ static void MergeStyles(TidyDocImpl* doc, Node *node, Node *child) static ctmbstr FontSize2Name( ctmbstr size, tmbstr buf ) { - static ctmbstr sizes[7] = + static const ctmbstr sizes[7] = { "60%", "70%", "80%", null, "120%", "150%", "200%" @@ -1776,15 +1779,14 @@ Bool NoMargins(Node *node) { AttVal *attval = GetAttrByName(node, "style"); - if (attval == null) + if ( !AttrHasValue(attval) ) return no; /* search for substring "margin-top: 0" */ - if (!tmbsubstr(attval->value, "margin-top: 0")) return no; - /* search for substring "margin-top: 0" */ + /* search for substring "margin-bottom: 0" */ if (!tmbsubstr(attval->value, "margin-bottom: 0")) return no; @@ -1914,9 +1916,11 @@ void CleanWord2000( TidyDocImpl* doc, Node *node) } /* discard empty paragraphs */ + if ( node->content == null && nodeIsP(node) ) { - node = DiscardElement( doc, node ); + /* Use the existing function to ensure consistency */ + node = TrimEmptyElement( doc, node ); continue; } @@ -1933,10 +1937,9 @@ void CleanWord2000( TidyDocImpl* doc, Node *node) */ /* map sequence of

to

    ...
*/ /* map

to

    ...
*/ - if ((attr && - (tmbstrcmp(attr->value, "MsoListBullet") == 0 || - tmbstrcmp(attr->value, "MsoListNumber") == 0 )) || - (atrStyle && (strstr(atrStyle->value,"mso-list:") != null))) /* 463066 - fix by Joel Shafer 19 Sep 01 */ + if ( AttrMatches(attr, "MsoListBullet") || + AttrMatches(attr, "MsoListNumber") || + AttrContains(atrStyle, "mso-list:") ) { TidyTagId listType = TidyTag_UL; if ( attr && tmbstrcmp(attr->value, "MsoListNumber") == 0 ) @@ -1946,7 +1949,7 @@ void CleanWord2000( TidyDocImpl* doc, Node *node) if ( !list || TagId(list) != listType ) { - Dict* tag = LookupTagDef( listType ); + const Dict* tag = LookupTagDef( listType ); list = InferredTag( doc, tag->name ); InsertNodeBeforeElement(node, list); } @@ -2016,20 +2019,14 @@ Bool IsWord2000( TidyDocImpl* doc ) if ( !nodeIsMETA(node) ) continue; - attval = GetAttrByName(node, "name"); - - if (attval == null || attval->value == null) - continue; + attval = AttrGetById( node, TidyAttr_NAME ); - if (tmbstrcasecmp(attval->value, "generator") != 0) + if ( !AttrMatches(attval, "generator") ) continue; - attval = GetAttrByName(node, "content"); - - if (attval == null || attval->value == null) - continue; + attval = AttrGetById( node, TidyAttr_CONTENT ); - if ( tmbsubstr(attval->value, "Microsoft") ) + if ( AttrContains(attval, "Microsoft") ) return yes; } } @@ -2085,3 +2082,329 @@ void BumpObject( TidyDocImpl* doc, Node *html ) } } } + +void FixBrakes( TidyDocImpl* pDoc, Node *pParent ) +{ + Node *pNode; + Bool bBRDeleted = no; + + if (NULL == pParent) + return; + + /* First, check the status of All My Children */ + for ( pNode = pParent->content; NULL != pNode; pNode = pNode->next ) + { + FixBrakes( pDoc, pNode ); + } + + /* As long as my last child is a
, move it to my last peer */ + if ( nodeCMIsBlock( pParent )) + { + for ( pNode = pParent->last; + NULL != pNode && nodeIsBR( pNode ); + pNode = pParent->last ) + { + if ( NULL == pNode->attributes && no == bBRDeleted ) + { + DiscardElement( pDoc, pNode ); + bBRDeleted = yes; + } + else + { + RemoveNode( pNode ); + InsertNodeAfterElement( pParent, pNode ); + } + } + TrimEmptyElement( pDoc, pParent ); + } +} + +void VerifyHTTPEquiv( TidyDocImpl* pDoc, Node *pHead ) +{ + if (!nodeIsHEAD( pHead )) + pHead = FindHEAD( pDoc ); + if (NULL != pHead) + { + /* Find any meta tag which has an http-equiv tag + where value is content-type */ + Node *pNode; + + for (pNode = pHead->content; NULL != pNode; pNode = pNode->next) + { + if (nodeIsMETA( pNode )) + { + AttVal *pAttVal; + if (NULL != (pAttVal = GetAttrByName( pNode, "http-equiv" ))) + { + if (0 != tmbstrcasecmp( pAttVal->value, "CONTENT-TYPE" )) + continue; + if (NULL != (pAttVal = GetAttrByName( pNode, "content" ))) + { + StyleProp *pFirstProp = null, *pLastProp = null, *prop = null; + tmbstr s, pszBegin, pszEnd; + + pszBegin = s = tmbstrdup( pAttVal->value ); + while ('\0' != *pszBegin) + { + while (isspace( *pszBegin )) + pszBegin++; + pszEnd = pszBegin; + while ('\0' != *pszEnd && ';' != *pszEnd) + pszEnd++; + if (';' == *pszEnd ) + *(pszEnd++) = '\0'; + if (pszEnd > pszBegin) + { + prop = (StyleProp *)MemAlloc(sizeof(StyleProp)); + prop->name = tmbstrdup( pszBegin ); + prop->value = null; + prop->next = null; + + if (null != pLastProp) + pLastProp->next = prop; + else + pFirstProp = prop; + pLastProp = prop; + pszBegin = pszEnd; + } + } + MemFree( s ); + + /* find the charset property */ + for (prop = pFirstProp; null != prop; prop = prop->next) + { + if (0 == tmbstrncasecmp( prop->name, "charset", 7 )) + { + ctmbstr enc = null; + + MemFree( prop->name ); + prop->name = MemAlloc( 32 ); + switch ( cfg( pDoc, TidyOutCharEncoding) ) + { + case RAW: enc = "raw"; break; + case ASCII: enc = "us-ascii"; break; + case LATIN1: enc = "iso-8859-1"; break; + case UTF8: enc = "UTF8"; break; + case ISO2022: enc = "iso-2022"; break; + case MACROMAN: enc = "mac"; break; + case WIN1252: enc = "windows-1252"; break; +#if SUPPORT_UTF16_ENCODINGS + case UTF16LE: enc = "UTF-16LE"; break; + case UTF16BE: enc = "UTF-16BE"; break; + case UTF16: enc = "UTF-16"; break; +#endif +#if SUPPORT_ASIAN_ENCODINGS + case BIG5: enc = "big5"; break; + case SHIFTJIS: enc = "shiftjis"; break; +#endif + } + sprintf( prop->name, "charset=%s", enc ); + s = CreatePropString( pFirstProp ); + MemFree( pAttVal->value ); + pAttVal->value = s; + FreeStyleProps(prop); + break; + } + } + } + } + } + } + } +} + +#define MissingVersion(ver, verWanted) (!(ver & verWanted) && !(ver & VERS_PROPRIETARY)) + +static Bool AttrCompliance( TidyDocImpl* doc, Node* node, uint versWanted ) +{ + Bool compliant = yes; + AttVal* attr = node->attributes; + for ( /**/; attr; attr = attr->next ) + { + uint attrVer = AttrVersions( attr ); + if ( MissingVersion(attrVer, versWanted) ) + { + ReportNonCompliantAttr( doc, node, attr, versWanted ); + compliant = no; + } + + /* No align, except on: , , , , + ** , , , + */ + if ( attrIsALIGN(attr) && VERS_HTML40_STRICT==versWanted ) + { + switch ( TagId(node) ) + { + case TidyTag_COL: + case TidyTag_COLGROUP: + case TidyTag_TBODY: + case TidyTag_TD: + case TidyTag_TFOOT: + case TidyTag_TH: + case TidyTag_THEAD: + case TidyTag_TR: + break; + + default: + ReportNonCompliantAttr( doc, node, attr, versWanted ); + compliant = no; + break; + } + } + } + return compliant; +} + +static Bool NodeCompliance( TidyDocImpl* doc, Node* node, uint versWanted ) +{ + Bool compliant = yes; + Bool checkCM = no; + + if ( !node ) + return no; + + switch ( node->type ) + { +#if 0 + case TidyNode_Root: /* Root */ + case TidyNode_DocType: /* DOCTYPE */ + case TidyNode_Comment: /* Comment */ + case TidyNode_ProcIns: /* Processing Instruction */ + break; +#endif + + case TidyNode_Text: /* Text */ + checkCM = yes; + break; + + case TidyNode_Start: /* Start Tag */ + case TidyNode_StartEnd: /* Start/End (empty) Tag */ + checkCM = !nodeCMIsBlock( node ); + compliant = AttrCompliance( doc, node, versWanted ); + if ( compliant ) + { + uint nodeVer = node->tag->versions; + if ( MissingVersion(nodeVer, versWanted) ) + { + ReportNonCompliantNode( doc, node, + OBSOLETE_ELEMENT, versWanted ); + compliant = no; + } + } + if ( compliant && VERS_HTML40_STRICT == versWanted ) + { + AttVal* attr = null; + switch ( TagId(node) ) + { + case TidyTag_BR: /* no clear */ + attr = AttrGetById( node, TidyAttr_CLEAR ); + break; + + case TidyTag_HR: /* no size, shade */ + attr = AttrGetById( node, TidyAttr_SIZE ); + if ( !attr ) + attr = AttrGetById( node, TidyAttr_NOSHADE ); + break; + + case TidyTag_IMG: /* no border */ + attr = AttrGetById( node, TidyAttr_BORDER ); + break; + + case TidyTag_LI: /* no value, type */ + attr = AttrGetById( node, TidyAttr_TYPE ); + if ( !attr ) + attr = AttrGetById( node, TidyAttr_VALUE ); + break; + + case TidyTag_OL: /* no start, type */ + attr = AttrGetById( node, TidyAttr_TYPE ); + if ( !attr ) + attr = AttrGetById( node, TidyAttr_START ); + break; + + case TidyTag_PRE: /* no width */ + attr = AttrGetById( node, TidyAttr_WIDTH ); + break; + + case TidyTag_SCRIPT: /* no language */ + attr = AttrGetById( node, TidyAttr_LANGUAGE ); + break; + + case TidyTag_TD: /* no width, height */ + case TidyTag_TH: + attr = AttrGetById( node, TidyAttr_WIDTH ); + if ( !attr ) + attr = AttrGetById( node, TidyAttr_HEIGHT ); + break; + + case TidyTag_UL: /* no type */ + attr = AttrGetById( node, TidyAttr_TYPE ); + break; + } + if ( attr ) + { + ReportNonCompliantAttr( doc, node, attr, versWanted ); + compliant = no; + } + } + break; + +#if 0 + case TidyNode_End: /* End Tag */ + case TidyNode_CDATA: /* Unparsed Text */ + case TidyNode_Section: /* XML Section */ + case TidyNode_Asp: /* ASP Source */ + case TidyNode_Jste: /* JSTE Source */ + case TidyNode_Php: /* PHP Source */ + case TidyNode_XmlDecl: /* XML Declaration */ + break; +#endif + } + + /* Check inline elements and text nodes + ** not a child of %block content model. + */ + if ( compliant && checkCM ) + { + Node* parent = node->parent; + if ( nodeIsBODY(parent) || + nodeIsMAP(parent) || + nodeIsBLOCKQUOTE(parent) || + nodeIsFORM(parent) || + nodeIsNOSCRIPT(parent) ) + { + ReportNonCompliantNode( doc, parent, + MIXED_CONTENT_IN_BLOCK, versWanted ); + } + } + + /* Scan all child nodes */ + for ( node=node->content; node; node = node->next ) + { + Bool comply = NodeCompliance( doc, node, versWanted ); + if ( compliant && !comply ) + compliant = no; + } + + return compliant; +} + +Bool HTMLVersionCompliance( TidyDocImpl* doc ) +{ + Bool compliant = no; + uint versWanted = VERS_HTML32; + uint dtmode = cfg( doc, TidyDoctypeMode ); + uint contver = (uint) doc->lexer->versions; + uint dtver = (uint) doc->lexer->doctype; + + if ( TidyDoctypeStrict == dtmode || VERS_HTML40_STRICT == dtver ) + versWanted = VERS_HTML40_STRICT; + else if ( TidyDoctypeLoose == dtmode || VERS_HTML40_LOOSE == dtver ) + versWanted = VERS_HTML40_LOOSE; + + compliant = ( (versWanted & contver) != 0 ); + if ( !compliant ) + NodeCompliance( doc, doc->root, versWanted ); + return compliant; +} + diff --git a/tidylib-src/src/clean.h b/tidylib-src/src/clean.h old mode 100755 new mode 100644 index 203cc376..1a061b56 --- a/tidylib-src/src/clean.h +++ b/tidylib-src/src/clean.h @@ -7,12 +7,14 @@ See tidy.h for the copyright notice. CVS Info: - $Author: terry_teague $ - $Date: 2002/07/08 07:40:46 $ - $Revision: 1.1.2.2 $ + $Author: creitzel $ + $Date: 2003/02/16 19:33:10 $ + $Revision: 1.2 $ */ +void RenameElem( Node* node, TidyTagId tid ); + Node* CleanNode( TidyDocImpl* doc, Node* node ); void FreeStyles( TidyDocImpl* doc ); @@ -71,4 +73,10 @@ Bool IsWord2000( TidyDocImpl* doc ); /* where appropriate move object elements from head to body */ void BumpObject( TidyDocImpl* doc, Node *html ); +void FixBrakes( TidyDocImpl* pDoc, Node *pParent ); + +void VerifyHTTPEquiv( TidyDocImpl* pDoc, Node *pParent ); + +Bool HTMLVersionCompliance( TidyDocImpl* doc ); + #endif /* __CLEAN_H__ */ diff --git a/tidylib-src/src/config.c b/tidylib-src/src/config.c old mode 100755 new mode 100644 index 4e39a6c7..93417afa --- a/tidylib-src/src/config.c +++ b/tidylib-src/src/config.c @@ -1,14 +1,14 @@ /* config.c -- read config file and manage config properties - (c) 1998-2002 (W3C) MIT, INRIA, Keio University + (c) 1998-2003 (W3C) MIT, INRIA, Keio University See tidy.h for the copyright notice. CVS Info : - $Author: creitzel $ - $Date: 2002/08/13 21:41:53 $ - $Revision: 1.43.2.8 $ + $Author: terry_teague $ + $Date: 2003/02/18 07:13:08 $ + $Revision: 1.46 $ */ @@ -31,6 +31,7 @@ #include "tidy-int.h" #include "message.h" #include "tmbstr.h" +#include "tags.h" int CharEncodingId( ctmbstr charenc ); /* returns -1 if not recognized */ @@ -49,21 +50,21 @@ void FreeConfig( TidyDocImpl* doc ) /* Arrange so index can be cast to enum */ -static ctmbstr boolPicks[] = +static const ctmbstr boolPicks[] = { "no", "yes", null }; -static ctmbstr invBoolPicks[] = +static const ctmbstr invBoolPicks[] = { "yes", "no", null }; -static ctmbstr autoBoolPicks[] = +static const ctmbstr autoBoolPicks[] = { "no", "yes", @@ -71,14 +72,14 @@ static ctmbstr autoBoolPicks[] = null }; -static ctmbstr repeatAttrPicks[] = +static const ctmbstr repeatAttrPicks[] = { "keep-first", "keep-last", null }; -static ctmbstr accessPicks[] = +static const ctmbstr accessPicks[] = { "0 - Tidy Classic", "1 - Priority 1 Checks", @@ -87,15 +88,17 @@ static ctmbstr accessPicks[] = null }; -static ctmbstr charEncPicks[] = +static const ctmbstr charEncPicks[] = { "raw", "ascii", + "latin0", "latin1", "utf8", "iso2022", "mac", "win1252", + "ibm858", #if SUPPORT_UTF16_ENCODINGS "utf16le", @@ -111,7 +114,15 @@ static ctmbstr charEncPicks[] = null }; -static ctmbstr doctypePicks[] = +static const ctmbstr newlinePicks[] = +{ + "LF", + "CRLF", + "CR", + null +}; + +static const ctmbstr doctypePicks[] = { "omit", "auto", @@ -121,7 +132,6 @@ static ctmbstr doctypePicks[] = null }; - #define MU TidyMarkup #define DG TidyDiagnostics #define PP TidyPrettyPrint @@ -132,7 +142,16 @@ static ctmbstr doctypePicks[] = #define BL TidyBoolean #define ST TidyString -static TidyOptionImpl option_defs[] = +#define DLF DEFAULT_NL_CONFIG + +/* If Accessibility checks not supported, make config setting read-only */ +#if SUPPORT_ACCESSIBILITY_CHECKS +#define ParseAcc ParseInt +#else +#define ParseAcc null +#endif + +static const TidyOptionImpl option_defs[] = { { TidyUnknownOption, MS, "unknown!", IN, 0, null, null }, { TidyIndentSpaces, PP, "indent-spaces", IN, 2, ParseInt, null }, @@ -142,6 +161,7 @@ static TidyOptionImpl option_defs[] = { TidyCharEncoding, CE, "char-encoding", IN, ASCII, ParseCharEnc, charEncPicks }, { TidyInCharEncoding, CE, "input-encoding", IN, LATIN1, ParseCharEnc, charEncPicks }, { TidyOutCharEncoding,CE, "output-encoding", IN, ASCII, ParseCharEnc, charEncPicks }, + { TidyNewline, CE, "newline", IN, DLF, ParseNewline, newlinePicks }, { TidyDoctypeMode, MU, "doctype-mode", IN, TidyDoctypeAuto, null, doctypePicks }, { TidyDoctype, MU, "doctype", ST, null, ParseDocType, doctypePicks }, @@ -150,11 +170,12 @@ static TidyOptionImpl option_defs[] = { TidyAltText, MU, "alt-text", ST, null, ParseString, null }, { TidySlideStyle, MS, "slide-style", ST, null, ParseName, null }, { TidyErrFile, MS, "error-file", ST, null, ParseString, null }, + { TidyOutFile, MS, "output-file", ST, null, ParseString, null }, { TidyWriteBack, MS, "write-back", BL, no, ParseBool, boolPicks }, { TidyShowMarkup, PP, "markup", BL, yes, ParseBool, boolPicks }, { TidyShowWarnings, DG, "show-warnings", BL, yes, ParseBool, boolPicks }, { TidyQuiet, MS, "quiet", BL, no, ParseBool, boolPicks }, - { TidyIndentContent, PP, "indent", IN, TidyAutoState, ParseIndent, autoBoolPicks }, + { TidyIndentContent, PP, "indent", IN, TidyNoState, ParseIndent, autoBoolPicks }, { TidyHideEndTags, MU, "hide-endtags", BL, no, ParseBool, boolPicks }, { TidyXmlTags, MU, "input-xml", BL, no, ParseBool, boolPicks }, { TidyXmlOut, MU, "output-xml", BL, no, ParseBool, boolPicks }, @@ -217,14 +238,12 @@ static TidyOptionImpl option_defs[] = { TidyReplaceColor, MU, "replace-color", BL, no, ParseBool, boolPicks }, { TidyCSSPrefix, MU, "css-prefix", ST, null, ParseCSS1Selector, null }, - { TidyInlineTags, MU, "new-inline-tags", ST, null, ParseTagNames, boolPicks }, - { TidyBlockTags, MU, "new-blocklevel-tags", ST, null, ParseTagNames, boolPicks }, - { TidyEmptyTags, MU, "new-empty-tags", ST, null, ParseTagNames, boolPicks }, - { TidyPreTags, MU, "new-pre-tags", ST, null, ParseTagNames, boolPicks }, + { TidyInlineTags, MU, "new-inline-tags", ST, null, ParseTagNames, NULL }, + { TidyBlockTags, MU, "new-blocklevel-tags", ST, null, ParseTagNames, NULL }, + { TidyEmptyTags, MU, "new-empty-tags", ST, null, ParseTagNames, NULL }, + { TidyPreTags, MU, "new-pre-tags", ST, null, ParseTagNames, NULL }, -#if SUPPORT_ACCESSIBILITY_CHECKS - { TidyAccessibilityCheckLevel, DG, "accessibility-check", IN, 0, ParseInt, accessPicks }, -#endif + { TidyAccessibilityCheckLevel, DG, "accessibility-check", IN, 0, ParseAcc, accessPicks }, { N_TIDY_OPTIONS, null } }; @@ -234,7 +253,7 @@ static TidyOptionImpl option_defs[] = */ const TidyOptionImpl* lookupOption( ctmbstr s ) { - TidyOptionImpl* np = option_defs; + const TidyOptionImpl* np = option_defs; for ( /**/; np < option_defs + N_TIDY_OPTIONS; ++np ) { if ( tmbstrcasecmp(s, np->name) == 0 ) @@ -251,7 +270,7 @@ const TidyOptionImpl* getOption( TidyOptionId optId ) } -static void FreeOptionValue( TidyOptionImpl* option, uint value ) +static void FreeOptionValue( const TidyOptionImpl* option, uint value ) { if ( value && option->type == TidyString && value != option->dflt ) { @@ -259,7 +278,8 @@ static void FreeOptionValue( TidyOptionImpl* option, uint value ) } } -static void CopyOptionValue( TidyOptionImpl* option, uint* oldval, uint newval ) +static void CopyOptionValue( const TidyOptionImpl* option, + uint* oldval, uint newval ) { assert( oldval != null ); FreeOptionValue( option, *oldval ); @@ -273,7 +293,7 @@ static void CopyOptionValue( TidyOptionImpl* option, uint* oldval, uint newval ) Bool SetOptionValue( TidyDocImpl* doc, TidyOptionId optId, ctmbstr val ) { - TidyOptionImpl* option = &option_defs[ optId ]; + const TidyOptionImpl* option = &option_defs[ optId ]; Bool ok = ( optId < N_TIDY_OPTIONS ); if ( ok ) { @@ -311,7 +331,7 @@ Bool ResetOptionToDefault( TidyDocImpl* doc, TidyOptionId optId ) Bool ok = ( optId > 0 && optId < N_TIDY_OPTIONS ); if ( ok ) { - TidyOptionImpl* option = option_defs + optId; + const TidyOptionImpl* option = option_defs + optId; uint* value = &doc->config.value[ optId ]; assert( optId == option->id ); CopyOptionValue( option, value, option->dflt ); @@ -319,22 +339,46 @@ Bool ResetOptionToDefault( TidyDocImpl* doc, TidyOptionId optId ) return ok; } +static void ReparseTagType( TidyDocImpl* doc, TidyOptionId optId ) +{ + ctmbstr tagdecl = cfgStr( doc, optId ); + tmbstr dupdecl = tmbstrdup( tagdecl ); + ParseConfigValue( doc, optId, dupdecl ); + MemFree( dupdecl ); +} + +/* Not efficient, but effective */ +static void ReparseTagDecls( TidyDocImpl* doc ) +{ + ctmbstr tagdecl = null; + FreeDeclaredTags( doc, 0 ); + if ( cfg(doc, TidyInlineTags) ) + ReparseTagType( doc, TidyInlineTags ); + if ( cfg(doc, TidyBlockTags) ) + ReparseTagType( doc, TidyBlockTags ); + if ( cfg(doc, TidyEmptyTags) ) + ReparseTagType( doc, TidyEmptyTags ); + if ( cfg(doc, TidyPreTags) ) + ReparseTagType( doc, TidyPreTags ); +} + void ResetConfigToDefault( TidyDocImpl* doc ) { uint ixVal; - TidyOptionImpl* option = option_defs; + const TidyOptionImpl* option = option_defs; uint* value = &doc->config.value[ 0 ]; for ( ixVal=0; ixVal < N_TIDY_OPTIONS; ++option, ++ixVal ) { assert( ixVal == (uint) option->id ); CopyOptionValue( option, &value[ixVal], option->dflt ); } + FreeDeclaredTags( doc, 0 ); } void TakeConfigSnapshot( TidyDocImpl* doc ) { uint ixVal; - TidyOptionImpl* option = option_defs; + const TidyOptionImpl* option = option_defs; uint* value = &doc->config.value[ 0 ]; uint* snap = &doc->config.snapshot[ 0 ]; @@ -349,7 +393,7 @@ void TakeConfigSnapshot( TidyDocImpl* doc ) void ResetConfigToSnapshot( TidyDocImpl* doc ) { uint ixVal; - TidyOptionImpl* option = option_defs; + const TidyOptionImpl* option = option_defs; uint* value = &doc->config.value[ 0 ]; uint* snap = &doc->config.snapshot[ 0 ]; @@ -358,6 +402,8 @@ void ResetConfigToSnapshot( TidyDocImpl* doc ) assert( ixVal == (uint) option->id ); CopyOptionValue( option, &value[ixVal], snap[ixVal] ); } + FreeDeclaredTags( doc, 0 ); + ReparseTagDecls( doc ); } void CopyConfig( TidyDocImpl* docTo, TidyDocImpl* docFrom ) @@ -365,7 +411,7 @@ void CopyConfig( TidyDocImpl* docTo, TidyDocImpl* docFrom ) if ( docTo != docFrom ) { uint ixVal; - TidyOptionImpl* option = option_defs; + const TidyOptionImpl* option = option_defs; uint* from = &docFrom->config.value[ 0 ]; uint* to = &docTo->config.value[ 0 ]; @@ -375,6 +421,7 @@ void CopyConfig( TidyDocImpl* docTo, TidyDocImpl* docFrom ) assert( ixVal == (uint) option->id ); CopyOptionValue( option, &to[ixVal], from[ixVal] ); } + ReparseTagDecls( docTo ); AdjustConfig( docTo ); /* Make sure it's consistent */ } } @@ -392,7 +439,7 @@ uint _cfgGet( TidyDocImpl* doc, TidyOptionId optId ) Bool _cfgGetBool( TidyDocImpl* doc, TidyOptionId optId ) { uint val = _cfgGet( doc, optId ); - TidyOptionImpl* opt = &option_defs[ optId ]; + const TidyOptionImpl* opt = &option_defs[ optId ]; assert( opt && opt->type == TidyBoolean ); return (Bool) val; } @@ -400,7 +447,7 @@ Bool _cfgGetBool( TidyDocImpl* doc, TidyOptionId optId ) ctmbstr _cfgGetString( TidyDocImpl* doc, TidyOptionId optId ) { uint val = _cfgGet( doc, optId ); - TidyOptionImpl* opt = &option_defs[ optId ]; + const TidyOptionImpl* opt = &option_defs[ optId ]; assert( opt && opt->type == TidyString ); return (ctmbstr) val; } @@ -483,7 +530,7 @@ static uint NextProperty( TidyConfigImpl* config ) ~/foo or ~your/foo according to $HOME and your user name. This will only work on Unix systems. */ -tmbstr ExpandTilde(ctmbstr filename) +ctmbstr ExpandTilde(ctmbstr filename) { #ifdef SUPPORT_GETPWNAM static char *expanded_filename; @@ -536,7 +583,7 @@ tmbstr ExpandTilde(ctmbstr filename) } #endif /* SUPPORT_GETPWNAM */ - return (tmbstr) filename; + return (ctmbstr) filename; } #ifndef TIDY_MAX_NAME @@ -588,7 +635,50 @@ int ParseConfigFileEnc( TidyDocImpl* doc, ctmbstr file, ctmbstr charenc ) if ( option ) option->parser( doc, option ); else - ReportUnknownOption( doc, name ); + { + if (null != doc->pOptCallback) + { + TidyConfigImpl* cfg = &doc->config; + tmbchar buf[8192]; + int i = 0; + tchar delim = 0; + Bool waswhite = yes; + + tchar c = SkipWhite( cfg ); + + if ( c == '"' || c == '\'' ) + { + delim = c; + c = AdvanceChar( cfg ); + } + + while ( i < sizeof(buf)-2 && c != EOF && c != '\r' && c != '\n' ) + { + if ( delim && c == delim ) + break; + + if ( IsWhite(c) ) + { + if ( waswhite ) + { + c = AdvanceChar( cfg ); + continue; + } + c = ' '; + } + else + waswhite = no; + + buf[i++] = (tmbchar) c; + c = AdvanceChar( cfg ); + } + buf[i] = '\0'; + if (no == (*doc->pOptCallback)( name, buf )) + ReportUnknownOption( doc, name ); + } + else + ReportUnknownOption( doc, name ); + } } } @@ -614,7 +704,14 @@ Bool ParseConfigOption( TidyDocImpl* doc, ctmbstr optnam, ctmbstr optval ) const TidyOptionImpl* option = lookupOption( optnam ); Bool ok = ( option != NULL ); if ( !ok ) - ReportUnknownOption( doc, optnam ); + { + /* Not a standard tidy option. Check to see if the user application + recognizes it */ + if (null != doc->pOptCallback) + ok = (*doc->pOptCallback)( optnam, optval ); + if (!ok) + ReportUnknownOption( doc, optnam ); + } else ok = ParseConfigValue( doc, option->id, optval ); return ok; @@ -625,7 +722,7 @@ Bool ParseConfigOption( TidyDocImpl* doc, ctmbstr optnam, ctmbstr optval ) */ Bool ParseConfigValue( TidyDocImpl* doc, TidyOptionId optId, ctmbstr optval ) { - TidyOptionImpl* option = option_defs + optId; + const TidyOptionImpl* option = option_defs + optId; Bool ok = ( optId < N_TIDY_OPTIONS && optval != null ); if ( !ok ) @@ -665,11 +762,21 @@ Bool AdjustCharEncoding( TidyDocImpl* doc, int encoding ) outenc = ASCII; break; + case IBM858: + inenc = IBM858; + outenc = ASCII; + break; + case ASCII: inenc = LATIN1; outenc = ASCII; break; + case LATIN0: + inenc = LATIN0; + outenc = ASCII; + break; + case RAW: case LATIN1: case UTF8: @@ -812,6 +919,36 @@ Bool ParseTriState( TidyTriState theState, TidyDocImpl* doc, return yes; } +/* cr, lf or crlf */ +Bool ParseNewline( TidyDocImpl* doc, const TidyOptionImpl* entry ) +{ + int nl = -1; + tmbchar work[ 16 ] = {0}; + tmbstr cp = work, end = work + sizeof(work); + TidyConfigImpl* cfg = &doc->config; + tchar c = SkipWhite( cfg ); + + while ( c!=EndOfStream && cp < end && !IsWhite(c) && c != '\r' && c != '\n' ) + { + *cp++ = (tmbchar) c; + c = AdvanceChar( cfg ); + } + *cp = 0; + + if ( tmbstrcasecmp(work, "lf") == 0 ) + nl = TidyLF; + else if ( tmbstrcasecmp(work, "crlf") == 0 ) + nl = TidyCRLF; + else if ( tmbstrcasecmp(work, "cr") == 0 ) + nl = TidyCR; + + if ( nl < TidyLF || nl > TidyCR ) + ReportBadArgument( doc, entry->name ); + else + SetOptionInt( doc, entry->id, nl ); + return ( nl >= TidyLF && nl <= TidyCR ); +} + Bool ParseBool( TidyDocImpl* doc, const TidyOptionImpl* entry ) { uint flag = 0; @@ -869,6 +1006,23 @@ Bool ParseCSS1Selector( TidyDocImpl* doc, const TidyOptionImpl* option ) return yes; } +/* Coordinates Config update and Tags data */ +static void DeclareUserTag( TidyDocImpl* doc, TidyOptionId optId, int tagType, tmbstr name ) +{ + ctmbstr prvval = cfgStr( doc, optId ); + tmbstr catval = name; + if ( prvval ) + { + uint len = tmbstrlen(name) + tmbstrlen(prvval) + 3; + catval = tmbstrndup( prvval, len ); + tmbstrcat( catval, ", " ); + tmbstrcat( catval, name ); + } + DefineTag( doc, tagType, name ); + SetOptionValue( doc, optId, catval ); + if ( prvval ) + MemFree( catval ); +} /* a space or comma separated list of tag names */ Bool ParseTagNames( TidyDocImpl* doc, const TidyOptionImpl* option ) @@ -890,6 +1044,8 @@ Bool ParseTagNames( TidyDocImpl* doc, const TidyOptionImpl* option ) return no; } + SetOptionValue( doc, option->id, null ); + FreeDeclaredTags( doc, ttyp ); cfg->defined_tags |= ttyp; do @@ -900,23 +1056,36 @@ Bool ParseTagNames( TidyDocImpl* doc, const TidyOptionImpl* option ) continue; } - if (c == '\r') + if ( c == '\r' || c == '\n' ) { - c = AdvanceChar( cfg ); - - if ( c == '\n' ) - AdvanceChar( cfg ); + uint c2 = AdvanceChar( cfg ); + if ( c == '\r' && c2 == '\n' ) + c = AdvanceChar( cfg ); + else + c = c2; if ( !IsWhite(c) ) + { + buf[i] = 0; + UngetChar( c, cfg->cfgIn ); + UngetChar( '\n', cfg->cfgIn ); break; + } } + /* if ( c == '\n' ) { c = AdvanceChar( cfg ); if ( !IsWhite(c) ) + { + buf[i] = 0; + UngetChar( c, cfg->cfgIn ); + UngetChar( '\n', cfg->cfgIn ); break; + } } + */ while ( i < sizeof(buf)-2 && c != EOF && !IsWhite(c) && c != ',' ) { @@ -929,12 +1098,14 @@ Bool ParseTagNames( TidyDocImpl* doc, const TidyOptionImpl* option ) continue; /* there is a trailing space on the line. */ /* add tag to dictionary */ - DefineTag( doc, ttyp, buf ); + DeclareUserTag( doc, option->id, ttyp, buf ); i = 0; ++nTags; } while ( c != EOF ); + if ( i > 0 ) + DeclareUserTag( doc, option->id, ttyp, buf ); return ( nTags > 0 ); } @@ -1002,6 +1173,8 @@ Bool ParseCharEnc( TidyDocImpl* doc, const TidyOptionImpl* option ) validEncoding = no; ReportBadArgument( doc, option->name ); } + else + SetOptionInt( doc, option->id, enc ); if ( validEncoding && option->id == TidyCharEncoding ) AdjustCharEncoding( doc, enc ); @@ -1014,6 +1187,8 @@ int CharEncodingId( ctmbstr charenc ) int enc = -1; if ( tmbstrcasecmp(charenc, "ascii") == 0 ) enc = ASCII; + else if ( tmbstrcasecmp(charenc, "latin0") == 0 ) + enc = LATIN0; else if ( tmbstrcasecmp(charenc, "latin1") == 0 ) enc = LATIN1; else if ( tmbstrcasecmp(charenc, "raw") == 0 ) @@ -1026,6 +1201,8 @@ int CharEncodingId( ctmbstr charenc ) enc = MACROMAN; else if ( tmbstrcasecmp(charenc, "win1252") == 0 ) enc = WIN1252; + else if ( tmbstrcasecmp(charenc, "ibm858") == 0 ) + enc = IBM858; #if SUPPORT_UTF16_ENCODINGS else if ( tmbstrcasecmp(charenc, "utf16le") == 0 ) @@ -1053,12 +1230,14 @@ ctmbstr CharEncodingName( int encoding ) switch ( encoding ) { case ASCII: encodingName = "ascii"; break; + case LATIN0: encodingName = "latin0"; break; case LATIN1: encodingName = "latin1"; break; case RAW: encodingName = "raw"; break; case UTF8: encodingName = "utf8"; break; case ISO2022: encodingName = "iso2022"; break; case MACROMAN: encodingName = "mac"; break; case WIN1252: encodingName = "win1252"; break; + case IBM858: encodingName = "ibm858"; break; #if SUPPORT_UTF16_ENCODINGS case UTF16LE: encodingName = "utf16le"; break; @@ -1169,6 +1348,7 @@ Bool ParseRepeatAttr( TidyDocImpl* doc, const TidyOptionImpl* option ) return ok; } +#if SUPPORT_UTF16_ENCODINGS Bool ParseBOM( TidyDocImpl* doc, const TidyOptionImpl* option ) { uint flag = 0; @@ -1179,6 +1359,7 @@ Bool ParseBOM( TidyDocImpl* doc, const TidyOptionImpl* option ) } return ok; } +#endif /* Use TidyOptionId as iterator. ** Send index of 1st option after TidyOptionUnknown as start of list. @@ -1196,7 +1377,7 @@ const TidyOptionImpl* getNextOption( TidyDocImpl* doc, TidyIterator* iter ) const TidyOptionImpl* option = null; TidyOptionId optId; assert( iter != null ); - optId = (TidyOptionId) *iter; + optId = *(TidyOptionId *) iter; if ( optId > TidyUnknownOption && optId < N_TIDY_OPTIONS ) { option = &option_defs[ optId ]; @@ -1230,7 +1411,8 @@ ctmbstr getNextOptionPick( const TidyOptionImpl* option, return val; } -static int WriteOptionString( TidyOptionImpl* option, ctmbstr sval, StreamOut* out ) +static int WriteOptionString( const TidyOptionImpl* option, + ctmbstr sval, StreamOut* out ) { ctmbstr cp = option->name; while ( *cp ) @@ -1244,23 +1426,23 @@ static int WriteOptionString( TidyOptionImpl* option, ctmbstr sval, StreamOut* return 0; } -static int WriteOptionInt( TidyOptionImpl* option, uint ival, StreamOut* out ) +static int WriteOptionInt( const TidyOptionImpl* option, uint ival, StreamOut* out ) { tmbchar sval[ 32 ] = {0}; sprintf( sval, "%d", ival ); return WriteOptionString( option, sval, out ); } -static int WriteOptionBool( TidyOptionImpl* option, Bool bval, StreamOut* out ) +static int WriteOptionBool( const TidyOptionImpl* option, Bool bval, StreamOut* out ) { ctmbstr sval = bval ? "yes" : "no"; return WriteOptionString( option, sval, out ); } -static int WriteOptionPick( TidyOptionImpl* option, uint ival, StreamOut* out ) +static int WriteOptionPick( const TidyOptionImpl* option, uint ival, StreamOut* out ) { uint ix; - ctmbstr* val = option->pickList; + const ctmbstr* val = option->pickList; for ( ix=0; val[ix] && ixconfig.value; for ( /**/; !diff && option && option->name; ++option, ++ival ) { @@ -1291,20 +1473,35 @@ Bool ConfigDiffThanDefault( TidyDocImpl* doc ) int SaveConfigToStream( TidyDocImpl* doc, StreamOut* out ) { int rc = 0; - TidyOptionImpl* option; + const TidyOptionImpl* option; for ( option=option_defs+1; 0==rc && option && option->name; ++option ) { uint ival = doc->config.value[ option->id ]; if ( option->parser == null ) continue; - if ( ival == option->dflt ) + if ( ival == option->dflt && option->id != TidyDoctype) continue; if ( option->id == TidyDoctype ) /* Special case */ { uint dtmode = cfg( doc, TidyDoctypeMode ); if ( dtmode == TidyDoctypeUser ) - rc = WriteOptionString( option, (ctmbstr)ival, out ); + { + tmbstr t; + + if (( t = MemAlloc( tmbstrlen( (ctmbstr)ival) + 2 ) )) /* add 2 double quotes */ + { + t[0] = '\"'; t[1] = 0; + + tmbstrcat( t, (ctmbstr)ival ); + tmbstrcat( t, "\"" ); + rc = WriteOptionString( option, (ctmbstr)t, out ); + + MemFree( t ); + } + } + else if ( dtmode == option_defs[TidyDoctypeMode].dflt ) + continue; else rc = WriteOptionPick( option, dtmode, out ); } @@ -1334,10 +1531,11 @@ int SaveConfigFile( TidyDocImpl* doc, ctmbstr cfgfil ) int status = -1; StreamOut* out = null; uint outenc = cfg( doc, TidyOutCharEncoding ); - FILE* fout = fopen( cfgfil, "w" ); + uint nl = cfg( doc, TidyNewline ); + FILE* fout = fopen( cfgfil, "wb" ); if ( fout ) { - out = FileOutput( fout, outenc ); + out = FileOutput( fout, outenc, nl ); status = SaveConfigToStream( doc, out ); fclose( fout ); MemFree( out ); @@ -1348,7 +1546,8 @@ int SaveConfigFile( TidyDocImpl* doc, ctmbstr cfgfil ) int SaveConfigSink( TidyDocImpl* doc, TidyOutputSink* sink ) { uint outenc = cfg( doc, TidyOutCharEncoding ); - StreamOut* out = UserOutput( sink, outenc ); + uint nl = cfg( doc, TidyNewline ); + StreamOut* out = UserOutput( sink, outenc, nl ); int status = SaveConfigToStream( doc, out ); MemFree( out ); return status; diff --git a/tidylib-src/src/config.h b/tidylib-src/src/config.h old mode 100755 new mode 100644 index 7ea8461b..536a28b6 --- a/tidylib-src/src/config.h +++ b/tidylib-src/src/config.h @@ -9,8 +9,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/08/08 21:40:36 $ - $Revision: 1.1.2.4 $ + $Date: 2003/02/16 19:33:10 $ + $Revision: 1.2 $ config files associate a property name with a value. @@ -44,7 +44,7 @@ struct _tidy_option TidyOptionType type; /* string, int or bool */ uint dflt; /* factory default */ ParseProperty* parser; /* parsing method, read-only if null */ - ctmbstr* pickList; /* pick list */ + const ctmbstr* pickList; /* pick list */ }; @@ -163,10 +163,11 @@ ParseProperty ParseString; /* a space or comma separated list of tag names */ ParseProperty ParseTagNames; -/* RAW, ASCII, LATIN1, UTF8, ISO2022, MACROMAN, - UTF16LE, UTF16BE, UTF16, WIN1252, BIG5, SHIFTJIS +/* RAW, ASCII, LATIN0, LATIN1, UTF8, ISO2022, MACROMAN, + WIN1252, IBM858, UTF16LE, UTF16BE, UTF16, BIG5, SHIFTJIS */ ParseProperty ParseCharEnc; +ParseProperty ParseNewline; /* specific to the indent option - Bool and 'auto' */ ParseProperty ParseIndent; diff --git a/tidylib-src/src/entities.c b/tidylib-src/src/entities.c old mode 100755 new mode 100644 index 6cebf2c0..675caf98 --- a/tidylib-src/src/entities.c +++ b/tidylib-src/src/entities.c @@ -5,9 +5,9 @@ CVS Info : - $Author: terry_teague $ - $Date: 2002/07/08 07:41:58 $ - $Revision: 1.7.2.2 $ + $Author: creitzel $ + $Date: 2003/02/16 19:33:10 $ + $Revision: 1.8 $ Entity handling can be static because there are no config or document-specific values. Lookup table is 100% defined at @@ -30,13 +30,10 @@ struct _entity ctmbstr name; uint versions; uint code; -#if 0 - entity* next; -#endif }; -static entity entities[] = +static const entity entities[] = { /* ** Markup pre-defined character entities @@ -309,82 +306,6 @@ static entity entities[] = { null, 0, 0 } }; -#if 0 -static entity* hashtab[ ENTITY_HASHSIZE ] = {0}; - -static unsigned hash( ctmbstr s ) -{ - uint hashval; - for (hashval = 0; *s != '\0'; s++) - hashval = *s + 31*hashval; - return hashval % ENTITY_HASHSIZE; -} - -/* Don't dupe strings. Only literal constants are used. -*/ -static entity* install( ctmbstr name, uint code, uint versions ) -{ - entity *np = lookup( name ); - - if ( name == null ) - return null; - - if ( np == null ) - { - uint hashval; - np = (entity*) MemAlloc( sizeof(*np) ); - if ( np == null ) - return null; - - hashval = hash(name); - np->next = hashtab[hashval]; - np->name = name; - hashtab[hashval] = np; - } - - np->code = code; - np->versions = versions; - return np; -} - -static entity* lookup( ctmbstr s ) -{ - entity *np; - for ( np = hashtab[hash(s)]; np != null; np = np->next ) - if ( tmbstrcmp(s, np->name) == 0 ) - return np; - return null; -} - -void InitEntities() -{ - entity *ep; - for ( ep = entities; ep->name != null; ++ep ) - install( ep->name, ep->code, ep->versions ); -} - - -void FreeEntities() -{ - entity* prev, *next; - int i; - - for (i = 0; i < ENTITY_HASHSIZE; ++i) - { - prev = null; - next = hashtab[i]; - - while(next) - { - prev = next->next; - MemFree(next); - next = prev; - } - - hashtab[i] = null; - } -} -#else /* Pure static implementation. Trades off lookup speed ** for faster setup time (well, none actually). @@ -392,10 +313,10 @@ void FreeEntities() ** speed that hash doesn't improve things without > 500 ** items in list. */ -static entity* lookup( ctmbstr s ) +static const entity* lookup( ctmbstr s ) { tmbchar ch = (tmbchar)( s ? *s : 0 ); - entity *np; + const entity *np; for ( np = entities; ch && np && np->name; ++np ) if ( ch == *np->name && tmbstrcmp(s, np->name) == 0 ) return np; @@ -409,19 +330,18 @@ void InitEntities() void FreeEntities() { } -#endif /* entity starting with "&" returns zero on error */ uint EntityCode( ctmbstr name, uint versions ) { - entity* np; + const entity* np; assert( name && name[0] == '&' ); /* numeric entitity: name = "&#" followed by number */ if ( name[1] == '#' ) { uint c = 0; /* zero on missing/bad number */ - Bool isXml = ( versions & VERS_XML == VERS_XML ); + Bool isXml = ( (versions & VERS_XML) == VERS_XML ); /* 'x' prefix denotes hexadecimal number format */ if ( name[2] == 'x' || (!isXml && name[2] == 'X') ) @@ -435,13 +355,6 @@ uint EntityCode( ctmbstr name, uint versions ) /* Named entity: name ="&" followed by a name */ if ( np = lookup(name+1) ) { -#if 0 - /* if input is treated as XML (-xml) only accept general entities */ - /* i.e. only amp, gt, lt, quot, apos */ - if ( isXml && !(np->code == 34 || np->code == 38 || np->code == 39 || - np->code == 60 || np->code == 62)) - return 0; -#endif /* Only recognize entity name if version supports it. */ if ( np->versions & versions ) return np->code; @@ -454,7 +367,7 @@ uint EntityCode( ctmbstr name, uint versions ) ctmbstr EntityName( uint ch, uint versions ) { ctmbstr entnam = null; - entity *ep; + const entity *ep; for ( ep = entities; ep->name != null; ++ep ) { diff --git a/tidylib-src/src/entities.h b/tidylib-src/src/entities.h old mode 100755 new mode 100644 index 7287e859..901f31ba --- a/tidylib-src/src/entities.h +++ b/tidylib-src/src/entities.h @@ -8,9 +8,9 @@ CVS Info : - $Author: terry_teague $ - $Date: 2002/07/08 07:42:13 $ - $Revision: 1.1.2.2 $ + $Author: creitzel $ + $Date: 2003/02/16 19:33:10 $ + $Revision: 1.2 $ */ diff --git a/tidylib-src/src/fileio.c b/tidylib-src/src/fileio.c old mode 100755 new mode 100644 index e564ef39..c31309e9 --- a/tidylib-src/src/fileio.c +++ b/tidylib-src/src/fileio.c @@ -6,8 +6,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/07/28 18:10:15 $ - $Revision: 1.1.2.3 $ + $Date: 2003/02/16 19:33:10 $ + $Revision: 1.2 $ Default implementations of Tidy input sources and output sinks based on standard C FILE*. @@ -33,14 +33,14 @@ int filesrc_getByte( uint sourceData ) if ( fin->unget.size > 0 ) bv = tidyBufPopByte( &fin->unget ); else - bv = getc( fin->fp ); + bv = fgetc( fin->fp ); return bv; } Bool filesrc_eof( uint sourceData ) { FileSource* fin = (FileSource*) sourceData; - Bool isEOF = ( fin->unget.size > 0 ); - if ( !isEOF ) + Bool isEOF = ( fin->unget.size == 0 ); + if ( isEOF ) isEOF = feof( fin->fp ); return isEOF; } @@ -76,7 +76,7 @@ void freeFileSource( TidyInputSource* inp, Bool closeIt ) void filesink_putByte( uint sinkData, byte bv ) { FILE* fout = (FILE*) sinkData; - putc( bv, fout ); + fputc( bv, fout ); } void initFileSink( TidyOutputSink* outp, FILE* fp ) diff --git a/tidylib-src/src/forward.h b/tidylib-src/src/forward.h old mode 100755 new mode 100644 index 58ee2424..72aa3bae --- a/tidylib-src/src/forward.h +++ b/tidylib-src/src/forward.h @@ -8,9 +8,9 @@ CVS Info : - $Author: terry_teague $ - $Date: 2002/07/08 07:42:40 $ - $Revision: 1.1.2.5 $ + $Author: creitzel $ + $Date: 2003/02/16 19:33:10 $ + $Revision: 1.2 $ Avoids many include file circular dependencies. diff --git a/tidylib-src/src/istack.c b/tidylib-src/src/istack.c old mode 100755 new mode 100644 index cdb57d0b..f17f5a92 --- a/tidylib-src/src/istack.c +++ b/tidylib-src/src/istack.c @@ -5,9 +5,9 @@ CVS Info : - $Author: terry_teague $ - $Date: 2002/07/14 01:10:55 $ - $Revision: 1.7.2.4 $ + $Author: creitzel $ + $Date: 2003/02/16 19:33:10 $ + $Revision: 1.8 $ */ diff --git a/tidylib-src/src/lexer.c b/tidylib-src/src/lexer.c old mode 100755 new mode 100644 index 41c7febf..a441a966 --- a/tidylib-src/src/lexer.c +++ b/tidylib-src/src/lexer.c @@ -1,13 +1,13 @@ /* lexer.c -- Lexer for html parser - (c) 1998-2002 (W3C) MIT, INRIA, Keio University + (c) 1998-2003 (W3C) MIT, INRIA, Keio University See tidy.h for the copyright notice. CVS Info : $Author: creitzel $ - $Date: 2002/11/02 20:15:32 $ - $Revision: 1.72.2.9 $ + $Date: 2003/02/20 16:39:47 $ + $Revision: 1.76 $ */ @@ -45,8 +45,6 @@ #include "clean.h" #include "utf8.h" -extern tmbstr release_date; - /* Forward references */ @@ -87,7 +85,7 @@ struct _vers ctmbstr profile; uint code; } -W3C_Version[] = +const W3C_Version[] = { {"HTML 4.01", "XHTML 1.0 Strict", voyager_strict, VERS_HTML40_STRICT}, {"HTML 4.01 Transitional", "XHTML 1.0 Transitional", voyager_loose, VERS_HTML40_LOOSE}, @@ -580,7 +578,8 @@ Lexer* NewLexer() Bool EndOfInput( TidyDocImpl* doc ) { - return doc->docIn->source.eof( doc->docIn->source.sourceData ); + assert( doc->docIn != null ); + return ( !doc->docIn->pushed && IsEOF(doc->docIn) ); } void FreeLexer( TidyDocImpl* doc ) @@ -601,6 +600,9 @@ void FreeLexer( TidyDocImpl* doc ) FreeNode( doc, doc->root ); doc->root = null; + + FreeNode( doc, doc->givenDoctype ); + doc->givenDoctype = null; } /* Lexer uses bigger memory chunks than pprint as @@ -1257,9 +1259,9 @@ Bool AddGenerator( TidyDocImpl* doc ) { #ifdef PLATFORM_NAME sprintf( buf, "HTML Tidy for "PLATFORM_NAME" (vers %s), see www.w3.org", - release_date ); + tidyReleaseDate() ); #else - sprintf( buf, "HTML Tidy (vers %s), see www.w3.org", release_date ); + sprintf( buf, "HTML Tidy (vers %s), see www.w3.org", tidyReleaseDate() ); #endif for ( node = head->content; node; node = node->next ) @@ -1349,11 +1351,15 @@ int FindGivenVersion( TidyDocImpl* doc, Node* doctype ) /**/; len = j - i - 13; - for (j = 1; j < W3C_VERSIONS; ++j) + for (j = 0; j < W3C_VERSIONS; ++j) { nm = W3C_Version[j].name; if ( len == tmbstrlen(nm) && tmbstrncmp(p, nm, len) == 0 ) return W3C_Version[j].code; + + nm = W3C_Version[j].voyager_name; + if ( len == tmbstrlen(nm) && tmbstrncmp(p, nm, len) == 0 ) + return W3C_Version[j].code; } /* else unrecognized version */ @@ -1416,20 +1422,26 @@ Bool CheckDocTypeKeyWords(Lexer *lexer, Node *doctype) ctmbstr HTMLVersionName( TidyDocImpl* doc ) { - uint j, guessed = ApparentVersion( doc ); + uint vers = ApparentVersion( doc ); + return HTMLVersionNameFromCode( vers, doc->lexer->isvoyager ); +} - for ( j = 0; j < W3C_VERSIONS; ++j ) +ctmbstr HTMLVersionNameFromCode( uint vers, Bool isXhtml ) +{ + int ix; + for ( ix=0; ix < W3C_VERSIONS; ++ix ) + { + if ( vers == W3C_Version[ix].code ) { - if ( guessed == W3C_Version[j].code ) - { - if ( doc->lexer->isvoyager ) - return W3C_Version[j].voyager_name; - return W3C_Version[j].name; - } + if ( isXhtml ) + return W3C_Version[ix].voyager_name; + return W3C_Version[ix].name; } - return null; + } + return "HTML Proprietary"; } + static void FixHTMLNameSpace( TidyDocImpl* doc, ctmbstr profile ) { Node* node = FindHTML( doc ); @@ -1465,7 +1477,8 @@ static void FixHTMLNameSpace( TidyDocImpl* doc, ctmbstr profile ) ** etc. that may precede the tag. */ -static Node* NewXhtmlDocTypeNode( TidyDocImpl* doc ) + +static Node* NewDocTypeNode( TidyDocImpl* doc ) { Node* doctype = null; Node* html = FindHTML( doc ); @@ -1580,7 +1593,7 @@ Bool SetXHTMLDocType( TidyDocImpl* doc ) } else { - if ( !(doctype = NewXhtmlDocTypeNode( doc )) ) + if ( !(doctype = NewDocTypeNode( doc )) ) return no; } @@ -1747,8 +1760,9 @@ Bool FixDocType( TidyDocImpl* doc ) return no; /* for XML use the Voyager system identifier */ - if ( cfgBool(doc, TidyXmlOut) || cfgBool(doc, TidyXmlTags) || - lexer->isvoyager ) + if ( !cfgBool(doc, TidyHtmlOut) && + ( cfgBool(doc, TidyXmlOut) || cfgBool(doc, TidyXmlTags) || + lexer->isvoyager ) ) { if ( doctype ) DiscardElement( doc, doctype ); @@ -1758,7 +1772,7 @@ Bool FixDocType( TidyDocImpl* doc ) if ( !doctype ) { - if ( !(doctype = NewXhtmlDocTypeNode( doc )) ) + if ( !(doctype = NewDocTypeNode( doc )) ) return no; } @@ -3207,7 +3221,7 @@ static int ParseServerInstruction( TidyDocImpl* doc ) /* values start with "=" or " = " etc. */ /* doesn't consume the ">" at end of start tag */ -tmbstr ParseValue( TidyDocImpl* doc, ctmbstr name, +static tmbstr ParseValue( TidyDocImpl* doc, ctmbstr name, Bool foldCase, Bool *isempty, int *pdelim) { Lexer* lexer = doc->lexer; @@ -3602,13 +3616,19 @@ AttVal* ParseAttrs( TidyDocImpl* doc, Bool *isempty ) ReportAttrError(lexer, lexer->token, av, MISSING_ATTR_VALUE); else ReportAttrError(lexer, lexer->token, av, BAD_ATTRIBUTE_VALUE); - */ if (value != null) ReportAttrError( doc, lexer->token, av, BAD_ATTRIBUTE_VALUE); else if (LastChar(attribute) == '"') ReportAttrError( doc, lexer->token, av, MISSING_QUOTEMARK); else ReportAttrError( doc, lexer->token, av, UNKNOWN_ATTRIBUTE); + */ + if (LastChar(attribute) == '"') + ReportAttrError( doc, lexer->token, av, MISSING_QUOTEMARK); + else if (value == null) + ReportAttrError(doc, lexer->token, av, MISSING_ATTR_VALUE); + else + ReportAttrError(doc, lexer->token, av, INVALID_ATTRIBUTE); FreeAttribute(av); } diff --git a/tidylib-src/src/lexer.h b/tidylib-src/src/lexer.h old mode 100755 new mode 100644 index 28d3214c..fd466cf2 --- a/tidylib-src/src/lexer.h +++ b/tidylib-src/src/lexer.h @@ -8,8 +8,8 @@ CVS Info: $Author: creitzel $ - $Date: 2002/08/11 16:41:40 $ - $Revision: 1.1.2.5 $ + $Date: 2003/02/16 19:33:10 $ + $Revision: 1.2 $ */ @@ -200,13 +200,13 @@ struct _StyleProp struct _AttVal { - AttVal* next; - Attribute* dict; - Node* asp; - Node* php; - int delim; - tmbstr attribute; - tmbstr value; + AttVal* next; + const Attribute* dict; + Node* asp; + Node* php; + int delim; + tmbstr attribute; + tmbstr value; }; @@ -229,7 +229,7 @@ struct _AttVal struct _IStack { IStack* next; - Dict* tag; /* tag's dictionary definition */ + const Dict* tag; /* tag's dictionary definition */ tmbstr element; /* name (null for text nodes) */ AttVal* attributes; }; @@ -248,8 +248,8 @@ struct _Node Node* last; AttVal* attributes; - Dict* was; /* old tag when it was changed */ - Dict* tag; /* tag's dictionary definition */ + const Dict* was; /* old tag when it was changed */ + const Dict* tag; /* tag's dictionary definition */ tmbstr element; /* name (null for text nodes) */ @@ -340,12 +340,6 @@ struct _Lexer */ Node *CommentToken( Lexer *lexer ); -/* used to classify ASCII characters for lexical purposes. -*/ -#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0) -extern uint lexmap[128]; - - #define XHTML_NAMESPACE "http://www.w3.org/1999/xhtml" @@ -462,6 +456,7 @@ int ApparentVersion( TidyDocImpl* doc ); Bool CheckDocTypeKeyWords(Lexer *lexer, Node *doctype); ctmbstr HTMLVersionName( TidyDocImpl* doc ); +ctmbstr HTMLVersionNameFromCode( uint vers, Bool isXhtml ); Bool SetXHTMLDocType( TidyDocImpl* doc ); diff --git a/tidylib-src/src/localize.c b/tidylib-src/src/localize.c old mode 100755 new mode 100644 index 35f47bc2..56957658 --- a/tidylib-src/src/localize.c +++ b/tidylib-src/src/localize.c @@ -1,6 +1,6 @@ /* localize.c -- text strings and routines to handle errors and general messages - (c) 1998-2002 (W3C) MIT, INRIA, Keio University + (c) 1998-2003 (W3C) MIT, INRIA, Keio University See tidy.h for the copyright notice. You should only need to edit this file and tidy.c @@ -9,8 +9,8 @@ CVS Info : $Author: terry_teague $ - $Date: 2002/11/04 08:45:00 $ - $Revision: 1.60.2.10 $ + $Date: 2003/03/02 04:30:09 $ + $Revision: 1.68 $ */ @@ -29,7 +29,7 @@ */ #define ATRC_ACCESS_URL "http://www.aprompt.ca/Tidy/accessibilitychecks.html" -char *release_date = "1st November 2002"; +const static char *release_date = "1st March 2003"; ctmbstr ReleaseDate() { @@ -111,7 +111,7 @@ static char* ReportPosition( TidyDocImpl* doc, int line, int col, char* buf ) /* Change formatting to be parsable by GNU Emacs */ if ( cfgBool(doc, TidyEmacs) && cfgStr(doc, TidyEmacsFile) ) - sprintf( buf, "%s:%d:%d:", + sprintf( buf, "%s:%d:%d: ", cfgStr(doc, TidyEmacsFile), line, col ); else /* traditional format */ sprintf( buf, "line %d column %d - ", line, col ); @@ -406,9 +406,9 @@ void ReportAttrError( TidyDocImpl* doc, Node *node, AttVal *av, uint code) "unknown attribute \"%s\"", name ); break; - case MISSING_ATTRIBUTE: + case INSERTING_ATTRIBUTE: messageNode( doc, TidyWarning, node, - "%s lacks \"%s\" attribute", tagdesc, name ); + "inserting \"%s\" attribute for %s element", name, tagdesc ); break; case MISSING_ATTR_VALUE: @@ -428,6 +428,11 @@ void ReportAttrError( TidyDocImpl* doc, Node *node, AttVal *av, uint code) tagdesc, name, value ); break; + case INVALID_ATTRIBUTE: + messageNode( doc, TidyWarning, node, + "%s attribute name \"%s\" (value=\"%s\") is invalid", + tagdesc, name, value ); + break; case XML_ID_SYNTAX: messageNode( doc, TidyWarning, node, "%s ID \"%s\" uses XML ID syntax", tagdesc, value ); @@ -537,13 +542,42 @@ void ReportAttrError( TidyDocImpl* doc, Node *node, AttVal *av, uint code) } } + +void ReportNonCompliantAttr( TidyDocImpl* doc, Node* node, AttVal* attr, uint versWanted ) +{ + ctmbstr attrnam = ( attr && attr->attribute ? attr->attribute : "Unknown" ); + ctmbstr htmlVer = HTMLVersionNameFromCode( versWanted, doc->lexer->isvoyager ); + messageNode( doc, TidyWarning, node, + "Attribute \"%s\" not supported in %s", attrnam, htmlVer ); +} + +void ReportNonCompliantNode( TidyDocImpl* doc, Node* node, uint code, uint versWanted ) +{ + char desc[ 256 ] = {0}; + ctmbstr htmlVer = HTMLVersionNameFromCode( versWanted, doc->lexer->isvoyager ); + TagToString( node, desc ); + + switch ( code ) + { + case MIXED_CONTENT_IN_BLOCK: + messageNode( doc, TidyWarning, node, + "Text node in %s in %s", desc, htmlVer ); + break; + + case OBSOLETE_ELEMENT: + messageNode( doc, TidyWarning, node, + "Element %s not supported in %s", desc, htmlVer ); + break; + } +} + void ReportMissingAttr( TidyDocImpl* doc, Node* node, ctmbstr name ) { /* ReportAttrError( doc, node, null, MISSING_ATTRIBUTE ); */ char tagdesc[ 64 ]; TagToString( node, tagdesc ); messageNode( doc, TidyWarning, node, - "%s attribute \"%s\" lacks value", tagdesc, name ); + "%s lacks \"%s\" attribute", tagdesc, name ); } void ReportWarning( TidyDocImpl* doc, Node *element, Node *node, uint code ) @@ -654,7 +688,7 @@ void ReportWarning( TidyDocImpl* doc, Node *element, Node *node, uint code ) TagToString( element, elemdesc ); messageNode( doc, TidyWarning, rpt, - "replacing %selement %s by %s", + "replacing %s element %s by %s", obsolete, elemdesc, nodedesc ); } break; @@ -748,6 +782,11 @@ void ReportWarning( TidyDocImpl* doc, Node *element, Node *node, uint code ) messageNode( doc, TidyWarning, element, "%s element not empty or not closed", elemdesc ); break; + + case ENCODING_IO_CONFLICT: + messageNode( doc, TidyWarning, node, + "Output encoding does not work with standard output" ); + break; } } @@ -776,7 +815,11 @@ void ReportError( TidyDocImpl* doc, Node *element, Node *node, uint code) if (element) messageNode( doc, TidyError, node, "unexpected in <%s>", node->element, element->element ); - else +#if defined(__arm) + if (!element) +#else + else +#endif messageNode( doc, TidyError, node, "unexpected ", node->element ); break; @@ -787,10 +830,15 @@ void ErrorSummary( TidyDocImpl* doc ) { /* adjust badAccess to that its null if frames are ok */ ctmbstr encnam = "specified"; - if ( doc->docIn->encoding == WIN1252 ) + int charenc = cfg( doc, TidyCharEncoding ); + if ( charenc == WIN1252 ) encnam = "Windows-1252"; - else if ( doc->docIn->encoding == MACROMAN ) + else if ( charenc == MACROMAN ) encnam = "MacRoman"; + else if ( charenc == IBM858 ) + encnam = "ibm858"; + else if ( charenc == LATIN0 ) + encnam = "latin0"; if ( doc->badAccess & (USING_FRAMES | USING_NOFRAMES) ) { @@ -1040,8 +1088,7 @@ void HelloMessage( TidyDocImpl* doc, ctmbstr date, ctmbstr filename ) void ReportMarkupVersion( TidyDocImpl* doc ) { - ctmbstr vers = HTMLVersionName( doc ); - Node* doctype = FindDocType( doc ); + Node* doctype = doc->givenDoctype; if ( doctype ) { @@ -1069,8 +1116,13 @@ void ReportMarkupVersion( TidyDocImpl* doc ) message( doc, TidyInfo, "Doctype given is \"%s\"", buf ); } - message( doc, TidyInfo, "Document content looks like %s", - (vers ? vers : "HTML proprietary") ); + if ( ! cfgBool(doc, TidyXmlTags) ) + { + uint apparentVers = HTMLVersion( doc ); + Bool isXhtml = doc->lexer->isvoyager; + ctmbstr vers = HTMLVersionNameFromCode( apparentVers, isXhtml ); + message( doc, TidyInfo, "Document content looks like %s", vers ); + } } void ReportNumWarnings( TidyDocImpl* doc ) @@ -1093,7 +1145,7 @@ void ReportNumWarnings( TidyDocImpl* doc ) void HelpText( TidyDocImpl* doc, ctmbstr prog ) { - tidy_out(doc, "%s [option...] [file...]\n", prog ); + tidy_out(doc, "%s [option...] [file...] [option...] [file...]\n", prog ); tidy_out(doc, "Utility to clean up and pretty print HTML/XHTML/XML\n"); tidy_out(doc, "see http://tidy.sourgeforge.net/\n"); tidy_out(doc, "\n"); @@ -1106,10 +1158,21 @@ void HelpText( TidyDocImpl* doc, ctmbstr prog ) #endif tidy_out(doc, "\n"); + tidy_out(doc, "File manipulation\n"); + tidy_out(doc, "-----------------\n"); + tidy_out(doc, " -o to write output markup to specified \n"); + tidy_out(doc, " -config to set configuration options from the specified \n"); + tidy_out(doc, " -f to write errors to the specified \n"); + tidy_out(doc, " -modify or -m to modify the original input files\n"); + tidy_out(doc, "\n"); + tidy_out(doc, "Processing directives\n"); tidy_out(doc, "---------------------\n"); + tidy_out(doc, " -asxhtml to convert HTML to well formed XHTML\n"); + tidy_out(doc, " -ashtml to force XHTML to (non-XML) HTML\n"); + tidy_out(doc, " -xml to specify the input is XML\n"); + tidy_out(doc, " -asxml to convert input to well formed XML\n"); tidy_out(doc, " -indent or -i to indent element content\n"); - tidy_out(doc, " -omit or -o to omit optional end tags\n"); tidy_out(doc, " -wrap to wrap text at the specified (default is 68)\n"); tidy_out(doc, " -upper or -u to force tags to upper case (default is lower case)\n"); tidy_out(doc, " -clean or -c to replace FONT, NOBR and CENTER tags by CSS\n"); @@ -1117,11 +1180,7 @@ void HelpText( TidyDocImpl* doc, ctmbstr prog ) tidy_out(doc, " -numeric or -n to output numeric rather than named entities\n"); tidy_out(doc, " -errors or -e to only show errors\n"); tidy_out(doc, " -quiet or -q to suppress nonessential output\n"); - tidy_out(doc, " -xml to specify the input is well formed XML\n"); - tidy_out(doc, " -asxml to convert HTML to well formed XHTML\n"); - tidy_out(doc, " -asxhtml to convert HTML to well formed XHTML\n"); - tidy_out(doc, " -ashtml to force XHTML to well formed HTML\n"); - tidy_out(doc, " -slides to burst into slides on H2 elements\n"); + tidy_out(doc, " -omit to omit optional end tags\n"); /* TRT */ #if SUPPORT_ACCESSIBILITY_CHECKS @@ -1134,10 +1193,13 @@ void HelpText( TidyDocImpl* doc, ctmbstr prog ) tidy_out(doc, "-------------------\n"); tidy_out(doc, " -raw to output values above 127 without conversion to entities\n"); tidy_out(doc, " -ascii to use US-ASCII for output, ISO-8859-1 for input\n"); + tidy_out(doc, " -latin0 to use ISO-8859-15 for input and US-ASCII for output\n"); tidy_out(doc, " -latin1 to use ISO-8859-1 for both input and output\n"); tidy_out(doc, " -iso2022 to use ISO-2022 for both input and output\n"); tidy_out(doc, " -utf8 to use UTF-8 for both input and output\n"); tidy_out(doc, " -mac to use MacRoman for input, US-ASCII for output\n"); + tidy_out(doc, " -win1252 to use Windows-1252 for input, US-ASCII for output\n"); + tidy_out(doc, " -ibm858 to use IBM-858 (CP850+Euro) for input, US-ASCII for output\n"); #if SUPPORT_UTF16_ENCODINGS tidy_out(doc, " -utf16le to use UTF-16LE for both input and output\n"); @@ -1145,8 +1207,6 @@ void HelpText( TidyDocImpl* doc, ctmbstr prog ) tidy_out(doc, " -utf16 to use UTF-16 for both input and output\n"); #endif - tidy_out(doc, " -win1252 to use Windows-1252 for input, US-ASCII for output\n"); - #if SUPPORT_ASIAN_ENCODINGS tidy_out(doc, " -big5 to use Big5 for both input and output\n"); /* #431953 - RJ */ tidy_out(doc, " -shiftjis to use Shift_JIS for both input and output\n"); /* #431953 - RJ */ @@ -1154,13 +1214,6 @@ void HelpText( TidyDocImpl* doc, ctmbstr prog ) #endif tidy_out(doc, "\n"); - tidy_out(doc, "File manipulation\n"); - tidy_out(doc, "-----------------\n"); - tidy_out(doc, " -config to set configuration options from the specified \n"); - tidy_out(doc, " -f to write errors to the specified \n"); - tidy_out(doc, " -modify or -m to modify the original input files\n"); - tidy_out(doc, "\n"); - tidy_out(doc, "Miscellaneous\n"); tidy_out(doc, "-------------\n"); tidy_out(doc, " -version or -v to show the version of Tidy\n"); diff --git a/tidylib-src/src/message.h b/tidylib-src/src/message.h old mode 100755 new mode 100644 index 39f0bae8..399f4867 --- a/tidylib-src/src/message.h +++ b/tidylib-src/src/message.h @@ -9,8 +9,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/07/28 18:10:16 $ - $Revision: 1.1.2.3 $ + $Date: 2003/02/16 19:33:10 $ + $Revision: 1.2 $ */ @@ -72,6 +72,9 @@ void ReportMissingAttr( TidyDocImpl* doc, Node* node, ctmbstr name ); void ReportWarning( TidyDocImpl* doc, Node* element, Node* node, uint code ); void ReportError( TidyDocImpl* doc, Node* element, Node* node, uint code ); +void ReportNonCompliantAttr( TidyDocImpl* doc, Node* node, AttVal* attr, uint versWanted ); +void ReportNonCompliantNode( TidyDocImpl* doc, Node* node, uint code, uint versWanted ); + /* error codes for entities/numeric character references */ #define MISSING_SEMICOLON 1 @@ -118,11 +121,13 @@ void ReportError( TidyDocImpl* doc, Node* element, Node* node, uint code ); #define UNESCAPED_ELEMENT 34 #define NESTED_QUOTATION 35 #define ELEMENT_NOT_EMPTY 36 +#define ENCODING_IO_CONFLICT 37 +#define MIXED_CONTENT_IN_BLOCK 38 /* error codes used for attribute messages */ #define UNKNOWN_ATTRIBUTE 1 -#define MISSING_ATTRIBUTE 2 +#define INSERTING_ATTRIBUTE 2 #define MISSING_ATTR_VALUE 3 #define BAD_ATTRIBUTE_VALUE 4 #define UNEXPECTED_GT 5 @@ -148,6 +153,8 @@ void ReportError( TidyDocImpl* doc, Node* element, Node* node, uint code ); #define ATTR_VALUE_NOT_LCASE 23 #define XML_ID_SYNTAX 24 +#define INVALID_ATTRIBUTE 25 + /* page transition effects */ #define EFFECT_BLEND -1 diff --git a/tidylib-src/src/parser.c b/tidylib-src/src/parser.c old mode 100755 new mode 100644 index a3febe94..1a42bc48 --- a/tidylib-src/src/parser.c +++ b/tidylib-src/src/parser.c @@ -6,8 +6,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/11/02 20:16:28 $ - $Revision: 1.53.2.6 $ + $Date: 2003/02/16 19:33:10 $ + $Revision: 1.56 $ */ @@ -75,7 +75,7 @@ Bool IsNewNode(Node *node) void CoerceNode( TidyDocImpl* doc, Node *node, TidyTagId tid ) { - Dict* tag = LookupTagDef( tid ); + const Dict* tag = LookupTagDef( tid ); Node* tmp = InferredTag( doc, tag->name ); ReportWarning( doc, node, tmp, OBSOLETE_ELEMENT ); MemFree( tmp->element ); @@ -90,7 +90,7 @@ void CoerceNode( TidyDocImpl* doc, Node *node, TidyTagId tid ) } /* extract a node and its children from a markup tree */ -void RemoveNode(Node *node) +Node *RemoveNode(Node *node) { if (node->prev) node->prev->next = node->next; @@ -108,6 +108,7 @@ void RemoveNode(Node *node) } node->parent = node->prev = node->next = null; + return node; } /* remove node from markup tree and discard it */ @@ -233,6 +234,9 @@ static Bool CanPrune( TidyDocImpl* doc, Node *element ) if (element->content) return no; + if ( element->tag->model & CM_BLOCK && element->attributes != null ) + return no; + if ( nodeIsA(element) && element->attributes != null ) return no; @@ -270,25 +274,24 @@ static Bool CanPrune( TidyDocImpl* doc, Node *element ) return yes; } -static void TrimEmptyElement( TidyDocImpl* doc, Node *element ) +Node *TrimEmptyElement( TidyDocImpl* doc, Node *element ) { if ( CanPrune(doc, element) ) { if ( element->type != TextNode ) ReportWarning( doc, element, null, TRIM_EMPTY_ELEMENT); - - DiscardElement(doc, element); + return DiscardElement(doc, element); } else if ( nodeIsP(element) && element->content == null ) { /* Put a non-breaking space into empty paragraphs. ** Contrary to intent, replacing empty paragraphs ** with two

does not preserve formatting. - ** Moving Lee Passey's fix over to TidyLib branch. */ char onesixty[2] = { '\240', 0 }; InsertNodeAtStart( element, NewLiteralTextNode(doc->lexer, onesixty) ); } + return element; } /* @@ -298,7 +301,7 @@ static void TrimEmptyElement( TidyDocImpl* doc, Node *element ) static void BadForm( TidyDocImpl* doc ) { doc->badForm = yes; - doc->errors++; + /* doc->errors++; */ } /* @@ -501,8 +504,32 @@ static Bool InsertMisc(Node *element, Node *node) node->type == SectionTag || node->type == AspTag || node->type == JsteTag || - node->type == PhpTag || - node->type == XmlDecl) + node->type == PhpTag ) + { + InsertNodeAtEnd(element, node); + return yes; + } + + if ( node->type == XmlDecl ) + { + Node* root = element; + while ( root && root->parent ) + root = root->parent; + if ( root ) + { + InsertNodeAtStart( root, node ); + return yes; + } + } + + /* Declared empty tags seem to be slipping through + ** the cracks. This is an experiment to figure out + ** a decent place to pick them up. + */ + if ( node->tag && + (node->type == StartTag || node->type == StartEndTag) && + nodeCMIsEmpty(node) && TagId(node) == TidyTag_UNKNOWN && + (node->tag->versions & VERS_PROPRIETARY) != 0 ) { InsertNodeAtEnd(element, node); return yes; @@ -1919,7 +1946,7 @@ static void FixEmptyRow(TidyDocImpl* doc, Node *row) void ParseRow(TidyDocImpl* doc, Node *row, uint mode) { Lexer* lexer = doc->lexer; - Node *node, *parent; + Node *node; Bool exclude_state; if (row->tag->model & CM_EMPTY) @@ -1937,6 +1964,7 @@ void ParseRow(TidyDocImpl* doc, Node *row, uint mode) return; } + /* New row start implies end of current row */ UngetToken( doc ); FixEmptyRow( doc, row); return; @@ -1948,6 +1976,13 @@ void ParseRow(TidyDocImpl* doc, Node *row, uint mode) */ if ( node->type == EndTag ) { + if ( DescendantOf(row, TagId(node)) ) + { + UngetToken( doc ); + TrimEmptyElement( doc, row); + return; + } + if ( nodeIsFORM(node) || nodeHasCM(node, CM_BLOCK|CM_INLINE) ) { if ( nodeIsFORM(node) ) @@ -1964,17 +1999,6 @@ void ParseRow(TidyDocImpl* doc, Node *row, uint mode) FreeNode( doc, node); continue; } - - for (parent = row->parent; - parent != null; parent = parent->parent) - { - if (node->tag == parent->tag) - { - UngetToken( doc ); - TrimEmptyElement( doc, row); - return; - } - } } /* deal with comments etc. */ @@ -2427,8 +2451,8 @@ void ParseTableTag(TidyDocImpl* doc, Node *table, uint mode) /* acceptable content for pre elements */ Bool PreContent( TidyDocImpl* doc, Node* node ) { - /* p is coerced to br's */ - if ( nodeIsP(node) ) + /* p is coerced to br's, Text OK too */ + if ( nodeIsP(node) || nodeIsText(node) ) return yes; if ( node->tag == null || @@ -2454,9 +2478,16 @@ void ParsePre( TidyDocImpl* doc, Node *pre, uint mode ) while ((node = GetToken(doc, Preformatted)) != null) { - if (node->tag == pre->tag && node->type == EndTag) + if ( node->type == EndTag && + (node->tag == pre->tag || DescendantOf(pre, TagId(node))) ) { - FreeNode( doc, node); + if ( node->tag == pre->tag ) + FreeNode( doc, node); + else + { + ReportWarning( doc, pre, node, MISSING_ENDTAG_BEFORE ); + UngetToken( doc ); + } TrimSpaces(doc, pre); pre->closed = yes; TrimEmptyElement(doc, pre); diff --git a/tidylib-src/src/parser.h b/tidylib-src/src/parser.h old mode 100755 new mode 100644 index 1d340b25..bfa2e241 --- a/tidylib-src/src/parser.h +++ b/tidylib-src/src/parser.h @@ -9,8 +9,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/07/08 18:03:19 $ - $Revision: 1.1.2.4 $ + $Date: 2003/02/16 19:33:11 $ + $Revision: 1.2 $ */ @@ -29,7 +29,7 @@ Bool IsNewNode(Node *node); void CoerceNode( TidyDocImpl* doc, Node *node, TidyTagId tid ); /* extract a node and its children from a markup tree */ -void RemoveNode(Node *node); +Node *RemoveNode(Node *node); /* remove node from markup tree and discard it */ Node *DiscardElement( TidyDocImpl* doc, Node *element); @@ -40,14 +40,16 @@ void InsertNodeAtStart(Node *element, Node *node); /* insert node into markup tree */ void InsertNodeAtEnd(Node *element, Node *node); - - /* insert node into markup tree before element */ void InsertNodeBeforeElement(Node *element, Node *node); /* insert node into markup tree after element */ void InsertNodeAfterElement(Node *element, Node *node); +Node *TrimEmptyElement( TidyDocImpl* doc, Node *element ); + + + /* assumes node is a text node */ Bool IsBlank(Lexer *lexer, Node *node); diff --git a/tidylib-src/src/pprint.c b/tidylib-src/src/pprint.c old mode 100755 new mode 100644 index 552bb788..2d1568a5 --- a/tidylib-src/src/pprint.c +++ b/tidylib-src/src/pprint.c @@ -6,9 +6,9 @@ CVS Info : - $Author: lpassey $ - $Date: 2002/10/29 23:53:51 $ - $Revision: 1.45.2.8 $ + $Author: creitzel $ + $Date: 2003/02/16 19:33:11 $ + $Revision: 1.50 $ */ @@ -1103,7 +1103,7 @@ static void PPrintAttrs( TidyDocImpl* doc, uint indent, Node *node ) { if ( av->attribute != null ) { - Attribute *dict = av->dict; + const Attribute *dict = av->dict; if ( !cfgBool(doc, TidyDropPropAttrs) || ( dict != null && !(dict->versions & VERS_PROPRIETARY) ) ) PPrintAttribute( doc, indent, node, av ); @@ -1327,13 +1327,23 @@ static void PPrintPI( TidyDocImpl* doc, uint indent, Node *node ) static void PPrintXmlDecl( TidyDocImpl* doc, uint indent, Node *node ) { + AttVal* att; uint saveWrap; TidyPrintImpl* pprint = &doc->pprint; SetWrap( doc, indent ); saveWrap = WrapOff( doc ); AddString( pprint, "end <= 0 || doc->lexer->lexbuf[node->end - 1] != '?' ) AddChar( pprint, '?' ); AddChar( pprint, '>' ); @@ -1437,6 +1447,7 @@ static void PPrintSection( TidyDocImpl* doc, uint indent, Node *node ) #if 0 /* ** Print script and style elements. For XHTML, wrap the content as follows: +** ** JavaScript: ** // ** CSS: -** /**/ +** / *]]>* / ** other: ** content && nodeHasCM(node, CM_NO_INDENT) ) @@ -1847,13 +1861,16 @@ void PPrintTree( TidyDocImpl* doc, uint mode, uint indent, Node *node ) if ( node->type == StartEndTag ) node->type = StartTag; - if ( node->tag && node->tag->parser == ParsePre ) + if ( node->tag && + (node->tag->parser == ParsePre || nodeIsTEXTAREA(node)) ) { + uint indprev = indent; PCondFlushLine( doc, indent ); - indent = 0; PCondFlushLine( doc, indent ); PPrintTag( doc, mode, indent, node ); + + indent = 0; PFlushLine( doc, indent); for ( content = node->content; content; content = content->next ) @@ -1861,9 +1878,9 @@ void PPrintTree( TidyDocImpl* doc, uint mode, uint indent, Node *node ) PPrintTree( doc, (mode | PREFORMATTED | NOWRAP), indent, content ); } + indent = indprev; PCondFlushLine( doc, indent ); PPrintEndTag( doc, mode, indent, node ); - PFlushLine( doc, indent ); if ( !cfg(doc, TidyIndentContent) && node->next != null ) PFlushLine( doc, indent ); diff --git a/tidylib-src/src/pprint.h b/tidylib-src/src/pprint.h old mode 100755 new mode 100644 index c2f1fce9..96318346 --- a/tidylib-src/src/pprint.h +++ b/tidylib-src/src/pprint.h @@ -8,8 +8,8 @@ CVS Info: $Author: creitzel $ - $Date: 2002/08/08 21:58:19 $ - $Revision: 1.1.2.3 $ + $Date: 2003/02/16 19:33:11 $ + $Revision: 1.2 $ */ diff --git a/tidylib-src/src/streamio.c b/tidylib-src/src/streamio.c old mode 100755 new mode 100644 index 4a0c343e..4b4fa6a4 --- a/tidylib-src/src/streamio.c +++ b/tidylib-src/src/streamio.c @@ -6,8 +6,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/10/20 18:59:40 $ - $Revision: 1.1.2.9 $ + $Date: 2003/02/16 19:33:11 $ + $Revision: 1.2 $ Wrapper around Tidy input source and output sink that calls appropriate interfaces, and applies @@ -37,8 +37,10 @@ void UngetByte( StreamIn* in, uint byteValue ); void PutByte( uint byteValue, StreamOut* out ); -extern uint Mac2Unicode[]; -extern uint Win2Unicode[]; +void EncodeWin1252( uint c, StreamOut* out ); +void EncodeMacRoman( uint c, StreamOut* out ); +void EncodeIbm858( uint c, StreamOut* out ); +void EncodeLatin0( uint c, StreamOut* out ); void outcUTF8Bytes( StreamOut *out, byte* buf, int* count ); void outBOM( StreamOut *out ); @@ -51,6 +53,7 @@ static StreamOut stderrStreamOut = { ASCII, FSM_ASCII, + DEFAULT_NL_CONFIG, FileIO, { 0, filesink_putByte } }; @@ -59,6 +62,7 @@ static StreamOut stdoutStreamOut = { ASCII, FSM_ASCII, + DEFAULT_NL_CONFIG, FileIO, { 0, filesink_putByte } }; @@ -197,7 +201,7 @@ uint ReadChar( StreamIn *in ) if ( c == '\015' && !cfgBool(in->doc, TidyXmlTags) ) break; - if (0 <= c && c < 32) + if ( c < 32 ) continue; /* discard control char */ /* watch out for chars that have already been decoded such as */ @@ -252,8 +256,18 @@ uint ReadChar( StreamIn *in ) #endif /* Do first: acts on range 128 - 255 */ - if ( in->encoding == MACROMAN ) + switch ( in->encoding ) + { + case MACROMAN: c = DecodeMacRoman( c ); + break; + case IBM858: + c = DecodeIbm850( c ); + break; + case LATIN0: + c = DecodeLatin0( c ); + break; + } /* produced e.g. as a side-effect of smart quotes in Word */ /* but can't happen if using MACROMAN encoding */ @@ -346,32 +360,33 @@ void UngetChar( uint c, StreamIn *in ) ** Sink ************************/ -static StreamOut* initStreamOut( int encoding ) +static StreamOut* initStreamOut( int encoding, uint nl ) { StreamOut* out = (StreamOut*) MemAlloc( sizeof(StreamOut) ); ClearMemory( out, sizeof(StreamOut) ); out->encoding = encoding; out->state = FSM_ASCII; + out->nl = nl; return out; } -StreamOut* FileOutput( FILE* fp, int encoding ) +StreamOut* FileOutput( FILE* fp, int encoding, uint nl ) { - StreamOut* out = initStreamOut( encoding ); + StreamOut* out = initStreamOut( encoding, nl ); initFileSink( &out->sink, fp ); out->iotype = FileIO; return out; } -StreamOut* BufferOutput( TidyBuffer* buf, int encoding ) +StreamOut* BufferOutput( TidyBuffer* buf, int encoding, uint nl ) { - StreamOut* out = initStreamOut( encoding ); + StreamOut* out = initStreamOut( encoding, nl ); initOutputBuffer( &out->sink, buf ); out->iotype = BufferIO; return out; } -StreamOut* UserOutput( TidyOutputSink* sink, int encoding ) +StreamOut* UserOutput( TidyOutputSink* sink, int encoding, uint nl ) { - StreamOut* out = initStreamOut( encoding ); + StreamOut* out = initStreamOut( encoding, nl ); memcpy( &out->sink, sink, sizeof(TidyOutputSink) ); out->iotype = UserIO; return out; @@ -379,52 +394,40 @@ StreamOut* UserOutput( TidyOutputSink* sink, int encoding ) void WriteChar( uint c, StreamOut* out ) { + /* Translate outgoing newlines */ + if ( LF == c ) + { + if ( out->nl == TidyCRLF ) + WriteChar( CR, out ); + else if ( out->nl == TidyCR ) + c = CR; + } + if (out->encoding == MACROMAN) { - if (c < 128) - PutByte(c, out); - else - { - /* For mac users, map Unicode back to MacRoman. */ - int i; - for (i = 128; i < 256; i++) - { - if (Mac2Unicode[i - 128] == c) - { - PutByte(i, out); - break; - } - } - } + EncodeMacRoman( c, out ); } - else - - if (out->encoding == WIN1252) + else if (out->encoding == WIN1252) { - if (c < 128 || (c > 159 && c < 256)) - PutByte(c, out); - else - { - int i; - - for (i = 128; i < 160; i++) - if (Win2Unicode[i - 128] == c) - { - PutByte(i, out); - break; - } - } + EncodeWin1252( c, out ); } - else - - if (out->encoding == UTF8) + else if (out->encoding == IBM858) + { + EncodeIbm858( c, out ); + } + else if (out->encoding == LATIN0) + { + EncodeLatin0( c, out ); + } + + else if (out->encoding == UTF8) { int count = 0; EncodeCharToUTF8Bytes( c, null, &out->sink, &count ); if (count <= 0) { - /* ReportEncodingError(in->lexer, INVALID_UTF8 | REPLACED_CHAR, c); */ + /* ReportEncodingError(in->lexer, INVALID_UTF8 | REPLACED_CHAR, c); */ /* replacement char 0xFFFD encoded as UTF-8 */ PutByte(0xEF, out); PutByte(0xBF, out); PutByte(0xBF, out); } @@ -471,7 +474,9 @@ void WriteChar( uint c, StreamOut* out ) } #if SUPPORT_UTF16_ENCODINGS - else if (out->encoding == UTF16LE || out->encoding == UTF16BE || out->encoding == UTF16) + else if ( out->encoding == UTF16LE || + out->encoding == UTF16BE || + out->encoding == UTF16 ) { int i, numChars = 1; uint theChars[2]; @@ -497,7 +502,7 @@ void WriteChar( uint c, StreamOut* out ) else { /* just put the char out */ - theChars[0] = (byte) c; + theChars[0] = c; } for (i = 0; i < numChars; i++) @@ -546,13 +551,13 @@ void WriteChar( uint c, StreamOut* out ) ** regardless of specified encoding. Set at compile time ** to either Windows or Mac. */ -int ReplacementCharEncoding = DFLT_REPL_CHARENC; +const int ReplacementCharEncoding = DFLT_REPL_CHARENC; /* Mapping for Windows Western character set CP 1252 ** (chars 128-159/U+0080-U+009F) to Unicode. */ -uint Win2Unicode[32] = +static const uint Win2Unicode[32] = { 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x017D, 0x0000, @@ -569,13 +574,30 @@ uint DecodeWin1252(uint c) return c; } +void EncodeWin1252( uint c, StreamOut* out ) +{ + if (c < 128 || (c > 159 && c < 256)) + PutByte(c, out); + else + { + int i; + + for (i = 128; i < 160; i++) + if (Win2Unicode[i - 128] == c) + { + PutByte(i, out); + break; + } + } +} + /* John Love-Jensen contributed this table for mapping MacRoman character set to Unicode */ /* modified to only need chars 128-255/U+0080-U+00FF - Terry Teague 19 Aug 01 */ -uint Mac2Unicode[128] = +static const uint Mac2Unicode[128] = { /* x7F = DEL */ @@ -615,13 +637,121 @@ uint DecodeMacRoman(uint c) return c; } +void EncodeMacRoman( uint c, StreamOut* out ) +{ + if (c < 128) + PutByte(c, out); + else + { + /* For mac users, map Unicode back to MacRoman. */ + int i; + for (i = 128; i < 256; i++) + { + if (Mac2Unicode[i - 128] == c) + { + PutByte(i, out); + break; + } + } + } +} + +/* Mapping for OS/2 Western character set CP 850 +** (chars 128-255) to Unicode. +*/ +const uint IBM2Unicode[128] = +{ + 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7, + 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5, + 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9, + 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x0192, + 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA, + 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB, + 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x00C0, + 0x00A9, 0x2563, 0x2551, 0x2557, 0x255D, 0x00A2, 0x00A5, 0x2510, + 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3, + 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256c, 0x00a4, + 0x00f0, 0x00d0, 0x00ca, 0x00cb, 0x00c8, 0x20AC, 0x00cd, 0x00ce, + 0x00cf, 0x2518, 0x250c, 0x2588, 0x2584, 0x00a6, 0x00cc, 0x2580, + 0x00d3, 0x00df, 0x00d4, 0x00d2, 0x00f5, 0x00d5, 0x00b5, 0x00fe, + 0x00de, 0x00da, 0x00db, 0x00d9, 0x00fd, 0x00dd, 0x00af, 0x00b4, + 0x00ad, 0x00b1, 0x2017, 0x00be, 0x00b6, 0x00a7, 0x00f7, 0x00b8, + 0x00b0, 0x00a8, 0x00b7, 0x00b9, 0x00b3, 0x00b2, 0x25a0, 0x00a0 +}; + +/* Function for conversion from OS/2-850 to Unicode */ +uint DecodeIbm850(uint c) +{ + if (127 < c && c < 256) + c = IBM2Unicode[c - 128]; + + return c; +} + +/* For OS/2,Java users, map Unicode back to IBM858 (IBM850+Euro). */ +void EncodeIbm858( uint c, StreamOut* out ) +{ + if (c < 128) + PutByte(c, out); + else + { + int i; + for (i = 128; i < 256; i++) + { + if (IBM2Unicode[i - 128] == c) + { + PutByte(i, out); + break; + } + } + } +} + + +/* Convert from Latin0 (aka Latin9, ISO-8859-15) to Unicode */ +uint DecodeLatin0(uint c) +{ + if (159 < c && c < 191) + { + switch (c) + { + case 0xA4: c = 0x20AC; break; + case 0xA6: c = 0x0160; break; + case 0xA8: c = 0x0161; break; + case 0xB4: c = 0x017D; break; + case 0xB8: c = 0x017E; break; + case 0xBC: c = 0x0152; break; + case 0xBD: c = 0x0153; break; + case 0xBE: c = 0x0178; break; + } + } + return c; +} + +/* Map Unicode back to ISO-8859-15. */ +void EncodeLatin0( uint c, StreamOut* out ) +{ + switch (c) + { + case 0x20AC: c = 0xA4; break; + case 0x0160: c = 0xA6; break; + case 0x0161: c = 0xA8; break; + case 0x017D: c = 0xB4; break; + case 0x017E: c = 0xB8; break; + case 0x0152: c = 0xBC; break; + case 0x0153: c = 0xBD; break; + case 0x0178: c = 0xBE; break; + } + PutByte(c, out); +} + /* Table to map symbol font characters to Unicode; undefined characters are mapped to 0x0000 and characters without any Unicode equivalent are mapped to '?'. Is this appropriate? */ -static uint Symbol2Unicode[] = +static const uint Symbol2Unicode[] = { 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, diff --git a/tidylib-src/src/streamio.h b/tidylib-src/src/streamio.h old mode 100755 new mode 100644 index 620afc17..d1af1a0a --- a/tidylib-src/src/streamio.h +++ b/tidylib-src/src/streamio.h @@ -3,14 +3,14 @@ /* streamio.h -- handles character stream I/O - (c) 1998-2002 (W3C) MIT, INRIA, Keio University + (c) 1998-2003 (W3C) MIT, INRIA, Keio University See tidy.h for the copyright notice. CVS Info : - $Author: creitzel $ - $Date: 2002/07/28 18:10:16 $ - $Revision: 1.1.2.5 $ + $Author: lpassey $ + $Date: 2003/02/25 21:12:03 $ + $Revision: 1.3 $ Wrapper around Tidy input source and output sink that calls appropriate interfaces, and applies @@ -20,7 +20,6 @@ */ #include "forward.h" -#include "tidy.h" #include "buffio.h" #include "fileio.h" @@ -74,16 +73,17 @@ Bool IsEOF( StreamIn* in ); struct _StreamOut { - int encoding; - int state; /* for ISO 2022 */ + int encoding; + int state; /* for ISO 2022 */ + uint nl; IOType iotype; TidyOutputSink sink; }; -StreamOut* FileOutput( FILE* fp, int encoding ); -StreamOut* BufferOutput( TidyBuffer* buf, int encoding ); -StreamOut* UserOutput( TidyOutputSink* sink, int encoding ); +StreamOut* FileOutput( FILE* fp, int encoding, uint newln ); +StreamOut* BufferOutput( TidyBuffer* buf, int encoding, uint newln ); +StreamOut* UserOutput( TidyOutputSink* sink, int encoding, uint newln ); StreamOut* StdErrOutput(); StreamOut* StdOutOutput(); @@ -100,16 +100,18 @@ void outBOM( StreamOut *out ); */ #define RAW 0 #define ASCII 1 -#define LATIN1 2 -#define UTF8 3 -#define ISO2022 4 -#define MACROMAN 5 -#define WIN1252 6 +#define LATIN0 2 +#define LATIN1 3 +#define UTF8 4 +#define ISO2022 5 +#define MACROMAN 6 +#define WIN1252 7 +#define IBM858 8 #if SUPPORT_UTF16_ENCODINGS -#define UTF16LE 7 -#define UTF16BE 8 -#define UTF16 9 +#define UTF16LE 9 +#define UTF16BE 10 +#define UTF16 11 #endif /* Note that Big5 and SHIFTJIS are not converted to ISO 10646 codepoints @@ -118,11 +120,11 @@ void outBOM( StreamOut *out ); */ #if SUPPORT_ASIAN_ENCODINGS #if SUPPORT_UTF16_ENCODINGS -#define BIG5 10 -#define SHIFTJIS 11 +#define BIG5 12 +#define SHIFTJIS 13 #else -#define BIG5 7 -#define SHIFTJIS 8 +#define BIG5 9 +#define SHIFTJIS 10 #endif #endif @@ -150,7 +152,7 @@ void outBOM( StreamOut *out ); ** regardless of specified encoding. Set at compile time ** to either Windows or Mac. */ -extern int ReplacementCharEncoding; +extern const int ReplacementCharEncoding; /* Function for conversion from Windows-1252 to Unicode */ uint DecodeWin1252(uint c); @@ -158,8 +160,29 @@ uint DecodeWin1252(uint c); /* Function to convert from MacRoman to Unicode */ uint DecodeMacRoman(uint c); +/* Function for conversion from OS/2-850 to Unicode */ +uint DecodeIbm850(uint c); + +/* Function for conversion from Latin0 to Unicode */ +uint DecodeLatin0(uint c); + /* Function to convert from Symbol Font chars to Unicode */ uint DecodeSymbolFont(uint c); +/* Use numeric constants as opposed to escape chars (\r, \n) +** to avoid conflict Mac compilers that may re-define these. +*/ +#define CR 0xD +#define LF 0xA + +#if defined(MAC_OS_CLASSIC) +#define DEFAULT_NL_CONFIG TidyCR +#elif defined(_WIN32) || defined(OS2_OS) +#define DEFAULT_NL_CONFIG TidyCRLF +#else +#define DEFAULT_NL_CONFIG TidyLF +#endif + + #endif /* __STREAMIO_H__ */ diff --git a/tidylib-src/src/tagask.c b/tidylib-src/src/tagask.c old mode 100755 new mode 100644 index 79d0cf6b..ad864f02 --- a/tidylib-src/src/tagask.c +++ b/tidylib-src/src/tagask.c @@ -6,8 +6,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/07/08 18:03:19 $ - $Revision: 1.1.2.3 $ + $Date: 2003/02/16 19:33:11 $ + $Revision: 1.2 $ */ diff --git a/tidylib-src/src/tags.c b/tidylib-src/src/tags.c old mode 100755 new mode 100644 index c1731398..1cdcd98e --- a/tidylib-src/src/tags.c +++ b/tidylib-src/src/tags.c @@ -1,16 +1,15 @@ /* tags.c -- recognize HTML tags - (c) 1998-2002 (W3C) MIT, INRIA, Keio University + (c) 1998-2003 (W3C) MIT, INRIA, Keio University See tidy.h for the copyright notice. CVS Info : - $Author: creitzel $ - $Date: 2002/10/15 19:54:31 $ - $Revision: 1.20.2.5 $ + $Author: terry_teague $ + $Date: 2003/03/02 04:29:12 $ + $Revision: 1.22 $ The HTML tags are stored as 8 bit ASCII strings. - Use lookupw() to find a tag given a wide char string. */ @@ -20,7 +19,7 @@ #include "tmbstr.h" #include "parser.h" /* For FixId() */ -static Dict tag_defs[] = +static const Dict tag_defs[] = { { TidyTag_UNKNOWN, "unknown!", 0, 0, null, null}, { TidyTag_A, "a", VERS_ALL, CM_INLINE, ParseInline, CheckAnchor}, @@ -148,13 +147,18 @@ static Dict tag_defs[] = /* choose what version to use for new doctype */ int HTMLVersion( TidyDocImpl* doc ) { + int dtver = doc->lexer->doctype; uint versions = doc->lexer->versions; - Bool isXml = cfgBool(doc, TidyXmlOut) - | cfgBool(doc, TidyXmlTags) - | doc->lexer->isvoyager; + TidyDoctypeModes dtmode = cfg(doc, TidyDoctypeMode); + + Bool wantXhtml = !cfgBool(doc, TidyHtmlOut) && + ( cfgBool(doc, TidyXmlOut) || doc->lexer->isvoyager ); + + Bool wantHtml4 = dtmode==TidyDoctypeStrict || dtmode==TidyDoctypeLoose || + dtver==VERS_HTML40_STRICT || dtver==VERS_HTML40_LOOSE; /* Prefer HTML 4.x for XHTML */ - if ( !isXml ) + if ( !wantXhtml && !wantHtml4 ) { if ( versions & VERS_HTML32 ) /* Prefer 3.2 over 2.0 */ return VERS_HTML32; @@ -163,7 +167,7 @@ int HTMLVersion( TidyDocImpl* doc ) return VERS_HTML20; } - if ( versions & VERS_XHTML11 ) + if ( wantXhtml && (versions & VERS_XHTML11) ) return VERS_XHTML11; if ( versions & VERS_HTML40_STRICT ) @@ -176,24 +180,21 @@ int HTMLVersion( TidyDocImpl* doc ) return VERS_FRAMESET; /* Still here? Try these again. */ - if ( isXml ) - { - if ( versions & VERS_HTML32 ) /* Prefer 3.2 over 2.0 */ - return VERS_HTML32; + if ( versions & VERS_HTML32 ) /* Prefer 3.2 over 2.0 */ + return VERS_HTML32; - if ( versions & VERS_HTML20 ) - return VERS_HTML20; - } + if ( versions & VERS_HTML20 ) + return VERS_HTML20; return VERS_UNKNOWN; } -static Dict *lookup( TidyTagImpl* tags, ctmbstr s ) +static const Dict* lookup( TidyTagImpl* tags, ctmbstr s ) { Dict *np = null; if ( s ) { - Dict *np = tag_defs + 1; /* Skip Unknown */ + const Dict *np = tag_defs + 1; /* Skip Unknown */ for ( /**/; np < tag_defs + N_TIDY_TAGS; ++np ) if ( tmbstrcmp(s, np->name) == 0 ) return np; @@ -206,32 +207,38 @@ static Dict *lookup( TidyTagImpl* tags, ctmbstr s ) } -static Dict* declare( TidyTagImpl* tags, - ctmbstr name, uint versions, uint model, - Parser *parser, CheckAttribs *chkattrs ) +static void declare( TidyTagImpl* tags, + ctmbstr name, uint versions, uint model, + Parser *parser, CheckAttribs *chkattrs ) { - Dict* np = lookup( tags, name ); - if ( np == null ) + if ( name ) { - np = (Dict*) MemAlloc( sizeof(Dict) ); - ClearMemory( np, sizeof(Dict) ); + Dict* np = (Dict*) lookup( tags, name ); + if ( np == null ) + { + np = (Dict*) MemAlloc( sizeof(Dict) ); + ClearMemory( np, sizeof(Dict) ); - np->name = tmbstrdup( name ); - np->next = tags->declared_tag_list; - tags->declared_tag_list = np; - } + np->name = tmbstrdup( name ); + np->next = tags->declared_tag_list; + tags->declared_tag_list = np; + } - np->versions = versions; - np->model |= model; - np->parser = parser; - np->chkattrs = chkattrs; - return np; + /* Make sure we are not over-writing predefined tags */ + if ( np->id == TidyTag_UNKNOWN ) + { + np->versions = versions; + np->model |= model; + np->parser = parser; + np->chkattrs = chkattrs; + } + } } /* public interface for finding tag by name */ Bool FindTag( TidyDocImpl* doc, Node *node ) { - Dict *np = null; + const Dict *np = null; if ( cfgBool(doc, TidyXmlTags) ) { node->tag = doc->tags.xml_tags; @@ -247,7 +254,7 @@ Bool FindTag( TidyDocImpl* doc, Node *node ) return no; } -Dict* LookupTagDef( TidyTagId tid ) +const Dict* LookupTagDef( TidyTagId tid ) { if ( tid > TidyTag_UNKNOWN && tid < N_TIDY_TAGS ) return tag_defs + tid; @@ -255,9 +262,9 @@ Dict* LookupTagDef( TidyTagId tid ) } -Parser *FindParser( TidyDocImpl* doc, Node *node ) +Parser* FindParser( TidyDocImpl* doc, Node *node ) { - Dict* np = lookup( &doc->tags, node->element ); + const Dict* np = lookup( &doc->tags, node->element ); if ( np ) return np->parser; return null; @@ -332,35 +339,78 @@ ctmbstr GetNextDeclaredTag( TidyDocImpl* doc, int tagType, break; } } - *iter = (TidyIterator) ( curr ? curr->next : null ); + *iter = (TidyIterator) ( curr ? curr : null ); return name; } void InitTags( TidyDocImpl* doc ) { + Dict* xml; TidyTagImpl* tags = &doc->tags; ClearMemory( tags, sizeof(TidyTagImpl) ); /* create dummy entry for all xml tags */ - tags->xml_tags = (Dict*) MemAlloc( sizeof(Dict) ); - tags->xml_tags->name = null; - tags->xml_tags->versions = VERS_XML; - tags->xml_tags->model = CM_BLOCK; - tags->xml_tags->parser = null; - tags->xml_tags->chkattrs = null; -} - -void FreeTags( TidyDocImpl* doc ) + xml = (Dict*) MemAlloc( sizeof(Dict) ); + ClearMemory( xml, sizeof(Dict) ); + xml->name = null; + xml->versions = VERS_XML; + xml->model = CM_BLOCK; + xml->parser = null; + xml->chkattrs = null; + tags->xml_tags = xml; +} + +/* By default, zap all of them. But allow +** an single type to be specified. +*/ +void FreeDeclaredTags( TidyDocImpl* doc, int tagType ) { TidyTagImpl* tags = &doc->tags; - Dict* curr; + Dict *curr, *next = null, *prev = null; - while ( curr = tags->declared_tag_list ) + for ( curr=tags->declared_tag_list; curr; curr = next ) { - tags->declared_tag_list = curr->next; - MemFree( curr->name ); - MemFree( curr ); + Bool deleteIt = yes; + next = curr->next; + switch ( tagType ) + { + case tagtype_empty: + deleteIt = ( curr->model & CM_EMPTY ); + break; + + case tagtype_inline: + deleteIt = ( curr->model & CM_INLINE ); + break; + + case tagtype_block: + deleteIt = ( (curr->model & CM_BLOCK) && + curr->parser == ParseBlock ); + break; + + case tagtype_pre: + deleteIt = ( (curr->model & CM_BLOCK) && + curr->parser == ParsePre ); + break; + } + + if ( deleteIt ) + { + MemFree( curr->name ); + MemFree( curr ); + if ( prev ) + prev->next = next; + else + tags->declared_tag_list = next; + } + else + prev = curr; } +} + +void FreeTags( TidyDocImpl* doc ) +{ + TidyTagImpl* tags = &doc->tags; + FreeDeclaredTags( doc, 0 ); MemFree( tags->xml_tags ); @@ -398,7 +448,7 @@ void CheckIMG( TidyDocImpl* doc, Node *node ) AttVal *attval; for ( attval = node->attributes; attval != null; attval = attval->next ) { - Attribute* dict = CheckAttribute( doc, node, attval ); + const Attribute* dict = CheckAttribute( doc, node, attval ); if ( dict ) { TidyAttrId id = dict->id; @@ -529,7 +579,7 @@ void CheckAREA( TidyDocImpl* doc, Node *node ) for (attval = node->attributes; attval != null; attval = attval->next) { - Attribute* dict = CheckAttribute( doc, node, attval ); + const Attribute* dict = CheckAttribute( doc, node, attval ); if ( dict ) { if ( dict->id == TidyAttr_ALT ) @@ -559,7 +609,7 @@ void CheckTABLE( TidyDocImpl* doc, Node *node ) for (attval = node->attributes; attval != null; attval = attval->next) { - Attribute* dict = CheckAttribute( doc, node, attval ); + const Attribute* dict = CheckAttribute( doc, node, attval ); if ( dict && dict->id == TidyAttr_SUMMARY ) HasSummary = yes; } @@ -605,7 +655,7 @@ void CheckSCRIPT( TidyDocImpl* doc, Node *node ) if ( !type ) { - ReportMissingAttr( doc, node, "type" ); + /* ReportMissingAttr( doc, node, "type" ); */ /* check for javascript */ if ( lang ) @@ -626,6 +676,8 @@ void CheckSCRIPT( TidyDocImpl* doc, Node *node ) } else AddAttribute( doc, node, "type", "text/javascript" ); + type = GetAttrByName( node, "type" ); + ReportAttrError( doc, node, type, INSERTING_ATTRIBUTE ); } } @@ -639,8 +691,9 @@ void CheckSTYLE( TidyDocImpl* doc, Node *node ) if ( !type ) { - ReportMissingAttr( doc, node, "type"); AddAttribute( doc, node, "type", "text/css" ); + type = GetAttrByName( node, "type" ); + ReportAttrError( doc, node, type, INSERTING_ATTRIBUTE ); } } @@ -657,8 +710,9 @@ void CheckLINK( TidyDocImpl* doc, Node *node ) AttVal *type = GetAttrByName(node, "type"); if (!type) { - ReportMissingAttr( doc, node, "type" ); AddAttribute( doc, node, "type", "text/css" ); + type = GetAttrByName( node, "type" ); + ReportAttrError( doc, node, type, INSERTING_ATTRIBUTE ); } } } @@ -690,8 +744,7 @@ Bool nodeIsText( Node* node ) Bool nodeHasText( TidyDocImpl* doc, Node* node ) { - assert( doc != null ); - if ( nodeIsText(node) ) + if ( doc && node ) { uint ix; Lexer* lexer = doc->lexer; diff --git a/tidylib-src/src/tags.h b/tidylib-src/src/tags.h old mode 100755 new mode 100644 index ad8e0b40..1d287994 --- a/tidylib-src/src/tags.h +++ b/tidylib-src/src/tags.h @@ -8,9 +8,9 @@ CVS Info : - $Author: lpassey $ - $Date: 2002/10/22 15:02:23 $ - $Revision: 1.1.2.7 $ + $Author: creitzel $ + $Date: 2003/02/16 19:33:11 $ + $Revision: 1.2 $ The HTML tags are stored as 8 bit ASCII strings. Use lookupw() to find a tag given a wide char string. @@ -58,10 +58,11 @@ int HTMLVersion( TidyDocImpl* doc ); /* interface for finding tag by name */ -Dict* LookupTagDef( TidyTagId tid ); +const Dict* LookupTagDef( TidyTagId tid ); Bool FindTag( TidyDocImpl* doc, Node *node ); Parser* FindParser( TidyDocImpl* doc, Node *node ); void DefineTag( TidyDocImpl* doc, int tagType, ctmbstr name ); +void FreeDeclaredTags( TidyDocImpl* doc, int tagType ); /* 0 to free all */ TidyIterator GetDeclaredTagList( TidyDocImpl* doc ); Dict* GetNextDeclaredDict( TidyDocImpl* doc, TidyIterator* iter ); @@ -118,7 +119,7 @@ CheckAttribs CheckMETA; /* 0 == TidyTag_UNKNOWN */ -#define TagId(node) ((node) ? ((node)->tag ? (node)->tag->id : 0) : 0) +#define TagId(node) ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN) #define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid) Bool nodeIsText( Node* node ); diff --git a/tidylib-src/src/tidy-int.h b/tidylib-src/src/tidy-int.h old mode 100755 new mode 100644 index 00d21722..0f60d36a --- a/tidylib-src/src/tidy-int.h +++ b/tidylib-src/src/tidy-int.h @@ -9,8 +9,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/08/11 16:44:31 $ - $Revision: 1.1.2.8 $ + $Date: 2003/02/16 19:33:11 $ + $Revision: 1.2 $ */ @@ -36,8 +36,10 @@ struct _TidyDocImpl TidyTagImpl tags; TidyAttribImpl attribs; +#if SUPPORT_ACCESSIBILITY_CHECKS /* Accessibility Checks state */ TidyAccessImpl access; +#endif /* The Pretty Print buffer */ TidyPrintImpl pprint; @@ -51,6 +53,7 @@ struct _TidyDocImpl StreamOut* docOut; StreamOut* errout; TidyReportFilter mssgFilt; + TidyOptCallback pOptCallback; /* Parse + Repair Results */ uint optionErrors; @@ -74,6 +77,7 @@ struct _TidyDocImpl #if PRESERVE_FILE_TIMES struct utimbuf filetimes; #endif + Node* givenDoctype; }; diff --git a/tidylib-src/src/tidylib.c b/tidylib-src/src/tidylib.c old mode 100755 new mode 100644 index fffe1737..3849822f --- a/tidylib-src/src/tidylib.c +++ b/tidylib-src/src/tidylib.c @@ -1,13 +1,13 @@ /* tidylib.c -- internal library definitions - (c) 1998-2002 (W3C) MIT, INRIA, Keio University + (c) 1998-2003 (W3C) MIT, INRIA, Keio University See tidy.h for the copyright notice. CVS Info : - $Author: creitzel $ - $Date: 2002/10/15 19:54:30 $ - $Revision: 1.1.2.9 $ + $Author: terry_teague $ + $Date: 2003/03/02 04:31:13 $ + $Revision: 1.4 $ Defines HTML Tidy API implemented by tidy library. @@ -163,6 +163,18 @@ ctmbstr tidyReleaseDate() /* Get/set configuration options */ +Bool tidySetOptionCallback( TidyDoc tdoc, TidyOptCallback pOptCallback ) +{ + TidyDocImpl* impl = tidyDocToImpl( tdoc ); + if ( impl ) + { + impl->pOptCallback = pOptCallback; + return yes; + } + return -EINVAL; +} + + int tidyLoadConfig( TidyDoc tdoc, ctmbstr cfgfil ) { TidyDocImpl* impl = tidyDocToImpl( tdoc ); @@ -381,7 +393,7 @@ ctmbstr tidyOptGetCurrPick( TidyDoc tdoc, TidyOptionId optId ) if ( option && option->pickList ) { uint ix, pick = tidyOptGetInt( tdoc, optId ); - ctmbstr* pL = option->pickList; + const ctmbstr* pL = option->pickList; for ( ix=0; *pL && ix < pick; ++ix ) ++pL; if ( *pL ) @@ -574,11 +586,13 @@ FILE* tidySetErrorFile( TidyDoc tdoc, ctmbstr errfilnam ) TidyDocImpl* impl = tidyDocToImpl( tdoc ); if ( impl ) { - FILE* errout = fopen( errfilnam, "w" ); + FILE* errout = fopen( errfilnam, "wb" ); if ( errout ) { + uint outenc = cfg( impl, TidyOutCharEncoding ); + uint nl = cfg( impl, TidyNewline ); ReleaseStreamOut( impl->errout ); - impl->errout = FileOutput( errout, ASCII ); + impl->errout = FileOutput( errout, outenc, nl ); return errout; } } @@ -590,8 +604,10 @@ int tidySetErrorBuffer( TidyDoc tdoc, TidyBuffer* errbuf ) TidyDocImpl* impl = tidyDocToImpl( tdoc ); if ( impl ) { + uint outenc = cfg( impl, TidyOutCharEncoding ); + uint nl = cfg( impl, TidyNewline ); ReleaseStreamOut( impl->errout ); - impl->errout = BufferOutput( errbuf, ASCII ); + impl->errout = BufferOutput( errbuf, outenc, nl ); return ( impl->errout ? 0 : -ENOMEM ); } return -EINVAL; @@ -602,8 +618,10 @@ int tidySetErrorSink( TidyDoc tdoc, TidyOutputSink* sink ) TidyDocImpl* impl = tidyDocToImpl( tdoc ); if ( impl ) { + uint outenc = cfg( impl, TidyOutCharEncoding ); + uint nl = cfg( impl, TidyNewline ); ReleaseStreamOut( impl->errout ); - impl->errout = UserOutput( sink, ASCII ); + impl->errout = UserOutput( sink, outenc, nl ); return ( impl->errout ? 0 : -ENOMEM ); } return -EINVAL; @@ -726,7 +744,7 @@ int tidyDocParseFile( TidyDocImpl* doc, ctmbstr filnam ) { int status = -ENOENT; uint inenc = cfg( doc, TidyInCharEncoding ); - FILE* fin = fopen( filnam, "r" ); + FILE* fin = fopen( filnam, "rb" ); #if PRESERVE_FILE_TIMES struct stat sbuf = {0}; @@ -831,38 +849,78 @@ int tidySaveSink( TidyDoc tdoc, TidyOutputSink* sink ) int tidyDocSaveFile( TidyDocImpl* doc, ctmbstr filnam ) { int status = -ENOENT; - StreamOut* out = null; - uint outenc = cfg( doc, TidyOutCharEncoding ); - FILE* fout = fopen( filnam, "w" ); + FILE* fout = null; + + /* Don't zap input file if no output */ + if ( doc->errors > 0 && + cfgBool(doc, TidyWriteBack) && !cfgBool(doc, TidyForceOutput) ) + status = tidyDocStatus( doc ); + else + fout = fopen( filnam, "wb" ); + if ( fout ) { - out = FileOutput( fout, outenc ); + uint outenc = cfg( doc, TidyOutCharEncoding ); + uint nl = cfg( doc, TidyNewline ); + StreamOut* out = FileOutput( fout, outenc, nl ); + status = tidyDocSaveStream( doc, out ); + fclose( fout ); + MemFree( out ); + #if PRESERVE_FILE_TIMES - if ( !doc->filetimes.actime ) - fclose( fout ); - else + if ( doc->filetimes.actime ) { /* set file last accessed/modified times to original values */ - fclose( fout ); utime( filnam, &doc->filetimes ); ClearMemory( &doc->filetimes, sizeof(doc->filetimes) ); } -#else - fclose( fout ); #endif /* PRESERVFILETIMES */ - MemFree( out ); } return status; } + +/* Note, _setmode() does NOT work on Win2K Pro w/ VC++ 6.0 SP3. +** The code has been left in in case it works w/ other compilers +** or operating systems. If stdout is in Text mode, be aware that +** it will garble UTF16 documents. In text mode, when it encounters +** a single byte of value 10 (0xA), it will insert a single byte +** value 13 (0xD) just before it. This has the effect of garbling +** the entire document. +*/ + +#if defined(_WIN32) || defined(OS2_OS) +#include +#include +#endif + int tidyDocSaveStdout( TidyDocImpl* doc ) { + int oldmode = -1, status = 0; uint outenc = cfg( doc, TidyOutCharEncoding ); - StreamOut* out = FileOutput( stdout, outenc ); - int status = tidyDocSaveStream( doc, out ); + uint nl = cfg( doc, TidyNewline ); + StreamOut* out = FileOutput( stdout, outenc, nl ); + +#if defined(_WIN32) || defined(OS2_OS) + oldmode = _setmode( _fileno(stdout), _O_BINARY ); + if ( out->encoding == UTF16 || + out->encoding == UTF16LE || + out->encoding == UTF16BE ) + { + ReportWarning( doc, NULL, doc->root, ENCODING_IO_CONFLICT ); + } +#endif + + if ( 0 == status ) + status = tidyDocSaveStream( doc, out ); + +#if defined(_WIN32) || defined(OS2_OS) + if ( oldmode != -1 ) + oldmode = _setmode( _fileno(stdout), oldmode ); +#endif MemFree( out ); return status; } @@ -870,9 +928,10 @@ int tidyDocSaveStdout( TidyDocImpl* doc ) int tidyDocSaveString( TidyDocImpl* doc, tmbstr buffer, uint* buflen ) { uint outenc = cfg( doc, TidyOutCharEncoding ); + uint nl = cfg( doc, TidyNewline ); TidyBuffer outbuf = {0}; - StreamOut* out = BufferOutput( &outbuf, outenc ); + StreamOut* out = BufferOutput( &outbuf, outenc, nl ); int status = tidyDocSaveStream( doc, out ); if ( outbuf.size > *buflen ) @@ -892,7 +951,8 @@ int tidyDocSaveBuffer( TidyDocImpl* doc, TidyBuffer* outbuf ) if ( outbuf ) { uint outenc = cfg( doc, TidyOutCharEncoding ); - StreamOut* out = BufferOutput( outbuf, outenc ); + uint nl = cfg( doc, TidyNewline ); + StreamOut* out = BufferOutput( outbuf, outenc, nl ); status = tidyDocSaveStream( doc, out ); MemFree( out ); @@ -903,7 +963,8 @@ int tidyDocSaveBuffer( TidyDocImpl* doc, TidyBuffer* outbuf ) int tidyDocSaveSink( TidyDocImpl* doc, TidyOutputSink* sink ) { uint outenc = cfg( doc, TidyOutCharEncoding ); - StreamOut* out = UserOutput( sink, outenc ); + uint nl = cfg( doc, TidyNewline ); + StreamOut* out = UserOutput( sink, outenc, nl ); int status = tidyDocSaveStream( doc, out ); MemFree( out ); return status; @@ -958,6 +1019,7 @@ int tidyDocParseStream( TidyDocImpl* doc, StreamIn* in ) TakeConfigSnapshot( doc ); /* Save config state */ FreeLexer( doc ); + FreeAnchors( doc ); doc->lexer = NewLexer(); doc->inputHadBOM = no; @@ -1002,10 +1064,13 @@ int tidyDocRunDiagnostics( TidyDocImpl* doc ) Bool quiet = cfgBool( doc, TidyQuiet ); Bool force = cfgBool( doc, TidyForceOutput ); - ReportMarkupVersion( doc ); + HTMLVersionCompliance( doc ); if ( !quiet ) + { + ReportMarkupVersion( doc ); ReportNumWarnings( doc ); + } if ( doc->errors > 0 && !force ) NeedsAuthorIntervention( doc ); @@ -1024,11 +1089,11 @@ int tidyDocCleanAndRepair( TidyDocImpl* doc ) Bool logical = cfgBool( doc, TidyLogicalEmphasis ); Bool clean = cfgBool( doc, TidyMakeClean ); Bool dropFont = cfgBool( doc, TidyDropFontTags ); + Bool htmlOut = cfgBool( doc, TidyHtmlOut ); Bool xmlOut = cfgBool( doc, TidyXmlOut ); Bool xhtmlOut = cfgBool( doc, TidyXhtmlOut ); Bool xmlDecl = cfgBool( doc, TidyXmlDecl ); Bool tidyMark = cfgBool( doc, TidyMark ); - Node* doctype; /* simplifies ... ... etc. */ NestedEmphasis( doc, doc->root ); @@ -1054,15 +1119,38 @@ int tidyDocCleanAndRepair( TidyDocImpl* doc ) if ( clean || dropFont ) CleanDocument( doc ); + /* Move terminating
tags from out of paragraphs */ + /*! Do we want to do this for all block-level elements? */ + FixBrakes( doc, FindBody( doc )); + + /* Reconcile http-equiv meta element with output encoding */ + if (RAW != cfg( doc, TidyOutCharEncoding)) + VerifyHTTPEquiv( doc, FindHEAD( doc )); + if ( !CheckNodeIntegrity(doc->root) ) FatalError( integrity ); - /* remember given doctype */ - doctype = CloneNodeEx( doc, FindDocType(doc) ); + /* remember given doctype for reporting */ + doc->givenDoctype = CloneNodeEx( doc, FindDocType(doc) ); if ( doc->root->content ) { - if ( xhtmlOut ) + /* If we had XHTML input but want HTML output */ + if ( htmlOut && doc->lexer->isvoyager ) + { + Node* node = FindDocType( doc ); + /* Remove reference, but do not free */ + if ( node ) + RemoveNode( node ); + if ( node = FindHTML(doc) ) + { + AttVal* av = AttrGetById( node, TidyAttr_XMLNS ); + if ( av ) + RemoveAttribute( node, av ); + } + } + + if ( xhtmlOut && !htmlOut ) SetXHTMLDocType( doc ); else FixDocType( doc ); @@ -1082,20 +1170,28 @@ int tidyDocSaveStream( TidyDocImpl* doc, StreamOut* out ) { Bool showMarkup = cfgBool( doc, TidyShowMarkup ); Bool forceOutput = cfgBool( doc, TidyForceOutput ); +#if SUPPORT_UTF16_ENCODINGS Bool outputBOM = ( cfg(doc, TidyOutputBOM) == yes ); Bool smartBOM = ( cfg(doc, TidyOutputBOM) == TidyAutoState ); +#endif Bool xmlOut = cfgBool( doc, TidyXmlOut ); Bool xhtmlOut = cfgBool( doc, TidyXhtmlOut ); Bool bodyOnly = cfgBool( doc, TidyBodyOnly ); if ( showMarkup && (doc->errors == 0 || forceOutput) ) { +#if SUPPORT_UTF16_ENCODINGS /* Output a Byte Order Mark if required */ if ( outputBOM || (doc->inputHadBOM && smartBOM) ) outBOM( out ); +#endif - if ( !FindDocType(doc) ) - SetOptionBool( doc, TidyNumEntities, yes ); + /* No longer necessary. No DOCTYPE == HTML 3.2, + ** which gives you only the basic character entities, + ** which are safe in any browser. + ** if ( !FindDocType(doc) ) + ** SetOptionBool( doc, TidyNumEntities, yes ); + */ doc->docOut = out; if ( xmlOut && !xhtmlOut ) @@ -1207,14 +1303,17 @@ Bool tidyNodeHasText( TidyDoc tdoc, TidyNode tnod ) return nodeHasText( doc, tidyNodeToImpl(tnod) ); return no; } + + Bool tidyNodeGetText( TidyDoc tdoc, TidyNode tnod, TidyBuffer* outbuf ) { TidyDocImpl* doc = tidyDocToImpl( tdoc ); Node* nimp = tidyNodeToImpl( tnod ); - if ( doc && nodeHasText(doc, nimp) && outbuf ) + if ( doc && nimp && outbuf ) { uint outenc = cfg( doc, TidyOutCharEncoding ); - StreamOut* out = BufferOutput( outbuf, outenc ); + uint nl = cfg( doc, TidyNewline ); + StreamOut* out = BufferOutput( outbuf, outenc, nl ); Bool xmlOut = cfgBool( doc, TidyXmlOut ); Bool xhtmlOut = cfgBool( doc, TidyXhtmlOut ); diff --git a/tidylib-src/src/tmbstr.c b/tidylib-src/src/tmbstr.c old mode 100755 new mode 100644 index 41280979..a2d36302 --- a/tidylib-src/src/tmbstr.c +++ b/tidylib-src/src/tmbstr.c @@ -5,9 +5,9 @@ CVS Info : - $Author: lpassey $ - $Date: 2002/10/29 23:52:26 $ - $Revision: 1.1.2.5 $ + $Author: creitzel $ + $Date: 2003/02/16 19:33:11 $ + $Revision: 1.2 $ */ diff --git a/tidylib-src/src/tmbstr.h b/tidylib-src/src/tmbstr.h old mode 100755 new mode 100644 index e0c56314..b0ad2fcb --- a/tidylib-src/src/tmbstr.h +++ b/tidylib-src/src/tmbstr.h @@ -8,9 +8,9 @@ CVS Info : - $Author: lpassey $ - $Date: 2002/10/29 23:52:03 $ - $Revision: 1.1.2.3 $ + $Author: creitzel $ + $Date: 2003/02/16 19:33:11 $ + $Revision: 1.2 $ */ diff --git a/tidylib-src/src/utf8.c b/tidylib-src/src/utf8.c old mode 100755 new mode 100644 index d01db5b4..7c829d1c --- a/tidylib-src/src/utf8.c +++ b/tidylib-src/src/utf8.c @@ -6,8 +6,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/10/15 19:50:30 $ - $Revision: 1.1.2.6 $ + $Date: 2003/02/16 19:33:11 $ + $Revision: 1.2 $ Uses public interfaces to abstract input source and output sink, which may be user supplied or either FILE* or memory @@ -139,7 +139,7 @@ DBFF DFF* F4 8F BF B* 0010FFF* /* offsets into validUTF8 table below */ -static int offsetUTF8Sequences[kMaxUTF8Bytes + 1] = +static const int offsetUTF8Sequences[kMaxUTF8Bytes + 1] = { 0, /* 1 byte */ 1, /* 2 bytes */ @@ -148,7 +148,7 @@ static int offsetUTF8Sequences[kMaxUTF8Bytes + 1] = kNumUTF8Sequences /* must be last */ }; -static struct validUTF8Sequence +static const struct validUTF8Sequence { uint lowChar; uint highChar; diff --git a/tidylib-src/src/utf8.h b/tidylib-src/src/utf8.h old mode 100755 new mode 100644 index f9895e9a..e74eaafd --- a/tidylib-src/src/utf8.h +++ b/tidylib-src/src/utf8.h @@ -9,8 +9,8 @@ CVS Info : $Author: creitzel $ - $Date: 2002/07/08 18:03:19 $ - $Revision: 1.1.2.3 $ + $Date: 2003/02/16 19:33:11 $ + $Revision: 1.2 $ */ diff --git a/tidylib-src/test/input/cfg_427812.txt b/tidylib-src/test/input/cfg_427812.txt deleted file mode 100755 index 3670e37c..00000000 --- a/tidylib-src/test/input/cfg_427812.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #427812 -output-xhtml: yes diff --git a/tidylib-src/test/input/cfg_427821.txt b/tidylib-src/test/input/cfg_427821.txt deleted file mode 100755 index c17f0b27..00000000 --- a/tidylib-src/test/input/cfg_427821.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #427821 -output-xhtml: yes diff --git a/tidylib-src/test/input/cfg_427825.txt b/tidylib-src/test/input/cfg_427825.txt deleted file mode 100755 index 045aa062..00000000 --- a/tidylib-src/test/input/cfg_427825.txt +++ /dev/null @@ -1,3 +0,0 @@ -// Tidy configuration file for bug #427825 -new-inline-tags: lm:xcode - diff --git a/tidylib-src/test/input/cfg_427826.txt b/tidylib-src/test/input/cfg_427826.txt deleted file mode 100755 index 0fc9caee..00000000 --- a/tidylib-src/test/input/cfg_427826.txt +++ /dev/null @@ -1,10 +0,0 @@ -// Tidy configuration file for bug #427826 -indent: auto -char-encoding: latin1 -tidy-mark: no -clean: yes -drop-font-tags: yes -logical-emphasis: yes -indent-attributes: yes -output-xhtml: yes - diff --git a/tidylib-src/test/input/cfg_427835.txt b/tidylib-src/test/input/cfg_427835.txt deleted file mode 100755 index 547e5244..00000000 --- a/tidylib-src/test/input/cfg_427835.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #427835 -output-xhtml: yes diff --git a/tidylib-src/test/input/cfg_427837.txt b/tidylib-src/test/input/cfg_427837.txt deleted file mode 100755 index d0a3ff97..00000000 --- a/tidylib-src/test/input/cfg_427837.txt +++ /dev/null @@ -1,5 +0,0 @@ -// Tidy configuration file for bug #427837 -// add-xml-decl: yes -input-xml: yes -output-xml: yes -char-encoding: latin1 diff --git a/tidylib-src/test/input/cfg_427839.txt b/tidylib-src/test/input/cfg_427839.txt deleted file mode 100755 index e5ec6e5e..00000000 --- a/tidylib-src/test/input/cfg_427839.txt +++ /dev/null @@ -1,3 +0,0 @@ -// Tidy configuration file for bug #427839 -output-xhtml: yes -doctype: omit \ No newline at end of file diff --git a/tidylib-src/test/input/cfg_427845.txt b/tidylib-src/test/input/cfg_427845.txt deleted file mode 100755 index 2169624d..00000000 --- a/tidylib-src/test/input/cfg_427845.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #427845 -wrap: 60 \ No newline at end of file diff --git a/tidylib-src/test/input/cfg_431716.txt b/tidylib-src/test/input/cfg_431716.txt deleted file mode 100755 index afc3a5ad..00000000 --- a/tidylib-src/test/input/cfg_431716.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #431716 -split: yes \ No newline at end of file diff --git a/tidylib-src/test/input/cfg_431721.txt b/tidylib-src/test/input/cfg_431721.txt deleted file mode 100755 index ab04c701..00000000 --- a/tidylib-src/test/input/cfg_431721.txt +++ /dev/null @@ -1,11 +0,0 @@ -// Tidy configuration file for bug #431721 -indent: auto -new-inline-tags: o:p -char-encoding: latin1 -tidy-mark: no -clean: yes -drop-font-tags: yes -logical-emphasis: yes -word-2000: yes -indent-attributes: yes - diff --git a/tidylib-src/test/input/cfg_431736.txt b/tidylib-src/test/input/cfg_431736.txt deleted file mode 100755 index e7643211..00000000 --- a/tidylib-src/test/input/cfg_431736.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #431736 -output-xhtml: yes diff --git a/tidylib-src/test/input/cfg_431889.txt b/tidylib-src/test/input/cfg_431889.txt deleted file mode 100755 index 3dc21a66..00000000 --- a/tidylib-src/test/input/cfg_431889.txt +++ /dev/null @@ -1,3 +0,0 @@ -// Config file for bug [ #431889 ] Config file options w/"param" don't work -doctype: "-//ACME//DTD HTML 3.14159//EN" -alt-text: "Alternate" \ No newline at end of file diff --git a/tidylib-src/test/input/cfg_431895.txt b/tidylib-src/test/input/cfg_431895.txt deleted file mode 100755 index 41584939..00000000 --- a/tidylib-src/test/input/cfg_431895.txt +++ /dev/null @@ -1,4 +0,0 @@ -// Tidy configuration file for bug #431895 -quiet: yes -markup: no -gnu-emacs: yes \ No newline at end of file diff --git a/tidylib-src/test/input/cfg_431956.txt b/tidylib-src/test/input/cfg_431956.txt deleted file mode 100755 index 15c73145..00000000 --- a/tidylib-src/test/input/cfg_431956.txt +++ /dev/null @@ -1,3 +0,0 @@ -// Tidy configuration file for bug #431956 -input-xml: yes -output-xml: yes diff --git a/tidylib-src/test/input/cfg_431958.txt b/tidylib-src/test/input/cfg_431958.txt deleted file mode 100755 index 990c0130..00000000 --- a/tidylib-src/test/input/cfg_431958.txt +++ /dev/null @@ -1,4 +0,0 @@ -// Tidy configuration file for bug #431958 -// Warning - this will modify the INPUT file (each time it is run) -indent: auto -write-back: yes \ No newline at end of file diff --git a/tidylib-src/test/input/cfg_432677.txt b/tidylib-src/test/input/cfg_432677.txt deleted file mode 100755 index 4e73e6dd..00000000 --- a/tidylib-src/test/input/cfg_432677.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #432677 -output-xml: yes diff --git a/tidylib-src/test/input/cfg_433604.txt b/tidylib-src/test/input/cfg_433604.txt deleted file mode 100755 index 2a03e4c9..00000000 --- a/tidylib-src/test/input/cfg_433604.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #433604 -input-xml: yes diff --git a/tidylib-src/test/input/cfg_433607.txt b/tidylib-src/test/input/cfg_433607.txt deleted file mode 100755 index e4478c3f..00000000 --- a/tidylib-src/test/input/cfg_433607.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #433607 -input-xml: yes diff --git a/tidylib-src/test/input/cfg_433670.txt b/tidylib-src/test/input/cfg_433670.txt deleted file mode 100755 index 9cc682f5..00000000 --- a/tidylib-src/test/input/cfg_433670.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #433670 -input-xml: yes diff --git a/tidylib-src/test/input/cfg_433856.txt b/tidylib-src/test/input/cfg_433856.txt deleted file mode 100755 index c61c8293..00000000 --- a/tidylib-src/test/input/cfg_433856.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #433856 -drop-font-tags: yes \ No newline at end of file diff --git a/tidylib-src/test/input/cfg_434100.txt b/tidylib-src/test/input/cfg_434100.txt deleted file mode 100755 index 713d5d5d..00000000 --- a/tidylib-src/test/input/cfg_434100.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #434100 -input-xml: yes \ No newline at end of file diff --git a/tidylib-src/test/input/cfg_434940.txt b/tidylib-src/test/input/cfg_434940.txt deleted file mode 100755 index 1e174070..00000000 --- a/tidylib-src/test/input/cfg_434940.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #434940 -show-body-only: yes \ No newline at end of file diff --git a/tidylib-src/test/input/cfg_438954.txt b/tidylib-src/test/input/cfg_438954.txt deleted file mode 100755 index bb4e33b0..00000000 --- a/tidylib-src/test/input/cfg_438954.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #438954 -hide-endtags: yes \ No newline at end of file diff --git a/tidylib-src/test/input/cfg_444394.txt b/tidylib-src/test/input/cfg_444394.txt deleted file mode 100755 index 0048a266..00000000 --- a/tidylib-src/test/input/cfg_444394.txt +++ /dev/null @@ -1,11 +0,0 @@ -// Tidy configuration file for bug #444394 -indent: auto -new-inline-tags: o:p -char-encoding: latin1 -tidy-mark: no -clean: yes -drop-font-tags: yes -logical-emphasis: yes -word-2000: yes -indent-attributes: yes - diff --git a/tidylib-src/test/input/cfg_449348.txt b/tidylib-src/test/input/cfg_449348.txt deleted file mode 100755 index 8717b2cf..00000000 --- a/tidylib-src/test/input/cfg_449348.txt +++ /dev/null @@ -1 +0,0 @@ -output-xhtml: yes diff --git a/tidylib-src/test/input/cfg_463066.txt b/tidylib-src/test/input/cfg_463066.txt deleted file mode 100755 index 682eb3f8..00000000 --- a/tidylib-src/test/input/cfg_463066.txt +++ /dev/null @@ -1,3 +0,0 @@ -// Tidy configuration file for bug #463066 -word-2000: yes - diff --git a/tidylib-src/test/input/cfg_470663.txt b/tidylib-src/test/input/cfg_470663.txt deleted file mode 100755 index f00aace1..00000000 --- a/tidylib-src/test/input/cfg_470663.txt +++ /dev/null @@ -1,3 +0,0 @@ -// Tidy configuration file for bug #470663 -word-2000: yes - diff --git a/tidylib-src/test/input/cfg_473490.txt b/tidylib-src/test/input/cfg_473490.txt deleted file mode 100755 index 55679514..00000000 --- a/tidylib-src/test/input/cfg_473490.txt +++ /dev/null @@ -1,11 +0,0 @@ -// Tidy configuration file for bug #473490 -tidy-mark: no -wrap: 0 -output-xhtml: yes -doctype: auto -quote-nbsp: yes -uppercase-tags: yes -quote-ampersand: yes -add-xml-space: no -show-warnings:no -quiet: yes diff --git a/tidylib-src/test/input/cfg_480406.txt b/tidylib-src/test/input/cfg_480406.txt deleted file mode 100755 index 50bc5f57..00000000 --- a/tidylib-src/test/input/cfg_480406.txt +++ /dev/null @@ -1,3 +0,0 @@ -// Tidy configuration file for bug #480406 -input-xml: yes -output-xml: yes diff --git a/tidylib-src/test/input/cfg_480701.txt b/tidylib-src/test/input/cfg_480701.txt deleted file mode 100755 index 9d95a808..00000000 --- a/tidylib-src/test/input/cfg_480701.txt +++ /dev/null @@ -1,3 +0,0 @@ -// Tidy configuration file for bug #480701 -input-xml: yes -output-xhtml: yes diff --git a/tidylib-src/test/input/cfg_480843.txt b/tidylib-src/test/input/cfg_480843.txt deleted file mode 100755 index b49a0b45..00000000 --- a/tidylib-src/test/input/cfg_480843.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #480843 -output-xhtml: yes diff --git a/tidylib-src/test/input/cfg_500236.txt b/tidylib-src/test/input/cfg_500236.txt deleted file mode 100755 index 410fadfb..00000000 --- a/tidylib-src/test/input/cfg_500236.txt +++ /dev/null @@ -1,5 +0,0 @@ -// Tidy configuration file for bug #500236 -word-2000: yes -input-xml: yes -output-xml: yes - diff --git a/tidylib-src/test/input/cfg_503436.txt b/tidylib-src/test/input/cfg_503436.txt deleted file mode 100755 index 8a380d20..00000000 --- a/tidylib-src/test/input/cfg_503436.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #503436 -input-xml: yes diff --git a/tidylib-src/test/input/cfg_508936.txt b/tidylib-src/test/input/cfg_508936.txt deleted file mode 100755 index ba9c0e97..00000000 --- a/tidylib-src/test/input/cfg_508936.txt +++ /dev/null @@ -1,19 +0,0 @@ -clean: yes - -# Error 1: escaped number too long. Max 4 hex digits -# css-prefix: \77777abc - -# Error 2: class prefix starts with digit -# css-prefix: 77abc - -# Error 3: Unescaped invalid character -# css-prefix: abc - -# OK 1: Plain old name -# css-prefix: abc123 - -# OK 2: Begin w/ escaped number -# css-prefix: \77abc - -# OK 3: escaped number -css-prefix: abc\8 diff --git a/tidylib-src/test/input/cfg_511243.txt b/tidylib-src/test/input/cfg_511243.txt deleted file mode 100755 index c305be86..00000000 --- a/tidylib-src/test/input/cfg_511243.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #511243 -char-encoding: utf8 diff --git a/tidylib-src/test/input/cfg_514348.txt b/tidylib-src/test/input/cfg_514348.txt deleted file mode 100755 index a0afb0c6..00000000 --- a/tidylib-src/test/input/cfg_514348.txt +++ /dev/null @@ -1,4 +0,0 @@ -// Tidy configuration file for bug #514348 -uppercase-tags: true -indent: auto -indent-spaces: 2 \ No newline at end of file diff --git a/tidylib-src/test/input/cfg_517550.txt b/tidylib-src/test/input/cfg_517550.txt deleted file mode 100755 index b94453ec..00000000 --- a/tidylib-src/test/input/cfg_517550.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #517550 -output-xhtml: yes diff --git a/tidylib-src/test/input/cfg_531964.txt b/tidylib-src/test/input/cfg_531964.txt deleted file mode 100755 index 2d18ab5f..00000000 --- a/tidylib-src/test/input/cfg_531964.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug 531964 -output-xhtml: yes diff --git a/tidylib-src/test/input/cfg_532535.txt b/tidylib-src/test/input/cfg_532535.txt deleted file mode 100755 index 27188213..00000000 --- a/tidylib-src/test/input/cfg_532535.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #532535 -word-2000: yes diff --git a/tidylib-src/test/input/cfg_533233.txt b/tidylib-src/test/input/cfg_533233.txt deleted file mode 100755 index 1de4c82c..00000000 --- a/tidylib-src/test/input/cfg_533233.txt +++ /dev/null @@ -1,2 +0,0 @@ -output-xhtml: yes -indent: auto diff --git a/tidylib-src/test/input/cfg_537604.txt b/tidylib-src/test/input/cfg_537604.txt deleted file mode 100755 index c41660fb..00000000 --- a/tidylib-src/test/input/cfg_537604.txt +++ /dev/null @@ -1,3 +0,0 @@ -// Tidy configuration file for bug #537604 -input-xml: yes -clean: no diff --git a/tidylib-src/test/input/cfg_540045.txt b/tidylib-src/test/input/cfg_540045.txt deleted file mode 100755 index d0a1e859..00000000 --- a/tidylib-src/test/input/cfg_540045.txt +++ /dev/null @@ -1,11 +0,0 @@ -// Tidy configuration file for bug #540045 -wrap: 64 -indent: no -indent-spaces: 4 -add-xml-decl: yes -#output-xhtml: yes -break-before-br: yes -clean: yes -logical-emphasis: yes -enclose-text: yes -enclose-block-text: yes diff --git a/tidylib-src/test/input/cfg_540571.txt b/tidylib-src/test/input/cfg_540571.txt deleted file mode 100755 index 48a1c073..00000000 --- a/tidylib-src/test/input/cfg_540571.txt +++ /dev/null @@ -1,4 +0,0 @@ -// Tidy configuration file for bug #540571 Inconsistent behaviour with span inline element -output-xml: yes -wrap: 255 -clean: no diff --git a/tidylib-src/test/input/cfg_542029.txt b/tidylib-src/test/input/cfg_542029.txt deleted file mode 100755 index 5b27d6f1..00000000 --- a/tidylib-src/test/input/cfg_542029.txt +++ /dev/null @@ -1,3 +0,0 @@ -// Tidy configuration file for bug #542029 -add-xml-decl: yes -output-xml: yes diff --git a/tidylib-src/test/input/cfg_543262.txt b/tidylib-src/test/input/cfg_543262.txt deleted file mode 100755 index 02ead1fa..00000000 --- a/tidylib-src/test/input/cfg_543262.txt +++ /dev/null @@ -1,5 +0,0 @@ -doctype: omit -output-xhtml: yes -char-encoding: latin1 -numeric-entities: yes -quiet: yes diff --git a/tidylib-src/test/input/cfg_545772.txt b/tidylib-src/test/input/cfg_545772.txt deleted file mode 100755 index dcbc2ade..00000000 --- a/tidylib-src/test/input/cfg_545772.txt +++ /dev/null @@ -1,2 +0,0 @@ -// Tidy configuration file for bug #547057 -output-xhtml: yes diff --git a/tidylib-src/test/input/cfg_570027.txt b/tidylib-src/test/input/cfg_570027.txt deleted file mode 100755 index 82c04c95..00000000 --- a/tidylib-src/test/input/cfg_570027.txt +++ /dev/null @@ -1,4 +0,0 @@ -// Tidy configuration file for bug 570027 -clean: yes -word-2000: yes - diff --git a/tidylib-src/test/input/cfg_586555.txt b/tidylib-src/test/input/cfg_586555.txt deleted file mode 100755 index f458aea1..00000000 --- a/tidylib-src/test/input/cfg_586555.txt +++ /dev/null @@ -1,25 +0,0 @@ -wrap: 68 -tab-size: 4 -repeated-attributes: keep-last -alt-text: None, says tidy -show-warnings: no -quiet: yes -indent: auto -indent-attributes: yes -output-xml: yes -output-xhtml: yes -add-xml-decl: yes -bare: yes -logical-emphasis: yes -drop-proprietary-attributes: yes -break-before-br: yes -quote-nbsp: no -assume-xml-procins: yes -keep-time: no -word-2000: yes -tidy-mark: no -literal-attributes: yes -hide-comments: yes -ascii-chars: no -join-styles: no -output-bom: no diff --git a/tidylib-src/test/input/cfg_default.txt b/tidylib-src/test/input/cfg_default.txt deleted file mode 100755 index 5fd52cf6..00000000 --- a/tidylib-src/test/input/cfg_default.txt +++ /dev/null @@ -1,10 +0,0 @@ -// HTML Tidy configuration file created by TidyGUI -indent: auto -char-encoding: latin1 -tidy-mark: no -clean: yes -drop-font-tags: yes -logical-emphasis: yes -indent-attributes: yes -// output-xhtml: yes - diff --git a/tidylib-src/test/input/in_426885.html b/tidylib-src/test/input/in_426885.html deleted file mode 100755 index be3296b9..00000000 --- a/tidylib-src/test/input/in_426885.html +++ /dev/null @@ -1,15 +0,0 @@ - - -[ #426885 ] Definition list w/Center crashes - - -

Heading 1

-
Term 1
-
Term 2
-

Heading 2

-
    -
    Term 3
    -
    Term 4
    -
- - \ No newline at end of file diff --git a/tidylib-src/test/input/in_427633.html b/tidylib-src/test/input/in_427633.html deleted file mode 100755 index d3637f23..00000000 --- a/tidylib-src/test/input/in_427633.html +++ /dev/null @@ -1,10 +0,0 @@ - - - [#427663] Line endings not supported correctly - - -

This is a carriage return This is a Unix line-ending -This is a DOS line ending - - - diff --git a/tidylib-src/test/input/in_427662.html b/tidylib-src/test/input/in_427662.html deleted file mode 100755 index cbaebe97..00000000 --- a/tidylib-src/test/input/in_427662.html +++ /dev/null @@ -1,10 +0,0 @@ - - - [#427662] BLOCK/INLINE before TABLE parsed wrong - - - -Big and bold Big -
- - diff --git a/tidylib-src/test/input/in_427664.html b/tidylib-src/test/input/in_427664.html deleted file mode 100755 index 3c7b22da..00000000 --- a/tidylib-src/test/input/in_427664.html +++ /dev/null @@ -1,9 +0,0 @@ - - - [#427664] Missing attr values cause NULL segfault - - - -text - - diff --git a/tidylib-src/test/input/in_427671.html b/tidylib-src/test/input/in_427671.html deleted file mode 100755 index 879970b8..00000000 --- a/tidylib-src/test/input/in_427671.html +++ /dev/null @@ -1,15 +0,0 @@ - - - [#427671] <LI> w/FRAME/FRAMESET/OPTGROUP/OPTION loop - - -

    -
  • first item
  • -
  • frame item
  • -
  • frameset item
  • -
  • optgroup item
  • -
  • -
  • last item
  • -
- - diff --git a/tidylib-src/test/input/in_427672.html b/tidylib-src/test/input/in_427672.html deleted file mode 100755 index 1b08d21d..00000000 --- a/tidylib-src/test/input/in_427672.html +++ /dev/null @@ -1,9 +0,0 @@ - - - [#427672] Non-std attrs w/multibyte names segfault - - - -text - - diff --git a/tidylib-src/test/input/in_427675.html b/tidylib-src/test/input/in_427675.html deleted file mode 100755 index 2cc55974..00000000 --- a/tidylib-src/test/input/in_427675.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - -This text belongs in a noframes element. - diff --git a/tidylib-src/test/input/in_427676.html b/tidylib-src/test/input/in_427676.html deleted file mode 100755 index d47f42c0..00000000 --- a/tidylib-src/test/input/in_427676.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - -

This is a Red link

- - diff --git a/tidylib-src/test/input/in_427677.html b/tidylib-src/test/input/in_427677.html deleted file mode 100755 index 2a7c241e..00000000 --- a/tidylib-src/test/input/in_427677.html +++ /dev/null @@ -1,10 +0,0 @@ - - - [ #427677 ] TrimInitialSpace() can trim too much - - -

This is a Red - - link

- - diff --git a/tidylib-src/test/input/in_427810.html b/tidylib-src/test/input/in_427810.html deleted file mode 100755 index 997d320e..00000000 --- a/tidylib-src/test/input/in_427810.html +++ /dev/null @@ -1,13 +0,0 @@ - - -[ #427810 ] Proprietary elements not reported as err - - - -

Test inline element

-Proprietary inline element (blink) -Proprietary inline element (wbr) - note starts on new line, doesn't need end tag -Proprietary inline element (nobr) -

Test inline element

- - diff --git a/tidylib-src/test/input/in_427811.html b/tidylib-src/test/input/in_427811.html deleted file mode 100755 index b5f94496..00000000 --- a/tidylib-src/test/input/in_427811.html +++ /dev/null @@ -1,16 +0,0 @@ - - - [#427811] FRAME inside NOFRAME infinite loop - - - - <body bgcolor="#000000" text="#ffffff"> - <h1>Need a Frame Capable Browser!</h1> - <frame src="body.html" name="p2"> - </body> - - diff --git a/tidylib-src/test/input/in_427812.xhtml b/tidylib-src/test/input/in_427812.xhtml deleted file mode 100755 index 69575186..00000000 --- a/tidylib-src/test/input/in_427812.xhtml +++ /dev/null @@ -1,15 +0,0 @@ - - - - -[ #427812 ] Reprocessing OBJECT removes PARAM - - - - - - - - diff --git a/tidylib-src/test/input/in_427813.html b/tidylib-src/test/input/in_427813.html deleted file mode 100755 index 26c3d5a9..00000000 --- a/tidylib-src/test/input/in_427813.html +++ /dev/null @@ -1,8 +0,0 @@ - - - [#427813] Missing = from attr value segfaults - - -text - - diff --git a/tidylib-src/test/input/in_427816.html b/tidylib-src/test/input/in_427816.html deleted file mode 100755 index 7fbe57ce..00000000 --- a/tidylib-src/test/input/in_427816.html +++ /dev/null @@ -1,8 +0,0 @@ - - - [ #427816 ] Mismatched quotes for attr segfaults - - -blah - - diff --git a/tidylib-src/test/input/in_427818.html b/tidylib-src/test/input/in_427818.html deleted file mode 100755 index 6bfcd64e..00000000 --- a/tidylib-src/test/input/in_427818.html +++ /dev/null @@ -1,10 +0,0 @@ - - - -[ #427818 ] Missing quotes cause segfaults - - -link - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_427819.html b/tidylib-src/test/input/in_427819.html deleted file mode 100755 index efc4c0ba..00000000 --- a/tidylib-src/test/input/in_427819.html +++ /dev/null @@ -1,17 +0,0 @@ - - -[ #427819 ] OPTION w/illegal FONT eats whitespace - - -
- -
- - \ No newline at end of file diff --git a/tidylib-src/test/input/in_427820.html b/tidylib-src/test/input/in_427820.html deleted file mode 100755 index e3e76808..00000000 --- a/tidylib-src/test/input/in_427820.html +++ /dev/null @@ -1,14 +0,0 @@ - - - Test Input For Bug #427820 - - - - - - -

-
- - - diff --git a/tidylib-src/test/input/in_427821.html b/tidylib-src/test/input/in_427821.html deleted file mode 100755 index bf794b61..00000000 --- a/tidylib-src/test/input/in_427821.html +++ /dev/null @@ -1,13 +0,0 @@ - - - -[ #427821 ] XHTML TRANSITIONAL doctype set wrongly - - - -<body> -This is a test - use "-asxml" on the command line. -</body> - - - diff --git a/tidylib-src/test/input/in_427822.html b/tidylib-src/test/input/in_427822.html deleted file mode 100755 index 074f2787..00000000 --- a/tidylib-src/test/input/in_427822.html +++ /dev/null @@ -1,10 +0,0 @@ - - -[ #427822 ] PopInLine() doesn't check stack - - -
-
abc
-
- - \ No newline at end of file diff --git a/tidylib-src/test/input/in_427823.html b/tidylib-src/test/input/in_427823.html deleted file mode 100755 index 7c386c0c..00000000 --- a/tidylib-src/test/input/in_427823.html +++ /dev/null @@ -1,18 +0,0 @@ - - -[ #427823 ] Multiple <BODY>'s in <NOFRAMES> allowed - - - - -<body> -Text in body 1. -</body> -<body> -Text in illegal body 2. -</body> -Text in inferred illegal body 3. - - - -Text in inferred illegal body 4. diff --git a/tidylib-src/test/input/in_427825.html b/tidylib-src/test/input/in_427825.html deleted file mode 100755 index e272db63..00000000 --- a/tidylib-src/test/input/in_427825.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - Test user defined tags - bug #427825 - - - Test-1Test-3 - - diff --git a/tidylib-src/test/input/in_427826.html b/tidylib-src/test/input/in_427826.html deleted file mode 100755 index 4b8fbd54..00000000 --- a/tidylib-src/test/input/in_427826.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - -[#427826] Script source needs escaping/CDATA section - - - - - - -

If converted to XML/XHTML, the < in the javascript source -above causes problems for XML tools.

- - - diff --git a/tidylib-src/test/input/in_427827.html b/tidylib-src/test/input/in_427827.html deleted file mode 100755 index f01e66a7..00000000 --- a/tidylib-src/test/input/in_427827.html +++ /dev/null @@ -1,9 +0,0 @@ - - -[ #427827 ] Nested anchor elements allowed - - -link-1 link-2 -plain - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_427830.html b/tidylib-src/test/input/in_427830.html deleted file mode 100755 index 345625b1..00000000 --- a/tidylib-src/test/input/in_427830.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - Test Input For Bug #427830 - - -

Tidy uses an incorrect XHTML 1.0 Namespace, - even if the correct namespace is given.

- - diff --git a/tidylib-src/test/input/in_427833.html b/tidylib-src/test/input/in_427833.html deleted file mode 100755 index 4ad987ba..00000000 --- a/tidylib-src/test/input/in_427833.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - Escape sequences - - -

#include <stdio.h>

-

#include <stdio.h>

-

#include <stdio.h>

- - diff --git a/tidylib-src/test/input/in_427834.html b/tidylib-src/test/input/in_427834.html deleted file mode 100755 index 76d6bca6..00000000 --- a/tidylib-src/test/input/in_427834.html +++ /dev/null @@ -1,10 +0,0 @@ - - - -[ #427834 ] Warning given for newline in DOCTYPE - - - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_427835.html b/tidylib-src/test/input/in_427835.html deleted file mode 100755 index d5c67487..00000000 --- a/tidylib-src/test/input/in_427835.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - -Test input file for bug #427835 - - -

Test input file for bug #427835

-

Use with or without the -asxhtml option.

-

-clean has no effect

- - diff --git a/tidylib-src/test/input/in_427836.html b/tidylib-src/test/input/in_427836.html deleted file mode 100755 index dbb39f60..00000000 --- a/tidylib-src/test/input/in_427836.html +++ /dev/null @@ -1,5 +0,0 @@ - - diff --git a/tidylib-src/test/input/in_427837.xml b/tidylib-src/test/input/in_427837.xml deleted file mode 100755 index e5feff0b..00000000 --- a/tidylib-src/test/input/in_427837.xml +++ /dev/null @@ -1,4 +0,0 @@ - - Björn Höhrmann - Marc-André Lemburg - diff --git a/tidylib-src/test/input/in_427838.html b/tidylib-src/test/input/in_427838.html deleted file mode 100755 index c51c4152..00000000 --- a/tidylib-src/test/input/in_427838.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - -[ #427838 ] Name Anchor thrown away - - -A fragment of html created by Frontpage..... -

Clipboard

- -lots more stuff deleted.... - - -some text -some text - - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_427839.html b/tidylib-src/test/input/in_427839.html deleted file mode 100755 index ac83fc27..00000000 --- a/tidylib-src/test/input/in_427839.html +++ /dev/null @@ -1,8 +0,0 @@ - - -Test Input For Bug #427839 - - -This is a test. Use "-asxhtml --doctype omit" on the command line. - - diff --git a/tidylib-src/test/input/in_427840.html b/tidylib-src/test/input/in_427840.html deleted file mode 100755 index 280aa798..00000000 --- a/tidylib-src/test/input/in_427840.html +++ /dev/null @@ -1,8 +0,0 @@ - -[ #427840 ] Span causes infinite loop - - -

Inside a span.

- - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_427841.html b/tidylib-src/test/input/in_427841.html deleted file mode 100755 index d78b8dd6..00000000 --- a/tidylib-src/test/input/in_427841.html +++ /dev/null @@ -1,31 +0,0 @@ - - -Test input for bug #427841 - - -

Tidy crashes on badly formed HTML -involving nested lists. - -

- -
    -
  • Merge adjacent lists -
- -
    - - - - - diff --git a/tidylib-src/test/input/in_427844.html b/tidylib-src/test/input/in_427844.html deleted file mode 100755 index a0445d19..00000000 --- a/tidylib-src/test/input/in_427844.html +++ /dev/null @@ -1,13 +0,0 @@ - - -[ #427844 ] End tags containing whitespace warning \ No newline at end of file diff --git a/tidylib-src/test/input/in_427845.html b/tidylib-src/test/input/in_427845.html deleted file mode 100755 index 0c599cb0..00000000 --- a/tidylib-src/test/input/in_427845.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -[ #427845 ] Doctypes are output on multiple lines - - -Use "--wrap 60" on the command line - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_427846.html b/tidylib-src/test/input/in_427846.html deleted file mode 100755 index 4d0da4e9..00000000 --- a/tidylib-src/test/input/in_427846.html +++ /dev/null @@ -1,13 +0,0 @@ - - - Test Input For Bug #427846 - - - -
    -text-one -
    -text-two -
    - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_431716.html b/tidylib-src/test/input/in_431716.html deleted file mode 100755 index 9edcf798..00000000 --- a/tidylib-src/test/input/in_431716.html +++ /dev/null @@ -1,377 +0,0 @@ - - - - - - - -civRights2 - - -

    Civil Rights #2

    - -

    Overview

    - -
      -
    • Who are you protected from?
    • - -
    • How are you supposed to do anything about it?
    • - -
    • Why do protections grow and shrink?
    • - -
    • Rights of women
    • - -
    • Rights of disabled people
    • - -
    • Native Americans
    • -
    - -

    Who are you protected from?

    - -
      -
    • "State government" under 14th Amendment
    • - -
    • -
        -
      • Sex/race, not age!
      • - -
      • People who act "on behalf" of state government
      • -
      -
    • -
    - -

    Who are you protected from?

    - -
      -
    • "State government" under 14th Amendment
    • - -
    • -
        -
      • Sex/race, not age!
      • - -
      • People who act "on behalf" of state government
      • -
      -
    • - -
    • Federal Government Contractors
    • -
    - -

    Who are you protected from?

    - -
      -
    • "State government" under 14th Amendment
    • - -
    • -
        -
      • Sex/race, not age!
      • - -
      • People who act "on behalf" of state government
      • -
      -
    • - -
    • Federal Government Contractors
    • - -
    • Anybody Congress can regulate under the commerce clause
    • - -
    • -
        -
      • Civil Rights Acts (1866, 1964, 1991)
      • -
      -
    • -
    - -

    How are rules enforced?

    - -
      -
    1. Criminal prosecution
    2. -
    - -

    How are rules enforced?

    - -
      -
    1. Criminal prosecution
    2. - -
    3. EEOC complaint
    4. - -
    5. -
        -
      1. Lawsuit for back pay and reinstatement
      2. - -
      3. Affirmative Action order.
      4. -
      -
    6. -
    - -

    How are rules enforced?

    - -
      -
    1. Criminal prosecution
    2. - -
    3. EEOC complaint
    4. - -
    5. -
        -
      1. Lawsuit for back pay and reinstatement
      2. - -
      3. Affirmative Action order.
      4. -
      -
    6. - -
    7. Private lawsuit--financial compensation
    8. -
    - -

    What about Affirmative Action?

    - -
      -
    • what is it?
    • -
    - -

    What about Affirmative Action?

    - -
      -
    • what is it?
    • - -
    • reverse discrimination
    • -
    - -

    What about Affirmative Action?

    - -
      -
    • what is it?
    • - -
    • reverse discrimination
    • - -
    • diversity policy and the University
    • - -
    • -
        -
      • Bakke's lawsuit & followups
      • -
      -
    • - -
    • diversity in government contracting: quotas?
    • -
    - -

    Why do protections grow and shrink?

    - -
      -
    • Courts have limited government intervention in society
    • - -
    • Is protest necessary?
    • - -
    • -
        -
      •  Need to "get attention"
      • - -
      • Maybe if you don't have a good lawyer...
      • -
      -
    • - -
    • Terrorism/violence usually "counter productive"
    • -
    - -

    Racial Minorities

    - -
      -
    • 14th shrank in response to Court decisions and politics
    • - -
    • Some protections won through legal action
    • - -
    • Biggest protections result from nonviolent action
    • -
    - -

    Rights of Women

    - -
      -
    • Long era of "protectionism"
    • -
    - -

    Rights of Women

    - -
      -
    • Long era of "protectionism"
    • - -
    • excluded from many professions
    • -
    - -

    Rights of Women

    - -
      -
    • Long era of "protectionism"
    • - -
    • excluded from many professions
    • - -
    • couldn't vote
    • - -
    • own property
    • -
    - -

    Equal Rights Amendments

    - -
      -
    • Remember the 14th Amendment?
    • -
    - -

    Equal Rights Amendments

    - -
      -
    • Remember the 14th Amendment?
    • - -
    • ERA proposed by Congress 1972. Failed.
    • -
    - -

    Equal Rights Amendments

    - -
      -
    • Remember the 14th Amendment?
    • - -
    • ERA proposed by Congress 1972. Failed.
    • - -
    • 1970s: Revival of 14th for women.
    • - -
    • -
        -
      • Sexual classifications no longer allowed by State without -persuasive justification
      • -
      -
    • -
    - -

    Women in the Labor Force

    - -
      -
    • Why do women earn less?
    • - -
    • -
        -
      • Job type
      • - -
      • Skill
      • - -
      • Discrimination
      • -
      -
    • -
    - -

    Women in the Labor Force

    - -
      -
    • Why do women earn less?
    • - -
    • -
        -
      • Job type
      • - -
      • Skill
      • - -
      • Discrimination
      • -
      -
    • - -
    • 1964 CRA included "sex" but...
    • - -
    • EEOC  initially refused to pursue sex discrimination -cases
    • -
    - -

    Women in the Labor Force

    - -
      -
    • Why do women earn less?
    • - -
    • -
        -
      • Job type
      • - -
      • Skill
      • - -
      • Discrimination
      • -
      -
    • - -
    • 1964 CRA included "sex" but...
    • - -
    • EEOC  initially refused to pursue sex discrimination -cases
    • - -
    • 1991 CRA: restated 1866 CRA right to sue for $ damages for -discrimination or sexual harassment.
    • -
    - -

    Higher Education

    - -
      -
    • Higher Educ. Act, Title IX (1972)  Prohibit sex -discrimination in fed. funded programs
    • - -
    • Rising emphasis on women's athletics
    • - -
    • Backlash in some states (California, Texas)
    • -
    - -

    Rights of disabled people

    - -
      -
    • 1973 Federal law prohibited discrimination by federal -contractors
    • - -
    • -
        -
      • must not discriminate against an otherwise qualified person -solely by reason of handicap
      • -
      -
    • -
    - -

    Rights of disabled people

    - -
      -
    • 1973 Federal law prohibited discrimination by federal -contractors
    • - -
    • -
        -
      • must not discriminate against an otherwise qualified person -solely by reason of handicap
      • -
      -
    • - -
    • 1990 Americans with Disabilities Act
    • - -
    • -
        -
      • extends protection to businesses and public accommodations -(commerce clause)
      • - -
      • requires reasonable accommodation
      • -
      -
    • -
    - -

    Politics and Native American Rights

    - -
      -
    • Battle on 2 fronts
    • - -
    • -
        -
      • Tribal autonomy & relations with US/BIA
      • - -
      • Opportunities within "mainstream" US
      • -
      -
    • - -
    • State Government and the 14th amendment
    • - -
    • -
        -
      • Complicated peyote story
      • -
      -
    • -
    - - - - diff --git a/tidylib-src/test/input/in_431719.html b/tidylib-src/test/input/in_431719.html deleted file mode 100755 index 341546ec..00000000 --- a/tidylib-src/test/input/in_431719.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - Test input for bug #431719 - - -

    Problem is spec want "HTML 3.2 Final", but everyone - in the world, including Tidy, uses "HTML 3.2". So the - software has to recognize both FPI's as equivalent. - - - - - -
    Missing table summary only applies to HTML 4.x
    - - diff --git a/tidylib-src/test/input/in_431721.html b/tidylib-src/test/input/in_431721.html deleted file mode 100755 index 5d851a1b..00000000 --- a/tidylib-src/test/input/in_431721.html +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - -Joe-Bob Briggs LLP - - - - - - -

    - -

    Joe-Bob Briggs LLP

    - -

     

    - -

    Bryan -Joe-Bob LLP is a leading national and international corporate, litigation and -private client law firm.  We represent a -wide variety of business, institutional and individual clients for whom our -lawyers handle a wide range of matters.  -As a result, our lawyers are well prepared to meet the needs of clients -whether large or small, public or private, for-profit or not-for-profit.

    - -

     

    - -

    Joe-Bob -Briggs has more offices than you can shake a stick at.  -These locations give Joe-Bob the geographic reach to assist his -clients where their needs are most pressing.

    - -

    ·         -Estate Planning

    - -

    ·         -Closely-Held Business Practice

    - -

    ·         -Estate, Gift, Income and Other Tax Advice

    - -

     

    - -

    Joe-Bob -joined the Firm in 1995 after 15 years with the Kansas City firm of Fish, -Gill, Smoker & Butts, where he was a Shareholder/Director.  John is a past Chair of the Estate Planning, -Probate and Trust Committee of the Kansas City Metropolitan Bar Association and -co-authored the Drinking Procedures Manual for County -Practitioners.  Currently, JB is a -member of the Missouri Bar Probate and Trust Committee, the Estate Planning Society -and the Mid-America Planned Giving Council.  -A fellow of the American College of Trust and Estate Counsel, JB -lectures frequently on Estate Planning topics for both legal and lay -organizations. 

    - -

     

    - -
    - - - - - diff --git a/tidylib-src/test/input/in_431731.html b/tidylib-src/test/input/in_431731.html deleted file mode 100755 index 16850537..00000000 --- a/tidylib-src/test/input/in_431731.html +++ /dev/null @@ -1,9 +0,0 @@ - - -[ #431731 ] Inline emphasis inconsistent propagation - - -OUTSIDE
    -OUTSIDE - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_431736.html b/tidylib-src/test/input/in_431736.html deleted file mode 100755 index b8b46c3f..00000000 --- a/tidylib-src/test/input/in_431736.html +++ /dev/null @@ -1,9 +0,0 @@ - - - - [#431736] Doctype decl added before XML decl - - -

    Run tidy w/ -asxhtml or -asxml options...

    - - diff --git a/tidylib-src/test/input/in_431739.html b/tidylib-src/test/input/in_431739.html deleted file mode 100755 index 86b2a1f5..00000000 --- a/tidylib-src/test/input/in_431739.html +++ /dev/null @@ -1,9 +0,0 @@ - - - [#431739] Spaces carried into empty block tags - - -This is a test -
    Example - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_431874.html b/tidylib-src/test/input/in_431874.html deleted file mode 100755 index 3af169c3..00000000 --- a/tidylib-src/test/input/in_431874.html +++ /dev/null @@ -1,6 +0,0 @@ - -Test for bug #431874 - -Test for bug #431874 - - diff --git a/tidylib-src/test/input/in_431883.html b/tidylib-src/test/input/in_431883.html deleted file mode 100755 index b54a620d..00000000 --- a/tidylib-src/test/input/in_431883.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - -Bug-2000-12-27-A [ #431883 ] Given doctype reported incorrectly - - - - - - - - - - - - - -
    A cell.
    - - - diff --git a/tidylib-src/test/input/in_431889.html b/tidylib-src/test/input/in_431889.html deleted file mode 100755 index 01ebacd6..00000000 --- a/tidylib-src/test/input/in_431889.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - -Bug-2000-12-27-B [ #431889 ] Config file options w/"param" don't work - - - - -

    This image has no ALT attribute.

    - - - diff --git a/tidylib-src/test/input/in_431895.html b/tidylib-src/test/input/in_431895.html deleted file mode 100755 index b72a6f58..00000000 --- a/tidylib-src/test/input/in_431895.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - -Bug-2001-01-03-A [ #431895 ] gnu-emacs filename not set for XML or -q - - - - -

    -

    Some text.

    - - - diff --git a/tidylib-src/test/input/in_431898.html b/tidylib-src/test/input/in_431898.html deleted file mode 100755 index 6af7ba07..00000000 --- a/tidylib-src/test/input/in_431898.html +++ /dev/null @@ -1,13 +0,0 @@ - - -]> - -[ #431898 ] Tidy messes up X(HT)ML documents - - -

    Test

    - - diff --git a/tidylib-src/test/input/in_431956.xml b/tidylib-src/test/input/in_431956.xml deleted file mode 100755 index ffd34b83..00000000 --- a/tidylib-src/test/input/in_431956.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - Test - diff --git a/tidylib-src/test/input/in_431958.html b/tidylib-src/test/input/in_431958.html deleted file mode 100755 index 20a55a37..00000000 --- a/tidylib-src/test/input/in_431958.html +++ /dev/null @@ -1,10 +0,0 @@ - - - -[ #431958 ] Comments always indented - - - - - diff --git a/tidylib-src/test/input/in_431964.html b/tidylib-src/test/input/in_431964.html deleted file mode 100755 index 26b0d1fb..00000000 --- a/tidylib-src/test/input/in_431964.html +++ /dev/null @@ -1,13 +0,0 @@ - - - -[ #431964 ] table height="" not flagged as error - - - - - - -
    A cell.
    - - diff --git a/tidylib-src/test/input/in_431965.xhtml b/tidylib-src/test/input/in_431965.xhtml deleted file mode 100755 index b8dcaec9..00000000 --- a/tidylib-src/test/input/in_431965.xhtml +++ /dev/null @@ -1,12 +0,0 @@ - - - - [ #431965 ] XHTML Strict seen as Transitional w/div - - - -
    Test
    - - - diff --git a/tidylib-src/test/input/in_432677.html b/tidylib-src/test/input/in_432677.html deleted file mode 100755 index a7f71c60..00000000 --- a/tidylib-src/test/input/in_432677.html +++ /dev/null @@ -1,13 +0,0 @@ - -[ #432677 ] Null value changed to "value" for -asxml - -
    - - - -
    - - diff --git a/tidylib-src/test/input/in_433012.html b/tidylib-src/test/input/in_433012.html deleted file mode 100755 index 01752360..00000000 --- a/tidylib-src/test/input/in_433012.html +++ /dev/null @@ -1,802 +0,0 @@ - -[ #433012 ] Illegal ampersands/character entities -
    - - - - - - - - - - - id=ID =XX
    - - - id=ID¡=XX
    - - - id=ID¢=XX
    - - - id=ID£=XX
    - - - id=ID¤=XX
    - - - id=ID¥=XX
    - - - id=ID¦=XX
    - - - id=ID§=XX
    - - - id=ID¨=XX
    - - - id=ID©=XX
    - - - id=IDª=XX
    - - - id=ID«=XX
    - - - id=ID¬=XX
    - - - id=ID­=XX
    - - - id=ID®=XX
    - - - id=ID¯=XX
    - - - id=ID°=XX
    - - - id=ID±=XX
    - - - id=ID²=XX
    - - - id=ID³=XX
    - - - id=ID´=XX
    - - - id=IDµ=XX
    - - - id=ID¶=XX
    - - - id=ID·=XX
    - - - id=ID¸=XX
    - - - id=ID¹=XX
    - - - id=IDº=XX
    - - - id=ID»=XX
    - - - id=ID¼=XX
    - - - id=ID½=XX
    - - - id=ID¾=XX
    - - - id=ID¿=XX
    - - - id=IDÀ=XX
    - - - id=IDÁ=XX
    - - - id=IDÂ=XX
    - - - id=IDÃ=XX
    - - - id=IDÄ=XX
    - - - id=IDÅ=XX
    - - - id=IDÆ=XX
    - - - id=IDÇ=XX
    - - - id=IDÈ=XX
    - - - id=IDÉ=XX
    - - - id=IDÊ=XX
    - - - id=IDË=XX
    - - - id=IDÌ=XX
    - - - id=IDÍ=XX
    - - - id=IDÎ=XX
    - - - id=IDÏ=XX
    - - - id=IDÐ=XX
    - - - id=IDÑ=XX
    - - - id=IDÒ=XX
    - - - id=IDÓ=XX
    - - - id=IDÔ=XX
    - - - id=IDÕ=XX
    - - - id=IDÖ=XX
    - - - id=ID×=XX
    - - - id=IDØ=XX
    - - - id=IDÙ=XX
    - - - id=IDÚ=XX
    - - - id=IDÛ=XX
    - - - id=IDÜ=XX
    - - - id=IDÝ=XX
    - - - id=IDÞ=XX
    - - - id=IDß=XX
    - - - id=IDà=XX
    - - - id=IDá=XX
    - - - id=IDâ=XX
    - - - id=IDã=XX
    - - - id=IDä=XX
    - - - id=IDå=XX
    - - - id=IDæ=XX
    - - - id=IDç=XX
    - - - id=IDè=XX
    - - - id=IDé=XX
    - - - id=IDê=XX
    - - - id=IDë=XX
    - - - id=IDì=XX
    - - - id=IDí=XX
    - - - id=IDî=XX
    - - - id=IDï=XX
    - - - id=IDð=XX
    - - - id=IDñ=XX
    - - - id=IDò=XX
    - - - id=IDó=XX
    - - - id=IDô=XX
    - - - id=IDõ=XX
    - - - id=IDö=XX
    - - - id=ID÷=XX
    - - - id=IDø=XX
    - - - id=IDù=XX
    - - - id=IDú=XX
    - - - id=IDû=XX
    - - - id=IDü=XX
    - - - id=IDý=XX
    - - - id=IDþ=XX
    - - - id=IDÿ=XX
    - - - - - - - - id=ID&fnof=XX
    - - - id=ID&Alpha=XX
    - - - id=ID&Beta=XX
    - - - id=ID&Gamma=XX
    - - - id=ID&Delta=XX
    - - - id=ID&Epsilon=XX
    - - - id=ID&Zeta=XX
    - - - id=ID&Eta=XX
    - - - id=ID&Theta=XX
    - - - id=ID&Iota=XX
    - - - id=ID&Kappa=XX
    - - - id=ID&Lambda=XX
    - - - id=ID&Mu=XX
    - - - id=ID&Nu=XX
    - - - id=ID&Xi=XX
    - - - id=ID&Omicron=XX
    - - - id=ID&Pi=XX
    - - - id=ID&Rho=XX
    - - - id=ID&Sigma=XX
    - - - id=ID&Tau=XX
    - - - id=ID&Upsilon=XX
    - - - id=ID&Phi=XX
    - - - id=ID&Chi=XX
    - - - id=ID&Psi=XX
    - - - id=ID&Omega=XX
    - - - id=ID&alpha=XX
    - - - id=ID&beta=XX
    - - - id=ID&gamma=XX
    - - - id=ID&delta=XX
    - - - id=ID&epsilon=XX
    - - - id=ID&zeta=XX
    - - - id=ID&eta=XX
    - - - id=ID&theta=XX
    - - - id=ID&iota=XX
    - - - id=ID&kappa=XX
    - - - id=ID&lambda=XX
    - - - id=ID&mu=XX
    - - - id=ID&nu=XX
    - - - id=ID&xi=XX
    - - - id=ID&omicron=XX
    - - - id=ID&pi=XX
    - - - id=ID&rho=XX
    - - - id=ID&sigmaf=XX
    - - - id=ID&sigma=XX
    - - - id=ID&tau=XX
    - - - id=ID&upsilon=XX
    - - - id=ID&phi=XX
    - - - id=ID&chi=XX
    - - - id=ID&psi=XX
    - - - id=ID&omega=XX
    - - - id=ID&thetasym=XX
    - - - id=ID&upsih=XX
    - - - id=ID&piv=XX
    - - - id=ID&bull=XX
    - - - id=ID&hellip=XX
    - - - id=ID&prime=XX
    - - - id=ID&Prime=XX
    - - - id=ID&oline=XX
    - - - id=ID&frasl=XX
    - - - id=ID&weierp=XX
    - - - id=ID&image=XX
    - - - id=ID&real=XX
    - - - id=ID&trade=XX
    - - - id=ID&alefsym=XX
    - - - id=ID&larr=XX
    - - - id=ID&uarr=XX
    - - - id=ID&rarr=XX
    - - - id=ID&darr=XX
    - - - id=ID&harr=XX
    - - - id=ID&crarr=XX
    - - - id=ID&lArr=XX
    - - - id=ID&uArr=XX
    - - - id=ID&rArr=XX
    - - - id=ID&dArr=XX
    - - - id=ID&hArr=XX
    - - - id=ID&forall=XX
    - - - id=ID&part=XX
    - - - id=ID&exist=XX
    - - - id=ID&empty=XX
    - - - id=ID&nabla=XX
    - - - id=ID&isin=XX
    - - - - - - id=ID¬in=XX
    - - - id=ID&ni=XX
    - - - id=ID&prod=XX
    - - - id=ID&sum=XX
    - - - id=ID&minus=XX
    - - - id=ID&lowast=XX
    - - - id=ID&radic=XX
    - - - id=ID&prop=XX
    - - - id=ID&infin=XX
    - - - id=ID&ang=XX
    - - - id=ID&and=XX
    - - - id=ID&or=XX
    - - - id=ID&cap=XX
    - - - id=ID&cup=XX
    - - - id=ID&int=XX
    - - - id=ID&there4=XX
    - - - id=ID&sim=XX
    - - - id=ID&cong=XX
    - - - id=ID&asymp=XX
    - - - id=ID&ne=XX
    - - - id=ID&equiv=XX
    - - - id=ID&le=XX
    - - - id=ID&ge=XX
    - - - id=ID&sub=XX
    - - - id=ID&sup=XX
    - - - id=ID&nsub=XX
    - - - id=ID&sube=XX
    - - - id=ID&supe=XX
    - - - id=ID&oplus=XX
    - - - id=ID&otimes=XX
    - - - id=ID&perp=XX
    - - - id=ID&sdot=XX
    - - - id=ID&lceil=XX
    - - - id=ID&rceil=XX
    - - - id=ID&lfloor=XX
    - - - id=ID&rfloor=XX
    - - - id=ID&lang=XX
    - - - id=ID&rang=XX
    - - - id=ID&loz=XX
    - - - id=ID&spades=XX
    - - - id=ID&clubs=XX
    - - - id=ID&hearts=XX
    - - - id=ID&diams=XX
    - - - - - - - - - id=ID"=XX
    - - - id=ID&=XX
    - - - id=ID<=XX
    - - - id=ID>=XX
    - - - - - - - - id=ID&OElig=XX
    - - - id=ID&oelig=XX
    - - - id=ID&Scaron=XX
    - - - id=ID&scaron=XX
    - - - id=ID&Yuml=XX
    - - - id=ID&circ=XX
    - - - id=ID&tilde=XX
    - - - id=ID&ensp=XX
    - - - id=ID&emsp=XX
    - - - id=ID&thinsp=XX
    - - - id=ID&zwnj=XX
    - - - id=ID&zwj=XX
    - - - id=ID&lrm=XX
    - - - id=ID&rlm=XX
    - - - id=ID&ndash=XX
    - - - id=ID&mdash=XX
    - - - id=ID&lsquo=XX
    - - - id=ID&rsquo=XX
    - - - id=ID&sbquo=XX
    - - - id=ID&ldquo=XX
    - - - id=ID&rdquo=XX
    - - - id=ID&bdquo=XX
    - - - id=ID&dagger=XX
    - - - id=ID&Dagger=XX
    - - - id=ID&permil=XX
    - - - id=ID&lsaquo=XX
    - - - id=ID&rsaquo=XX
    - - - - - - id=ID&euro=XX
    - - - - - - - - id=ID&apos=XX
    - - - id=ID&foo=XX
    - - diff --git a/tidylib-src/test/input/in_433021.html b/tidylib-src/test/input/in_433021.html deleted file mode 100755 index 82eb8df4..00000000 --- a/tidylib-src/test/input/in_433021.html +++ /dev/null @@ -1,18 +0,0 @@ - - -[ #433021 ] Identify attribute whose value is bad - - -

    text

    - - - - - - -

    "valign" attr value can't be "center"

    -

    "valign" attr value can't be "fuzzle"

    -

    "align"/"valign" attr values can't be "fuzzle"

    -
    - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_433040.html b/tidylib-src/test/input/in_433040.html deleted file mode 100755 index b5efef3b..00000000 --- a/tidylib-src/test/input/in_433040.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -[ #433040 ] Anchor tag without attributes deleted - - -Tidy strips Anchor tags when there are no attributes - - diff --git a/tidylib-src/test/input/in_433359.html b/tidylib-src/test/input/in_433359.html deleted file mode 100755 index 8ef2e069..00000000 --- a/tidylib-src/test/input/in_433359.html +++ /dev/null @@ -1,14 +0,0 @@ - - - -[ #433359 ] Empty iframe elements trimmed - - -This is a test - - - - diff --git a/tidylib-src/test/input/in_433360.html b/tidylib-src/test/input/in_433360.html deleted file mode 100755 index 227673ab..00000000 --- a/tidylib-src/test/input/in_433360.html +++ /dev/null @@ -1,9 +0,0 @@ - -[ #433360 ] Tags with missing > can't be repaired - -

    -There seems to be an error occurring when you don't -end a tag with a >. Tidy won't fix it. -

    - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_433604.xml b/tidylib-src/test/input/in_433604.xml deleted file mode 100755 index 81c0b659..00000000 --- a/tidylib-src/test/input/in_433604.xml +++ /dev/null @@ -1,4 +0,0 @@ - -[ #433604 ] Tidy inserts &nbsp; entity in -xml mode. -Use -xml on command line. -Test of   diff --git a/tidylib-src/test/input/in_433607.xml b/tidylib-src/test/input/in_433607.xml deleted file mode 100755 index 67727840..00000000 --- a/tidylib-src/test/input/in_433607.xml +++ /dev/null @@ -1,3 +0,0 @@ - -[ #433607 ] No warning for omitted end tag with -xml. -Use -xml on command line. diff --git a/tidylib-src/test/input/in_433656.html b/tidylib-src/test/input/in_433656.html deleted file mode 100755 index 5187c6ae..00000000 --- a/tidylib-src/test/input/in_433656.html +++ /dev/null @@ -1,9 +0,0 @@ - - -[ #433656 ] Improve support for PHP - - -(some text) - - - diff --git a/tidylib-src/test/input/in_433666.html b/tidylib-src/test/input/in_433666.html deleted file mode 100755 index 35376d63..00000000 --- a/tidylib-src/test/input/in_433666.html +++ /dev/null @@ -1,12 +0,0 @@ - -[ #433666 ] Attempt to repair duplicate attributes - - - - - -
    Test
    - - -[ #433670 ] &apos not recognized as valid XML entity. -Use -xml on command line. -Test of ' diff --git a/tidylib-src/test/input/in_433672.html b/tidylib-src/test/input/in_433672.html deleted file mode 100755 index e0c71501..00000000 --- a/tidylib-src/test/input/in_433672.html +++ /dev/null @@ -1,12 +0,0 @@ - - -[ #433672 ] Anchor enclosing Header tags is omitted - - -

    Section heading

    -

    Another heading

    - -
    ack!
    -

    Goto Another Heading - - diff --git a/tidylib-src/test/input/in_433856.html b/tidylib-src/test/input/in_433856.html deleted file mode 100755 index 5c2fd05e..00000000 --- a/tidylib-src/test/input/in_433856.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - -[ #433856 ] Access violation w/Word files w/font tag - - - -

    De kop

    - -

    Dit is een test.

    -
    - \ No newline at end of file diff --git a/tidylib-src/test/input/in_434047.html b/tidylib-src/test/input/in_434047.html deleted file mode 100755 index 3a4ef701..00000000 --- a/tidylib-src/test/input/in_434047.html +++ /dev/null @@ -1,13 +0,0 @@ - - - -[ #434047 ] Mixed content in 4.01 Strict not allowed - - - - - - -
    Some text.
    - - diff --git a/tidylib-src/test/input/in_434100.html b/tidylib-src/test/input/in_434100.html deleted file mode 100755 index 1c33b1ca..00000000 --- a/tidylib-src/test/input/in_434100.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - -[ #434100 ] Error actually reported as a warning - diff --git a/tidylib-src/test/input/in_434940.html b/tidylib-src/test/input/in_434940.html deleted file mode 100755 index 923e8a30..00000000 --- a/tidylib-src/test/input/in_434940.html +++ /dev/null @@ -1,8 +0,0 @@ - - -[ #434940 ] --show-body-only: print only body contents - - -Use "--show-body-only yes" on the command line - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_435903.html b/tidylib-src/test/input/in_435903.html deleted file mode 100755 index be35048e..00000000 --- a/tidylib-src/test/input/in_435903.html +++ /dev/null @@ -1,19 +0,0 @@ - - [ #435903 ] Script element w/body child to table bug> - - - - - - - -
    -
    - - diff --git a/tidylib-src/test/input/in_435909.html b/tidylib-src/test/input/in_435909.html deleted file mode 100755 index daf10438..00000000 --- a/tidylib-src/test/input/in_435909.html +++ /dev/null @@ -1,26 +0,0 @@ - - - -[ #435909 ] <noscript></noscript> in <head></head> - - - - - -Test - - diff --git a/tidylib-src/test/input/in_435917.html b/tidylib-src/test/input/in_435917.html deleted file mode 100755 index a5938fc5..00000000 --- a/tidylib-src/test/input/in_435917.html +++ /dev/null @@ -1,12 +0,0 @@ - - - -[ #435917 ] <input onfocus=""> reported unknown attr - - -bug #1 - -bug #2 - - - diff --git a/tidylib-src/test/input/in_435919.html b/tidylib-src/test/input/in_435919.html deleted file mode 100755 index 127cbf38..00000000 --- a/tidylib-src/test/input/in_435919.html +++ /dev/null @@ -1,8 +0,0 @@ - - -[ #435919 ] Nested <q></q>'s not handled correctly - - -So then I said to him, don't go there. - - diff --git a/tidylib-src/test/input/in_435920.html b/tidylib-src/test/input/in_435920.html deleted file mode 100755 index c0fade23..00000000 --- a/tidylib-src/test/input/in_435920.html +++ /dev/null @@ -1,13 +0,0 @@ - - -[ #435920 ] Space inserted before </td> causes probs - - -bla - - - - -
     
    - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_435922.html b/tidylib-src/test/input/in_435922.html deleted file mode 100755 index cea6d9b3..00000000 --- a/tidylib-src/test/input/in_435922.html +++ /dev/null @@ -1,10 +0,0 @@ - - - [ #435922 ] Missing <form> around <input> no warning - - - -
    - - - diff --git a/tidylib-src/test/input/in_435923.html b/tidylib-src/test/input/in_435923.html deleted file mode 100755 index 7a8af10a..00000000 --- a/tidylib-src/test/input/in_435923.html +++ /dev/null @@ -1,9 +0,0 @@ - - - [ #435923 ] Preserve case of attribute names - - - - - - diff --git a/tidylib-src/test/input/in_437468.html b/tidylib-src/test/input/in_437468.html deleted file mode 100755 index 28f64893..00000000 --- a/tidylib-src/test/input/in_437468.html +++ /dev/null @@ -1,8 +0,0 @@ - - -Test input file for iso-8859-1 character entities - - -

    Phrase with numeric quotes expressly stated: “Déjà conçu à l'ère de Caféïne”

    - - diff --git a/tidylib-src/test/input/in_438650.html b/tidylib-src/test/input/in_438650.html deleted file mode 100755 index 55c8a197..00000000 --- a/tidylib-src/test/input/in_438650.html +++ /dev/null @@ -1,9 +0,0 @@ - - -[ #438650 ] Newline in URL attr value becomes space - - -This is a test - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_438658.html b/tidylib-src/test/input/in_438658.html deleted file mode 100755 index 9eb1d499..00000000 --- a/tidylib-src/test/input/in_438658.html +++ /dev/null @@ -1,8 +0,0 @@ - - -[ #438658 ] Missing / in title endtag makes 2 titles<title> -</head> -<body> -Test -</body> -</html> \ No newline at end of file diff --git a/tidylib-src/test/input/in_438954.html b/tidylib-src/test/input/in_438954.html deleted file mode 100755 index 6a6691cf..00000000 --- a/tidylib-src/test/input/in_438954.html +++ /dev/null @@ -1,8 +0,0 @@ -<html> -<head> -<title>[ #438954 ] Body tag w/attributes omitted w/hide-end - - -Use "--hide-endtags yes" on command line - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_438956.html b/tidylib-src/test/input/in_438956.html deleted file mode 100755 index 4f3123ab..00000000 --- a/tidylib-src/test/input/in_438956.html +++ /dev/null @@ -1,8 +0,0 @@ - - -[ #438956 ] Bad head-endtag reported incorrectly - - -Test - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_441508.html b/tidylib-src/test/input/in_441508.html deleted file mode 100755 index b9030524..00000000 --- a/tidylib-src/test/input/in_441508.html +++ /dev/null @@ -1,10 +0,0 @@ - -[ #441508 ] parser.c: BadForm() function broken - - - -
    Test
    - - - - [ #441568 ] Font tags handling different - - -
    - -text-one - -
    - -text-two - - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_441740.xhtml b/tidylib-src/test/input/in_441740.xhtml deleted file mode 100755 index 47ee9385..00000000 --- a/tidylib-src/test/input/in_441740.xhtml +++ /dev/null @@ -1,28 +0,0 @@ - - - - -Sample XHTML 1.1 document with Ruby markup - - -

    - - - 10 - 31 - 2002 - - - Month - Day - Year - - - Expiration Date - - -

    - - diff --git a/tidylib-src/test/input/in_443362.html b/tidylib-src/test/input/in_443362.html deleted file mode 100755 index 30f3aad2..00000000 --- a/tidylib-src/test/input/in_443362.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - -[ #443362 ] null-pointer except. for doctype in pre - - - -

    Unofficial W3C Validator FAQ

    -

    This is a list of frequently asked questions and answers asked on the -www-validator-css@w3.org mailing list. - -

    -What does "org.xml.sax.SAXException: -Please, fix your system identifier (URI) in the DOCTYPE rule." mean? -

    - -

    Your XHTML document contains a document type -declaration but the system identifier points at some -non-W3C URI. Your document probably contains something -like this: -

    -
     
    - 
    -
    -
    - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_443381.xhtml b/tidylib-src/test/input/in_443381.xhtml deleted file mode 100755 index b5c6b9ac..00000000 --- a/tidylib-src/test/input/in_443381.xhtml +++ /dev/null @@ -1,10 +0,0 @@ - - - -[ #443381 ] end tags for empty elements in XHTML - - -

    TestcoolTest

    - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_443576.html b/tidylib-src/test/input/in_443576.html deleted file mode 100755 index f3485c76..00000000 --- a/tidylib-src/test/input/in_443576.html +++ /dev/null @@ -1,12 +0,0 @@ - - -[ #443576 ] End script tag inside scripts problem - - - - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_443678.html b/tidylib-src/test/input/in_443678.html deleted file mode 100755 index 2fe2cc9d..00000000 --- a/tidylib-src/test/input/in_443678.html +++ /dev/null @@ -1,19 +0,0 @@ - - -[ #443678 ] Unclosed <script> in <head> messes Tidy - - - - diff --git a/tidylib-src/test/input/in_444394.html b/tidylib-src/test/input/in_444394.html deleted file mode 100755 index da104694..00000000 --- a/tidylib-src/test/input/in_444394.html +++ /dev/null @@ -1,149 +0,0 @@ - - - - - - - - - - -Hello - - - - - - -
    - -

    Hello

    - -

     

    - -

    This is a nice document

    - -

    Test

    - -

    With a nice picture

    - -

     

    - -
    - - - - diff --git a/tidylib-src/test/input/in_445074.html b/tidylib-src/test/input/in_445074.html deleted file mode 100755 index 761d0d39..00000000 --- a/tidylib-src/test/input/in_445074.html +++ /dev/null @@ -1,19 +0,0 @@ - - - -[ #445074 ] XHTML requires form method="post" - - -
    - - - - -
    - -
    -
    - - - diff --git a/tidylib-src/test/input/in_445394.html b/tidylib-src/test/input/in_445394.html deleted file mode 100755 index 626aa648..00000000 --- a/tidylib-src/test/input/in_445394.html +++ /dev/null @@ -1,8 +0,0 @@ - - -[ #445394 ] Improve handling of missing trailing " - - -link - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_445557.html b/tidylib-src/test/input/in_445557.html deleted file mode 100755 index f1be0b87..00000000 --- a/tidylib-src/test/input/in_445557.html +++ /dev/null @@ -1,22 +0,0 @@ - - - -[ #445557 ] Convert Symbol font chars to Unicode - - -

    The predicate calculus has a number of theorems and axioms for proving logical statements. Here are the main symbols used in predicate calculus:

    -

    P(x) – proposition – a logical statement in the condition x.

    -

    x – any condition in the set of possible conditions.

    -

    c – a particular condition in the set of possible conditions.

    -

    " - – "For every"

    -

    $ - – "Exists"

    -

    ® - – Implication

    -

    Ù - – Conjunction (logical and)

    -

    Ú - – Disjunction (logical or)

    - - diff --git a/tidylib-src/test/input/in_446019.xhtml b/tidylib-src/test/input/in_446019.xhtml deleted file mode 100755 index afa5328c..00000000 --- a/tidylib-src/test/input/in_446019.xhtml +++ /dev/null @@ -1,12 +0,0 @@ - - - -[ #446019 ] <img name="foo"> allowed in XTHML-Strict - - -

    -TestTest -

    - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_449348.html b/tidylib-src/test/input/in_449348.html deleted file mode 100755 index d6d32779..00000000 --- a/tidylib-src/test/input/in_449348.html +++ /dev/null @@ -1,14 +0,0 @@ - - - -[ #449348 ] Whitespace added/removed to inline tags - - -

    Make this wrap at the end of the line12345678: white-spacejoebob

    - -

    This is long enough a wrap at the next line text -...

    - - - diff --git a/tidylib-src/test/input/in_450389.html b/tidylib-src/test/input/in_450389.html deleted file mode 100755 index ebe001c9..00000000 --- a/tidylib-src/test/input/in_450389.html +++ /dev/null @@ -1,82 +0,0 @@ - - -[ #450389 ] Color attval check allows only black/# - - - - - - -

    -Test black
    -Test green
    -Test silver
    -Test lime
    -Test gray
    -Test olive
    -Test white
    -Test yellow
    -Test maroon
    -Test navy
    -Test red
    -Test blue
    -Test purple
    -Test teal
    -Test fuchsia
    -Test aqua
    -

    - -

    -Test Red
    -Test RED
    -

    - -

    -Test invalid reddish
    -

    - -

    -Test black #000000
    -Test green #008000
    -Test silver #C0C0C0
    -Test lime #00FF00
    -Test gray #808080
    -Test olive #808000
    -Test white #FFFFFF
    -Test yellow #FFFF00
    -Test maroon #800000
    -Test navy #000080
    -Test red #FF0000
    -Test blue #0000FF
    -Test purple #800080
    -Test teal #008080
    -Test fuchsia #FF00FF
    -Test aqua #00FFFF
    -

    - -

    -Test red #ff0000
    -Test red #fF0000
    -

    - -

    -Test invalid red #FF
    -

    - -

    -Test invalid grurple
    -Test invalid #grurple
    -Test invalid #1234567
    -

    - - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_456596.html b/tidylib-src/test/input/in_456596.html deleted file mode 100755 index b8288785..00000000 --- a/tidylib-src/test/input/in_456596.html +++ /dev/null @@ -1,8 +0,0 @@ - - - [ #456596 ] Missing attribute name garbles output - - - System News
    - - diff --git a/tidylib-src/test/input/in_463066.html b/tidylib-src/test/input/in_463066.html deleted file mode 100755 index 8af45ba2..00000000 --- a/tidylib-src/test/input/in_463066.html +++ /dev/null @@ -1,552 +0,0 @@ - - - - - - - - - - - - - - - - - - -[ #463066 ] CleanWord2000 misses mso-list bullets - - - - - - - - - - - - - -
    - - - -

    Test 1

    - - - -
      - -
    1. Here
    2. - -
    3. We
    4. - -
    5. Go
    6. - -
    7. Again
    8. - -
    - - - -

     

    - - - -
      - -
    1. Ok
    2. - -
    3. That
    4. - -
    5. Worked
    6. - -
    - - - -

     

    - - - -

    v     But

    - - - -

    v     It

    - - - -

    v     Does

    - - - -

    v     Not

    - - - -

    v     Work

    - - - -

    v     With

    - - - -

    v     Bullet

    - - - -

    v     Points

    - - - -

     

    - - - -

    q       - -Now

    - - - -

    q       - -It

    - - - -

    q       - -Is

    - - - -

    q       - -Working

    - - - -

     

    - - - -
      - -
    • Try
    • - -
    • It
    • - -
    • Again
    • - -
    - - - -

     

    - - - -
      - -
    • Do
    • - -
    • It
    • - -
    • Again
    • - -
    • And
    • - -
    - - - -

     

    - - - -
    - - - - - - - - - diff --git a/tidylib-src/test/input/in_467863.html b/tidylib-src/test/input/in_467863.html deleted file mode 100755 index 5f60cb47..00000000 --- a/tidylib-src/test/input/in_467863.html +++ /dev/null @@ -1,8 +0,0 @@ - - -[ #467863 ] un-nest <a> - - A B C - - diff --git a/tidylib-src/test/input/in_467865.html b/tidylib-src/test/input/in_467865.html deleted file mode 100755 index ea84cb1e..00000000 --- a/tidylib-src/test/input/in_467865.html +++ /dev/null @@ -1,9 +0,0 @@ - - -[ #467865 ] un-nesting is incorrect - -

    (foo bar). -...

    - - diff --git a/tidylib-src/test/input/in_470663.html b/tidylib-src/test/input/in_470663.html deleted file mode 100755 index e165354c..00000000 --- a/tidylib-src/test/input/in_470663.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - Test Input For Bug #470663 - - - -

    Body doesn't matter. Problem occurs parsing <head> element.

    - - diff --git a/tidylib-src/test/input/in_470688.html b/tidylib-src/test/input/in_470688.html deleted file mode 100755 index f3c4f7fa..00000000 --- a/tidylib-src/test/input/in_470688.html +++ /dev/null @@ -1,10 +0,0 @@ - - - -[ #470688 ] doesn't cleanup badly nested tags right - - -

    RIGHT TRIANGLES

    - - diff --git a/tidylib-src/test/input/in_471264.html b/tidylib-src/test/input/in_471264.html deleted file mode 100755 index b284b05c..00000000 --- a/tidylib-src/test/input/in_471264.html +++ /dev/null @@ -1,11 +0,0 @@ - - -[ #471264 ] Reduce blank lines in output - -
      -
    • first element
    • -
    • second element
    • -
    - - diff --git a/tidylib-src/test/input/in_473490.html b/tidylib-src/test/input/in_473490.html deleted file mode 100755 index 03b0f8dc..00000000 --- a/tidylib-src/test/input/in_473490.html +++ /dev/null @@ -1,11 +0,0 @@ - - - -[ #473490 ] DOCTYPE for Proprietary HTML to XHTML bad - - - -

    Test

    -
    - - diff --git a/tidylib-src/test/input/in_480406.xml b/tidylib-src/test/input/in_480406.xml deleted file mode 100755 index 63acee19..00000000 --- a/tidylib-src/test/input/in_480406.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/tidylib-src/test/input/in_480701.xml b/tidylib-src/test/input/in_480701.xml deleted file mode 100755 index 4adae949..00000000 --- a/tidylib-src/test/input/in_480701.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_480843.xhtml b/tidylib-src/test/input/in_480843.xhtml deleted file mode 100755 index 2f84b723..00000000 --- a/tidylib-src/test/input/in_480843.xhtml +++ /dev/null @@ -1,10 +0,0 @@ - - - -[ #480843 ] Proposed change to FixID() - -

    Introduction

    -

    New Introduction

    - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_487204.html b/tidylib-src/test/input/in_487204.html deleted file mode 100755 index 02d29672..00000000 --- a/tidylib-src/test/input/in_487204.html +++ /dev/null @@ -1,12 +0,0 @@ - - -[ #487204 ] Duplicate DIV style attribute generated -
      -
        -
      1. One
      2. -
      3. Two
      4. -
      5. Three
      6. -
      -
    - \ No newline at end of file diff --git a/tidylib-src/test/input/in_487283.html b/tidylib-src/test/input/in_487283.html deleted file mode 100755 index 3b9ba38a..00000000 --- a/tidylib-src/test/input/in_487283.html +++ /dev/null @@ -1,22 +0,0 @@ - - -[ #487283 ] >/select< does not terminate >option< - - -
    - -
    - - - -
    row 1, cell 1 -row 1, cell 2 -
    row 2, cell 1 -row 2, cell 2 -
    - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_500236.xml b/tidylib-src/test/input/in_500236.xml deleted file mode 100755 index 82561732..00000000 --- a/tidylib-src/test/input/in_500236.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - diff --git a/tidylib-src/test/input/in_501230.xhtml b/tidylib-src/test/input/in_501230.xhtml deleted file mode 100755 index 3f013c3c..00000000 --- a/tidylib-src/test/input/in_501230.xhtml +++ /dev/null @@ -1,12 +0,0 @@ - - - -[ #501230 ] "0" (Zero) has to be lower case ! - - - -
    - - diff --git a/tidylib-src/test/input/in_501669.html b/tidylib-src/test/input/in_501669.html deleted file mode 100755 index 46bb207e..00000000 --- a/tidylib-src/test/input/in_501669.html +++ /dev/null @@ -1,15 +0,0 @@ - - - -[ #501669 ] width="n*" marked invalid on <COL> - - - -- - - -
    xx
    - - diff --git a/tidylib-src/test/input/in_503436.xml b/tidylib-src/test/input/in_503436.xml deleted file mode 100755 index 9e3bd882..00000000 --- a/tidylib-src/test/input/in_503436.xml +++ /dev/null @@ -1,8 +0,0 @@ - - -Testcase #503436 - - - first - - diff --git a/tidylib-src/test/input/in_504206.html b/tidylib-src/test/input/in_504206.html deleted file mode 100755 index b4b95684..00000000 --- a/tidylib-src/test/input/in_504206.html +++ /dev/null @@ -1,154 +0,0 @@ - - -[ #504206] Tidy errors in processing forms. - -

    COMM 428: Feedback Survey

    - -

    Please fill out the following form based on YOUR -experience in COMM 428 to date.

    -

    Use the Send button at the bottom -of the page to send your feedback to me via e-mail. -


    -
    - - - - - - - -

    Name (optional):

    -

    E-Mail Address (optional):

    -

    Where will you be this time next year? - - -

    -

    Area(s) of concentation? (Select all that -Apply):
    -MIS
    -Finance
    -Marketing
    -Management
    -Accounting
    -Other
    -

    -

    Q1: The instructor gives appropriate -consideration to the comments and questions of -students.
    -Strongly Agree -Agree -Neither -Agree Nor Disagree -Disagree -Strongly Disagree -

    -

    Q2: The instructor relates theoretical -concepts covered in the course to practical -applications.
    -Strongly Agree -Agree -Neither -Agree Nor Disagree -Disagree -Strongly Disagree -

    -

    Q3: The instructor presents class material -in a clear and organized manner.
    -Strongly Agree -Agree -Neither -Agree Nor Disagree -Disagree -Strongly Disagree -

    -

    Q4: The instructor is prepared for -class.
    -Strongly Agree -Agree -Neither -Agree Nor Disagree -Disagree -Strongly Disagree -

    -

    Q5: The instructor demonstrates enthusiasm -and interest in the subject matter.
    -Strongly Agree -Agree -Neither Agree Nor Disagree -Disagree -Strongly Disagree -

    -

    Q6: The instructor posts reasonable office -hours and is available whenever I try to see him -during those hours.
    -Strongly Agree -Agree -Neither -Agree Nor Disagree -Disagree -Strongly Disagree -

    -

    Q7: The instructor stimulates me to think -about the course.
    -Strongly Agree -Agree -Neither Agree Nor Disagree -Disagree -Strongly Disagree -

    -

    Stengths (class/instructor): -
    - -
    -

    -

    Weaknesses (class/instructor): -
    - -
    -

    -

    Suggestions for improvement -(class/instructor; NOTE: This field is -REQUIRED): -
    - -
    -

    -

    - -
    - diff --git a/tidylib-src/test/input/in_505770.html b/tidylib-src/test/input/in_505770.html deleted file mode 100755 index 5bdeb737..00000000 --- a/tidylib-src/test/input/in_505770.html +++ /dev/null @@ -1,34 +0,0 @@ - - - -[ #505770] Unclosed <option> tag causing problems - - - - - -
    - - -
    -
    - -
    - - diff --git a/tidylib-src/test/input/in_508936.html b/tidylib-src/test/input/in_508936.html deleted file mode 100755 index f950f1dc..00000000 --- a/tidylib-src/test/input/in_508936.html +++ /dev/null @@ -1,11 +0,0 @@ - - - [ #508936 ] Parse CSS Selector prefix in config file - - -

    Allow user to specify -prefix for -class names Tidy generates with --clean yes option. -

    - - diff --git a/tidylib-src/test/input/in_511243.xhtml b/tidylib-src/test/input/in_511243.xhtml deleted file mode 100755 index 00f222fc..00000000 --- a/tidylib-src/test/input/in_511243.xhtml +++ /dev/null @@ -1,12 +0,0 @@ - - - -[ #511243 ] xhtml utf8 format bug - - -

    -How to…
    -Place an extended-hours order: - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_514348.html b/tidylib-src/test/input/in_514348.html deleted file mode 100755 index 2f483e25..00000000 --- a/tidylib-src/test/input/in_514348.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - [ #514348 ] Incorrect wrap behaviour - - - - - - - -
    HomeNews -
    - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_516370.xhtml b/tidylib-src/test/input/in_516370.xhtml deleted file mode 100755 index 792ffd09..00000000 --- a/tidylib-src/test/input/in_516370.xhtml +++ /dev/null @@ -1,13 +0,0 @@ - - - -[ #516370 ] Invalid ID value? - -

    Test valid D

    -

    Test valid ID

    -

    Test valid ID - : should only be used for namespaces

    -

    Test invalid ID

    -

    Test invalid ID

    - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_517550.xhtml b/tidylib-src/test/input/in_517550.xhtml deleted file mode 100755 index 723eb4c4..00000000 --- a/tidylib-src/test/input/in_517550.xhtml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - -[ #517550 ] parser misinterprets ?xml-stylesheet PI - - -

    A test document

    - - diff --git a/tidylib-src/test/input/in_525081.html b/tidylib-src/test/input/in_525081.html deleted file mode 100755 index 1a393dc1..00000000 --- a/tidylib-src/test/input/in_525081.html +++ /dev/null @@ -1,12 +0,0 @@ - - - -[ 525081 ] frameset rows attr. not recognized - - - - - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_531964.xhtml b/tidylib-src/test/input/in_531964.xhtml deleted file mode 100755 index 74709ec4..00000000 --- a/tidylib-src/test/input/in_531964.xhtml +++ /dev/null @@ -1,11 +0,0 @@ - - - - -[ 531964 ] <p /> gets tidied into <p /></p> - - -

    - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_532535.html b/tidylib-src/test/input/in_532535.html deleted file mode 100755 index b5f2e31f..00000000 --- a/tidylib-src/test/input/in_532535.html +++ /dev/null @@ -1,9 +0,0 @@ - - -[ 532535 ] Hang when in code <?xml /> - - -

     

    - - diff --git a/tidylib-src/test/input/in_533105.html b/tidylib-src/test/input/in_533105.html deleted file mode 100755 index 19a7298a..00000000 --- a/tidylib-src/test/input/in_533105.html +++ /dev/null @@ -1,20 +0,0 @@ - - -[ 533105 ] Tidy confused: HTML in VBScript - - - - - diff --git a/tidylib-src/test/input/in_533233.html b/tidylib-src/test/input/in_533233.html deleted file mode 100755 index 4787ac9b..00000000 --- a/tidylib-src/test/input/in_533233.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Test for bug #533233 - - - - - -

    Script sample 1

    -

    Headline project—Link to offsite page.

    -

    Input 1

    -

    texttext

    - - - diff --git a/tidylib-src/test/input/in_537604.xml b/tidylib-src/test/input/in_537604.xml deleted file mode 100755 index 713d2c85..00000000 --- a/tidylib-src/test/input/in_537604.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - -this is a test of ©. &, <, >, ', " must be recognized. - diff --git a/tidylib-src/test/input/in_539369.html b/tidylib-src/test/input/in_539369.html deleted file mode 100755 index 323bf247..00000000 --- a/tidylib-src/test/input/in_539369.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - -[ 539369 ] Infinite loop </frame> after </frameset> - - - - - - - - - - - - - - - diff --git a/tidylib-src/test/input/in_539369a.html b/tidylib-src/test/input/in_539369a.html deleted file mode 100755 index 6f455013..00000000 --- a/tidylib-src/test/input/in_539369a.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - [ 539369 ] Test </frameset> inside <noframes> - - - - - - - - - <frameset> - - - - - - - diff --git a/tidylib-src/test/input/in_540045.xhtml b/tidylib-src/test/input/in_540045.xhtml deleted file mode 100755 index f730b1a8..00000000 --- a/tidylib-src/test/input/in_540045.xhtml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - -[ 540045 ] Tidy strips all the IMG tags out! - - -USA flag - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_540296.html b/tidylib-src/test/input/in_540296.html deleted file mode 100755 index 1188debd..00000000 --- a/tidylib-src/test/input/in_540296.html +++ /dev/null @@ -1,13 +0,0 @@ - -[ 540296 ] Tidy dumps - -
    -
    -
    -
    -
    -
    -
    -
    - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_540555.html b/tidylib-src/test/input/in_540555.html deleted file mode 100755 index 2976f135..00000000 --- a/tidylib-src/test/input/in_540555.html +++ /dev/null @@ -1,5 +0,0 @@ - - -<body> -<p>#540555 Empty title tag is trimmed</p> -</body> \ No newline at end of file diff --git a/tidylib-src/test/input/in_540571.html b/tidylib-src/test/input/in_540571.html deleted file mode 100755 index 03bdf6f9..00000000 --- a/tidylib-src/test/input/in_540571.html +++ /dev/null @@ -1,15 +0,0 @@ -<html> -<head> -<title>#540571 Inconsistent behaviour with span inline element - - -

    Hello World

    -

    -The font inline is moved so it becomes a child of the h1 element. -

    -

    Hello World

    -

    -The span inline is not moved so it becomes a child of the h1 element, which is inconsistent and does not correspond with current browser behaviour any more. -

    - - \ No newline at end of file diff --git a/tidylib-src/test/input/in_542029.html b/tidylib-src/test/input/in_542029.html deleted file mode 100755 index 2d2aff51..00000000 --- a/tidylib-src/test/input/in_542029.html +++ /dev/null @@ -1,9 +0,0 @@ - - - -[ 542029 ] PPrintXmlDecl reads outside array range - - -Test - - diff --git a/tidylib-src/test/input/in_543262.html b/tidylib-src/test/input/in_543262.html deleted file mode 100755 index b6cf95af..00000000 --- a/tidylib-src/test/input/in_543262.html +++ /dev/null @@ -1,13 +0,0 @@ - - - Preferences - - - -

    Test

    - - diff --git a/tidylib-src/test/input/in_545067.html b/tidylib-src/test/input/in_545067.html deleted file mode 100755 index 7b28f1c1..00000000 --- a/tidylib-src/test/input/in_545067.html +++ /dev/null @@ -1,3 +0,0 @@ - -[ 545067 ] Implicit closing of head broken -

    diff --git a/tidylib-src/test/input/in_545772.html b/tidylib-src/test/input/in_545772.html deleted file mode 100755 index e96216a7..00000000 --- a/tidylib-src/test/input/in_545772.html +++ /dev/null @@ -1,13 +0,0 @@ - - -[ 547057 ] --output-xhtml hangs on most files - - - - - -test - - diff --git a/tidylib-src/test/input/in_552861.html b/tidylib-src/test/input/in_552861.html deleted file mode 100755 index a0137090..00000000 --- a/tidylib-src/test/input/in_552861.html +++ /dev/null @@ -1,12 +0,0 @@ - - - Test Input For Bug #552861 - - - - - - -
    Testing
    - - diff --git a/tidylib-src/test/input/in_570027.html b/tidylib-src/test/input/in_570027.html deleted file mode 100755 index 125774e5..00000000 --- a/tidylib-src/test/input/in_570027.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - -[ 570027 ] Fixes crash in Word2000 cleanup - - - -

    á      -;   -Introduction -;

    - - - diff --git a/tidylib-src/test/input/in_586555.html b/tidylib-src/test/input/in_586555.html deleted file mode 100755 index 6275b4c5..00000000 --- a/tidylib-src/test/input/in_586555.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - -[ 586555 ] Misplaced backslash caused by newline - - -

    [ 586555 ] Misplaced backslash caused by newline

    - - - - - diff --git a/tidylib-src/test/input/in_586562.html b/tidylib-src/test/input/in_586562.html deleted file mode 100755 index 1d72b550..00000000 --- a/tidylib-src/test/input/in_586562.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - [586562] Two Doctypes - - -

    Two DOCTYPE's!

    - - diff --git a/tidylib-src/test/input/in_588061.html b/tidylib-src/test/input/in_588061.html deleted file mode 100755 index 811a715d..00000000 --- a/tidylib-src/test/input/in_588061.html +++ /dev/null @@ -1,428 +0,0 @@ - - - - - - - - - TVNAV.COM Garmin GPS Home Page - - - - -

    TVNAV.COM

    -Toll Free 877-625-3546 (US only)

    - - -

    - -
    Garmin Logo





    - -

    - - -To track your package click here.

    - -Check the current REBATE offers!

    -**NEW! GPSMAP 76S IN STOCK!** -

    - - -**NEW! Rino 110/120 GPS/FRS/GMRS Expected September** -

    - -**NEW! GPSMAP 196 Coming Soon!** -

    - -**NEW! City Navigator Australia....$265.00 IN STOCK!** -

    -**NEW! BlueChart software IN STOCK!** -

    - -**NEW! Europe MapSource: City Navigator, City Select, MetroGuide and Roads & Recreation IN STOCK!** -

    - -**NEW! We now have remanufactured GPS III ($150) in stock. 1 year warranty.
    ** -

    -**NEW! GPS V IN STOCK!** -

    -**NEW! eTrex/eMap/StreetPilot/ColorMap/StreetPilot III/GPSMAP 295 Bean Bag IN STOCK!** -

    -**NEW! StreetPilot III IN STOCK!** -

    -**NEW! StreetPilot/ColorMap/295 Deluxe Case IN STOCK!** -

    -**NEW! Sunvisor for StreetPilot, ColorMap, StreetPilot III and GPSMAP 295....$20.00 IN STOCK!** -

    -**We have R-A-M mounts now in stock for most Garmin units....Call or email us for prices and availability.** -

    -

    -

    - - -

    - -

    Total Video became an authorized Garmin dealer in January 1999. We sold 300+ GPS units prior to becoming a Garmin direct dealer, picking them up from various distributors and individuals to sell. By becoming a Garmin direct dealer we now are able to sell for less! Total Video prides itself with *very quick shipping and a strong history of customer satisfaction. Comments from customers. - -

    - -Want to learn more about GPS? Click here for further GPS information. - -


    -

    -Rino 110/120 GPS-Integrated FRS/GMRS Radios....(MAP $169.99/$249.99) Call or email us for our current price....too low to advertise! Coming Soon! - -

    - -eMap....$170.00 IN STOCK! - -

    - -eMap with 8MB memory cartridge....$200.00 IN STOCK! - -

    - -eMap with 8MB memory cartridge and USA MetroGuide MapSource....$215.00 IN STOCK! - -

    - -eTrex....$115.00 IN STOCK! - -

    - -eTrex Summit....$210.00 IN STOCK! - -

    - -eTrex Camo....$125.00 IN STOCK! - -

    - -eTrex Venture....(MAP $169.00) Call or email us for our current price....too low to advertise! IN STOCK! - -

    - -eTrex Legend....(MAP $249.00) Call or email us for our current price....too low to advertise! IN STOCK! - -

    - -eTrex Vista....(MAP $349.00) Call or email us for our current price....too low to advertise! IN STOCK! - -

    - -GPSMAP 76S....(MAP $449.99) Call or email us for our current price....too low to advertise! IN STOCK! - -

    - -GPSMAP 76....(MAP $349.00) Call or email us for our current price....too low to advertise! IN STOCK! - -

    - -GPS 76....(MAP $219.00) Call or email us for our current price....too low to advertise! IN STOCK! - -

    - -GPSMAP 176....(MAP $499.00) Call or email us for our current price....too low to advertise! IN STOCK! - -

    - -GPSMAP 176C....(MAP $599.00) Call or email us for our current price....too low to advertise! IN STOCK! - -

    - -GPSMAP 2006....(MAP $1199.00) Call or email us for our current price....too low to advertise! IN STOCK! - -

    - -GPSMAP 2006C....(MAP $1999.00) Call or email us for our current price....too low to advertise! IN STOCK! - -

    - -GPSMAP 2010C....(MAP $2499.00) Call or email us for our current price....too low to advertise! IN STOCK! - -

    - - -GPS 12....$140.00 IN STOCK! - -

    - -GPS 12XL with carrying case....$190.00 IN STOCK! - -

    - -GPS 12 MAP with PC interface cable....$280.00 IN STOCK! - -

    - -GPS II Plus....$190.00 IN STOCK! - -

    - - -GPS III Plus with PC interface cable....$280.00 IN STOCK! - -

    - -GPS V Deluxe w/*new* City Select with all unlocks....(MAP $499.00) Call or email us for our current price....too low to advertise! IN STOCK! - -

    - -*U.S. Roads and Recreation MapSource....$80.00 IN STOCK! - -

    - -*WorldMap MapSource....$80.00 IN STOCK! - -

    - -*TOPO MapSource....$85.00 IN STOCK! - -

    - -*Fishing Hot Spots MapSource (includes one coverage area unlock)....$85.00 IN STOCK! - -

    - -*U.S. Waterways & Lights MapSource....$60.00 IN STOCK! - -

    - -StreetPilot with dash mount, cigarette power cable and PC interface cable....$385.00 IN STOCK! - -

    - -StreetPilot ColorMap with dash mount, cigarette power cable and PC interface cable....$540.00 IN STOCK! - -

    - -StreetPilot III Deluxe w/128MB, *new* City Navigator w/all unlocks and portable bean bag mount....(MAP $999.00) Call or email us for our current price....too low to advertise! IN STOCK! - -

    - -*MetroGuide USA MapSource....$90.00 IN STOCK! - -

    - -*MetroGuide USA MapSource w/Blank 8MB Memory Cartridge....$110.00 IN STOCK! - -

    - -*MetroGuide USA MapSource w/Blank 16MB Memory Cartridge....$115.00 IN STOCK! - -

    - -*MetroGuide Canada with Roads & Recreation....$80.00 IN STOCK! - -

    - -*City Navigator Europe....$195.00 IN STOCK! - -

    - -*City Navigator Europe "All" unlock....$215.00 IN STOCK! - -

    - -*City Select Europe....$115.00 IN STOCK! - -

    - -*City Select Europe "All" unlock....$115.00 IN STOCK! - -

    - -*MetroGuide Europe....$115.00 IN STOCK! - -

    - -*Roads & Recreation Europe....$85.00 IN STOCK! - -

    - -*City Navigator Australia....$265.00 IN STOCK! - -

    - -*BlueChart w/one coverage area....(MAP Americas-$139.00/Atlantic-$229.00/Pacific-$189.00) Call or email us for our current prices....too low to advertise! IN STOCK! - -

    - -*BlueChart Single Region Unlock....Americas-$85.00/Atlantic-$145.00/Pacific-$105.00 IN STOCK! - -

    - -Blank 8MB Memory Cartridge....$45.00 IN STOCK! - -

    - -Blank 16MB Memory Cartridge....$55.00 IN STOCK! - -

    - -Blank 32MB Memory Cartridge....$70.00 IN STOCK! - -

    - -Blank 64MB Memory Cartridge....$105.00 IN STOCK! - -

    - -Blank 128MB Memory Cartridge....$155.00 IN STOCK! - -

    - -USB Data Card Programmer....$70.00 IN STOCK! - -

    - -PC Download Kit (includes AC/DC adapter and 12V cigarette power/PC interface cable (for round, 4 pin connectors only)....$45.00 - -

    - -eMap/eTrex PC Download Kit (includes AC/DC adapter and cigarette power/PC interface cable....$50.00 - -

    - -GPSMAP 162....$355.00 (w/internal antenna)/$375.00 (w/external antenna) IN STOCK! - -

    - -GPSMAP 168 Sounder....$495.00 (w/internal antenna)/$515.00 (w/external antenna) IN STOCK! - -

    - -NavTalk Cellular phone/GPS (ver. 2.16)....$375.00 - -

    - -GBR 21 and GBR 23 Differential Receivers....$180.00 - -

    - -Videos available on many of the Garmin products as well as general GPS usage videos. - -

    - -Garmin GPS and accessories catalog....$2.00 (for s/h in US. Refundable/free with order) - -

    - -Online GARMIN manuals.

    - -
    - -Stock status subject to change. We try to update the stock status continuously but we sometimes don't get it changed immediately. Check with us for current stock status.

    - -

    Our Return Policy

    Software Return Policy - -

    - - -Accessories and Miscellaneous Items - -

    - - -AVIATION GPS

    - -
    - -

    We also sell Garmin GPS accessories such as mounts, cables, cases, etc. - -

    - - We sell everything in the Garmin outdoor recreation, marine and cartography line. Email us for prices on any items you don't see listed above.
    - -

    -

    -We charge a flat $10.00 shipping and handling charge (via UPS ground) per GPS order (not per item) in the 48/US.

    $5.00 shipping and handling for accessories in the 48/US.

    An additional $10.00 charge for COD orders (COD s/h must be credit card secured).

    Faster shipping available.

    *3 day select (usually arrives in 2 days!)--addtl. $3.00.
    *2nd day air--addtl. $5.00.
    *Next day air saver--addtl. $20.00.
    *Next day air-Saturday delivery--addtl. $35.00
    *More shipping may be required on larger packages for 3 day, 2nd day and next day air packages.

    Click here to get UPS Ground delivery times. Our zip code is 67601 (Hays, Kansas).

    -Add $10 to UPS charges for FedEx shipping. (minimum FedEx s/h is $18) - -

    - -$20 for Priority Mail s/h on GPS units and $15 for accessories in the US. - -

    - -Email us for requirements/costs for out of 48/US sales or click here. - -



    - -

    ORDERING INFORMATION



    - -* Most orders received by 2:00 p.m. central time for in stock items will ship the same day (business days only). - -

    - -All orders in Kansas must pay a 6.8% sales tax. - -

    - -We accept payment by Discover/MasterCard/Visa/Pre-pay (orders paid by personal/company check orders held for 10 business days for check clearing. Cashier checks/money orders ship same day.). COD orders welcome (cashiers check or money order).

    - - - -
    rescue,hunting,fishing,camping,adsfg,videogi,productshun,GPS III,Garmin,StreetPilot,gps3,gpsIII,gps2,gps2plus,gpsII+,Street Atlas,StreetAtlas,Osborne,Plainville,Stockton,Victoria,Ellis,Kansas,WaKeeney,Quinter,Russell,LaCrosse,Gorham,gpsIIIPLUS,gps3+,gps III+,gps 3+,DeLorme,GPS III Plus,GPS III Pilot,aviation gps,DeLorme Street Atlas,garmin aviation,metro guides,MetroGuides,truck navigation,semi navigation,over the road navigation,navigation aids,truck stops,metro gides,colormap streetpilot,color streetpilot,guidance by Garmin,color street pilot,color map,color map streetpilot,color map Street Pilot,MetroGuide,garmin international,garmond,garmund,magellan,gps12,gps 12,gps12xl,gps 12XL,gps12cx,RANS,gps 12CX,gps12CX,color streetpilot,streetpilot color map,garmin gps,Street Pilot,experimental aircraft,EEA,tvnav.com,gps 12 MAP,NavTalk,StreetPilot ColorMap,emap,ColorMap,Street Pilot ColorMap,Street Pilot Color Map,cell phone,cellular phone,cellar phone,cellar,cellular,EMAP,e map,Nav Talk,GPS,G P S,Global Positioning System,globalpositioningsystem,gps outfitters,gps video,cables,gps cables,navigation,mapsource,map source,MapSource,TOPO MapSource,MetroGuide MapSource - -

    - - - -

    - -send email - -

    - -

    Toll Free Order Line (877) 625-3546 (US only)

    FAX (413) 383-8800

    Information /International Order Line (785) 625-3546

    - -
    - -

    Home Page

    - -
    - -
    - - - - - - - - - - - -
    - Subscribe to the TVNAV.COM GarminGPS mail list -
    - - - -
    - Powered by groups.yahoo.com -
    -
    - -

    - - - - -
    - -Counter reset 2/1/99 -

    -This site last modified 7/25/02
    - -

    - -
    - - - - diff --git a/tidylib-src/test/output/out_427820.html b/tidylib-src/test/output/out_427820.html deleted file mode 100755 index aa08f0c8..00000000 --- a/tidylib-src/test/output/out_427820.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - Test Input For Bug #427820 - - - - - - - -

    -
    - - - diff --git a/tidylib-src/test/output/out_427826.html b/tidylib-src/test/output/out_427826.html deleted file mode 100755 index d92a74a7..00000000 --- a/tidylib-src/test/output/out_427826.html +++ /dev/null @@ -1,35 +0,0 @@ - - - -[#427826] Script source needs escaping/CDATA section - - - - - -

    If converted to XML/XHTML, the < in the javascript source -above causes problems for XML tools.

    - - - diff --git a/tidylib-src/test/output/out_431721.html b/tidylib-src/test/output/out_431721.html deleted file mode 100755 index 716a09b1..00000000 --- a/tidylib-src/test/output/out_431721.html +++ /dev/null @@ -1,54 +0,0 @@ - - - Joe-Bob Briggs LLP - - - -
    -

    Joe-Bob Briggs LLP

    - -

    - -

    Bryan Joe-Bob LLP is a leading national and international - corporate, litigation and private client law firm.  We - represent a wide variety of business, institutional and - individual clients for whom our lawyers handle a wide range - of matters.  As a result, our lawyers are well prepared - to meet the needs of clients whether large or small, public - or private, for-profit or not-for-profit.

    - -

    - -

    Joe-Bob Briggs has more offices than you can shake a stick - at.  These locations give Joe-Bob the geographic reach - to assist his clients where their needs are most - pressing.

    - -
      -
    • Estate Planning
    • - -
    • Closely-Held Business Practice
    • - -
    • Estate, Gift, Income and Other Tax Advice
    • -
    - -

    - -

    Joe-Bob joined the Firm in 1995 after 15 years with the - Kansas City firm of Fish, Gill, Smoker & Butts, where he - was a Shareholder/Director.  John is a past Chair of the - Estate Planning, Probate and Trust Committee of the Kansas - City Metropolitan Bar Association and co-authored the - Drinking Procedures Manual for County Practitioners.  - Currently, JB is a member of the Missouri Bar Probate and - Trust Committee, the Estate Planning Society and the - Mid-America Planned Giving Council.  A fellow of the - American College of Trust and Estate Counsel, JB lectures - frequently on Estate Planning topics for both legal and lay - organizations. 

    - -

    -
    - - - diff --git a/tidylib-src/test/output/out_480701.html b/tidylib-src/test/output/out_480701.html deleted file mode 100755 index a3ad8fd1..00000000 --- a/tidylib-src/test/output/out_480701.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - diff --git a/tidylib-src/test/output/out_533233.html b/tidylib-src/test/output/out_533233.html deleted file mode 100755 index 4a16bcc6..00000000 --- a/tidylib-src/test/output/out_533233.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - Test for bug #533233 - - - - - - -

    Script sample 1

    - -

    Headline project—Link to offsite page.

    - -

    Input 1

    - -

    texttext

    - - - diff --git a/tidylib-src/test/output/out_540571.html b/tidylib-src/test/output/out_540571.html deleted file mode 100755 index 66077b3d..00000000 --- a/tidylib-src/test/output/out_540571.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - #540571 Inconsistent behaviour with span inline element - - - -

    - Hello World -

    - -

    The font inline is moved so it becomes a child of the h1 element.

    - -

    - Hello World -

    - -

    The span inline is not moved so it becomes a child of the h1 element, which is inconsistent and does not correspond with current browser behaviour any more.

    - - - diff --git a/tidylib-src/test/testall.sh b/tidylib-src/test/testall.sh deleted file mode 100755 index cefcd1bb..00000000 --- a/tidylib-src/test/testall.sh +++ /dev/null @@ -1,37 +0,0 @@ -#! /bin/sh - -# -# testall.sh - execute all testcases for regression testing -# -# (c) 1998-2001 (W3C) MIT, INRIA, Keio University -# See tidy.c for the copyright notice. -# -# -# -# CVS Info: -# -# $Author: creitzel $ -# $Date: 2002/10/15 19:44:18 $ -# $Revision: 1.9.2.2 $ -# -# set -x - -VERSION='$Id' - -BUGS="426885 427633 427662 427664 427671 427672 427675 427676 427677\ - 427810 427811 427813 427816 427818 427819 427820 427821 427822 427823\ - 427825 427827 427830 427833 427834 427835 427836 427837 427838 427839\ - 427840 427841 427844 427845 427846 431716 431719 431721 431731 431736\ - 431739 431874 431883 431889 431895 431898 431958 431964 432677 433012\ - 433021 433040 433359 433360 433656 433666 433672 433856 434047 434100\ - 434940 435903 435909 435917 435919 435920 435922 435923 437468 438650\ - 438658 438954 438956 441508 441568 443362 443576 443678 445074 445394\ - 445557 449348 470663 480701 487204 487283 501669 504206 505770 533233\ - 540571 543262 545772 553468 586555 586562 588061" - -for bugNo in ${BUGS} -do -# echo Testing $bugNo | tee -a testall.log - ./testone.sh $bugNo "$@" | tee -a testall.log -done - diff --git a/tidylib-src/test/testone.sh b/tidylib-src/test/testone.sh deleted file mode 100755 index bdcc2b37..00000000 --- a/tidylib-src/test/testone.sh +++ /dev/null @@ -1,105 +0,0 @@ -#! /bin/sh - -# -# testone.sh - execute a single testcase -# -# (c) 1998-2001 (W3C) MIT, INRIA, Keio University -# See tidy.c for the copyright notice. -# -# -# -# CVS Info: -# -# $Author: creitzel $ -# $Date: 2002/07/09 21:06:09 $ -# $Revision: 1.5.2.1 $ -# -# set -x - -VERSION='$Id' - -echo Testing $1 - -set +f - -TIDY=../bin/tidy -INFILES=./input/in_$1.*ml -CFGFILE=./input/cfg_$1.txt -OUTFILE=./output/out_$1.html - -TIDYFILE=./tmp/out_$1.html -MSGFILE=./tmp/msg_$1.txt -DIFFOUT=./tmp/diff_$1.txt - -unset HTML_TIDY - -REPORTWARN=$2 -shift -if [ $REPORTWARN ] -then - shift -fi - -# Remove any pre-exising test outputs -for INFIL in $MSGFILE $TIDYFILE $DIFFOUT -do - if [ -f $INFIL ] - then - rm $INFIL - fi -done - -for INFILE in $INFILES -do - if [ -r $INFILE ] - then - break - fi -done - -# If no test specific config file, use default. -if [ ! -f $CFGFILE ] -then - CFGFILE=./input/cfg_default.txt -fi - -$TIDY -f $MSGFILE -config $CFGFILE "$@" --tidy-mark no $INFILE > $TIDYFILE -STATUS=$? - -if [ $STATUS -gt 1 ] -then - cat $MSGFILE - exit $STATUS -fi - -if [ $REPORTWARN ] -then - if [ $STATUS -gt 0 ] - then - cat $MSGFILE - exit $STATUS - fi -fi - - -if [ ! -s $TIDYFILE ] -then - cat $MSGFILE - exit 1 -fi - -if [ -f $OUTFILE ] -then - diff $TIDYFILE $OUTFILE > $DIFFOUT - - # Not a valid shell test - if [ -s diff.txt ] - then - cat $MSGFILE - cat $DIFFOUT - exit 1 - fi -fi - -exit 0 -