5
5
6
6
CVS Info :
7
7
8
- $Author: arnaud02 $
9
- $Date: 2008/06/18 20:18:54 $
10
- $Revision: 1.75 $
8
+ $Author: arnaud02 $
9
+ $Date: 2008/06/18 20:18:54 $
10
+ $Revision: 1.75 $
11
11
12
12
Defines HTML Tidy API implemented by tidy library.
13
-
13
+
14
14
Very rough initial cut for discussion purposes.
15
15
16
16
Public interface is const-correct and doesn't explicitly depend
17
17
on any globals. Thus, thread-safety may be introduced w/out
18
18
changing the interface.
19
19
20
- Looking ahead to a C++ wrapper, C functions always pass
20
+ Looking ahead to a C++ wrapper, C functions always pass
21
21
this-equivalent as 1st arg.
22
22
23
23
Created 2001-05-20 by Charles Reitzel
@@ -118,7 +118,7 @@ TidyOption tidyImplToOption( const TidyOptionImpl* option )
118
118
** 0 -> SUCCESS
119
119
** >0 -> WARNING
120
120
** <0 -> ERROR
121
- **
121
+ **
122
122
*/
123
123
124
124
TidyDoc TIDY_CALL tidyCreate (void )
@@ -629,8 +629,8 @@ Bool TIDY_CALL tidyOptCopyConfig( TidyDoc to, TidyDoc from )
629
629
630
630
/* I/O and Message handling interface
631
631
**
632
- ** By default, Tidy will define, create and use
633
- ** tdocances of input and output handlers for
632
+ ** By default, Tidy will define, create and use
633
+ ** tdocances of input and output handlers for
634
634
** standard C buffered I/O (i.e. FILE* stdin,
635
635
** FILE* stdout and FILE* stderr for content
636
636
** input, content output and diagnostic output,
@@ -640,7 +640,7 @@ Bool TIDY_CALL tidyOptCopyConfig( TidyDoc to, TidyDoc from )
640
640
*/
641
641
642
642
/* Use TidyReportFilter to filter messages by diagnostic level:
643
- ** info, warning, etc. Just set diagnostic output
643
+ ** info, warning, etc. Just set diagnostic output
644
644
** handler to redirect all diagnostics output. Return true
645
645
** to proceed with output, false to cancel.
646
646
*/
@@ -799,7 +799,7 @@ uint TIDY_CALL tidyConfigErrorCount( TidyDoc tdoc )
799
799
}
800
800
801
801
802
- /* Error reporting functions
802
+ /* Error reporting functions
803
803
*/
804
804
void TIDY_CALL tidyErrorSummary ( TidyDoc tdoc )
805
805
{
@@ -975,7 +975,7 @@ int tidyDocSaveFile( TidyDocImpl* doc, ctmbstr filnam )
975
975
if ( doc -> errors > 0 &&
976
976
cfgBool (doc , TidyWriteBack ) && !cfgBool (doc , TidyForceOutput ) )
977
977
status = tidyDocStatus ( doc );
978
- else
978
+ else
979
979
fout = fopen ( filnam , "wb" );
980
980
981
981
if ( fout )
@@ -1009,7 +1009,7 @@ int tidyDocSaveFile( TidyDocImpl* doc, ctmbstr filnam )
1009
1009
** The code has been left in in case it works w/ other compilers
1010
1010
** or operating systems. If stdout is in Text mode, be aware that
1011
1011
** it will garble UTF16 documents. In text mode, when it encounters
1012
- ** a single byte of value 10 (0xA), it will insert a single byte
1012
+ ** a single byte of value 10 (0xA), it will insert a single byte
1013
1013
** value 13 (0xD) just before it. This has the effect of garbling
1014
1014
** the entire document.
1015
1015
*/
@@ -1074,7 +1074,7 @@ int tidyDocSaveString( TidyDocImpl* doc, tmbstr buffer, uint* buflen )
1074
1074
TidyBuffer outbuf ;
1075
1075
StreamOut * out ;
1076
1076
int status ;
1077
-
1077
+
1078
1078
tidyBufInitWithAllocator ( & outbuf , doc -> allocator );
1079
1079
out = TY_ (BufferOutput )( doc , & outbuf , outenc , nl );
1080
1080
status = tidyDocSaveStream ( doc , out );
@@ -1098,7 +1098,7 @@ int tidyDocSaveBuffer( TidyDocImpl* doc, TidyBuffer* outbuf )
1098
1098
uint outenc = cfg ( doc , TidyOutCharEncoding );
1099
1099
uint nl = cfg ( doc , TidyNewline );
1100
1100
StreamOut * out = TY_ (BufferOutput )( doc , outbuf , outenc , nl );
1101
-
1101
+
1102
1102
status = tidyDocSaveStream ( doc , out );
1103
1103
TidyDocFree ( doc , out );
1104
1104
}
@@ -1145,7 +1145,7 @@ int TIDY_CALL tidyRunDiagnostics( TidyDoc tdoc )
1145
1145
1146
1146
/* Workhorse functions.
1147
1147
**
1148
- ** Parse requires input source, all input config items
1148
+ ** Parse requires input source, all input config items
1149
1149
** and diagnostic sink to have all been set before calling.
1150
1150
**
1151
1151
** Emit likewise requires that document sink and all
@@ -1227,7 +1227,7 @@ int tidyDocRunDiagnostics( TidyDocImpl* doc )
1227
1227
TY_ (ReportMarkupVersion )( doc );
1228
1228
TY_ (ReportNumWarnings )( doc );
1229
1229
}
1230
-
1230
+
1231
1231
if ( doc -> errors > 0 && !force )
1232
1232
TY_ (NeedsAuthorIntervention )( doc );
1233
1233
@@ -1281,7 +1281,7 @@ int tidyDocCleanAndRepair( TidyDocImpl* doc )
1281
1281
TY_ (CleanDocument )( doc );
1282
1282
1283
1283
/* clean up html exported by Google Focs */
1284
- #if 0
1284
+ #if 1
1285
1285
if ( gdoc )
1286
1286
TY_ (CleanGoogleDocument )( doc );
1287
1287
#endif
@@ -1404,7 +1404,6 @@ int tidyDocSaveStream( TidyDocImpl* doc, StreamOut* out )
1404
1404
{
1405
1405
/* noop */
1406
1406
TY_ (DropFontElements )(doc , & doc -> root , NULL );
1407
- TY_ (WbrToSpace )(doc , & doc -> root );
1408
1407
}
1409
1408
1410
1409
if ((makeClean && asciiChars ) || makeBare )
@@ -1455,8 +1454,8 @@ int tidyDocSaveStream( TidyDocImpl* doc, StreamOut* out )
1455
1454
**
1456
1455
** The big issue here is the degree to which we should mimic
1457
1456
** a DOM and/or SAX nodes.
1458
- **
1459
- ** Is it 100% possible (and, if so, how difficult is it) to
1457
+ **
1458
+ ** Is it 100% possible (and, if so, how difficult is it) to
1460
1459
** emit SAX events from this API? If SAX events are possible,
1461
1460
** is that 100% of data needed to build a DOM?
1462
1461
*/
@@ -1587,7 +1586,7 @@ Bool TIDY_CALL tidyNodeGetText( TidyDoc tdoc, TidyNode tnod, TidyBuffer* outbuf
1587
1586
1588
1587
TY_ (PFlushLine )( doc , 0 );
1589
1588
doc -> docOut = NULL ;
1590
-
1589
+
1591
1590
TidyDocFree ( doc , out );
1592
1591
return yes ;
1593
1592
}
0 commit comments