tidy-ext 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +4 -0
- data/LICENSE +50 -0
- data/README +12 -0
- data/Rakefile +60 -0
- data/VERSION +1 -0
- data/ext/tidy/access.c +3310 -0
- data/ext/tidy/access.h +279 -0
- data/ext/tidy/alloc.c +107 -0
- data/ext/tidy/attrask.c +209 -0
- data/ext/tidy/attrdict.c +2398 -0
- data/ext/tidy/attrdict.h +122 -0
- data/ext/tidy/attrget.c +213 -0
- data/ext/tidy/attrs.c +1911 -0
- data/ext/tidy/attrs.h +374 -0
- data/ext/tidy/buffio.c +232 -0
- data/ext/tidy/buffio.h +118 -0
- data/ext/tidy/charsets.c +1032 -0
- data/ext/tidy/charsets.h +14 -0
- data/ext/tidy/clean.c +2674 -0
- data/ext/tidy/clean.h +87 -0
- data/ext/tidy/config.c +1746 -0
- data/ext/tidy/config.h +153 -0
- data/ext/tidy/entities.c +419 -0
- data/ext/tidy/entities.h +24 -0
- data/ext/tidy/extconf.rb +5 -0
- data/ext/tidy/fileio.c +106 -0
- data/ext/tidy/fileio.h +46 -0
- data/ext/tidy/forward.h +69 -0
- data/ext/tidy/iconvtc.c +105 -0
- data/ext/tidy/iconvtc.h +15 -0
- data/ext/tidy/istack.c +373 -0
- data/ext/tidy/lexer.c +3825 -0
- data/ext/tidy/lexer.h +617 -0
- data/ext/tidy/localize.c +1882 -0
- data/ext/tidy/mappedio.c +329 -0
- data/ext/tidy/mappedio.h +16 -0
- data/ext/tidy/message.h +207 -0
- data/ext/tidy/parser.c +4408 -0
- data/ext/tidy/parser.h +76 -0
- data/ext/tidy/platform.h +636 -0
- data/ext/tidy/pprint.c +2276 -0
- data/ext/tidy/pprint.h +93 -0
- data/ext/tidy/ruby-tidy.c +195 -0
- data/ext/tidy/streamio.c +1407 -0
- data/ext/tidy/streamio.h +222 -0
- data/ext/tidy/tagask.c +286 -0
- data/ext/tidy/tags.c +955 -0
- data/ext/tidy/tags.h +235 -0
- data/ext/tidy/tidy-int.h +129 -0
- data/ext/tidy/tidy.h +1097 -0
- data/ext/tidy/tidyenum.h +622 -0
- data/ext/tidy/tidylib.c +1751 -0
- data/ext/tidy/tmbstr.c +306 -0
- data/ext/tidy/tmbstr.h +92 -0
- data/ext/tidy/utf8.c +539 -0
- data/ext/tidy/utf8.h +52 -0
- data/ext/tidy/version.h +14 -0
- data/ext/tidy/win32tc.c +795 -0
- data/ext/tidy/win32tc.h +19 -0
- data/spec/spec_helper.rb +5 -0
- data/spec/tidy/compat_spec.rb +44 -0
- data/spec/tidy/remote_uri_spec.rb +14 -0
- data/spec/tidy/test1.html +5 -0
- data/spec/tidy/tidy_spec.rb +34 -0
- metadata +125 -0
data/ext/tidy/clean.h
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
#ifndef __CLEAN_H__
|
2
|
+
#define __CLEAN_H__
|
3
|
+
|
4
|
+
/* clean.h -- clean up misuse of presentation markup
|
5
|
+
|
6
|
+
(c) 1998-2006 (W3C) MIT, ERCIM, Keio University
|
7
|
+
See tidy.h for the copyright notice.
|
8
|
+
|
9
|
+
CVS Info:
|
10
|
+
$Author: arnaud02 $
|
11
|
+
$Date: 2006/09/12 15:14:44 $
|
12
|
+
$Revision: 1.14 $
|
13
|
+
|
14
|
+
*/
|
15
|
+
|
16
|
+
void TY_(FixNodeLinks)(Node *node);
|
17
|
+
|
18
|
+
void TY_(FreeStyles)( TidyDocImpl* doc );
|
19
|
+
|
20
|
+
/* Add class="foo" to node
|
21
|
+
*/
|
22
|
+
void TY_(AddStyleAsClass)( TidyDocImpl* doc, Node *node, ctmbstr stylevalue );
|
23
|
+
void TY_(AddStyleProperty)(TidyDocImpl* doc, Node *node, ctmbstr property );
|
24
|
+
|
25
|
+
void TY_(CleanDocument)( TidyDocImpl* doc );
|
26
|
+
|
27
|
+
/* simplifies <b><b> ... </b> ...</b> etc. */
|
28
|
+
void TY_(NestedEmphasis)( TidyDocImpl* doc, Node* node );
|
29
|
+
|
30
|
+
/* replace i by em and b by strong */
|
31
|
+
void TY_(EmFromI)( TidyDocImpl* doc, Node* node );
|
32
|
+
|
33
|
+
/*
|
34
|
+
Some people use dir or ul without an li
|
35
|
+
to indent the content. The pattern to
|
36
|
+
look for is a list with a single implicit
|
37
|
+
li. This is recursively replaced by an
|
38
|
+
implicit blockquote.
|
39
|
+
*/
|
40
|
+
void TY_(List2BQ)( TidyDocImpl* doc, Node* node );
|
41
|
+
|
42
|
+
/*
|
43
|
+
Replace implicit blockquote by div with an indent
|
44
|
+
taking care to reduce nested blockquotes to a single
|
45
|
+
div with the indent set to match the nesting depth
|
46
|
+
*/
|
47
|
+
void TY_(BQ2Div)( TidyDocImpl* doc, Node* node );
|
48
|
+
|
49
|
+
|
50
|
+
void TY_(DropSections)( TidyDocImpl* doc, Node* node );
|
51
|
+
|
52
|
+
|
53
|
+
/*
|
54
|
+
This is a major clean up to strip out all the extra stuff you get
|
55
|
+
when you save as web page from Word 2000. It doesn't yet know what
|
56
|
+
to do with VML tags, but these will appear as errors unless you
|
57
|
+
declare them as new tags, such as o:p which needs to be declared
|
58
|
+
as inline.
|
59
|
+
*/
|
60
|
+
void TY_(CleanWord2000)( TidyDocImpl* doc, Node *node);
|
61
|
+
|
62
|
+
Bool TY_(IsWord2000)( TidyDocImpl* doc );
|
63
|
+
|
64
|
+
/* where appropriate move object elements from head to body */
|
65
|
+
void TY_(BumpObject)( TidyDocImpl* doc, Node *html );
|
66
|
+
|
67
|
+
/* This is disabled due to http://tidy.sf.net/bug/681116 */
|
68
|
+
#if 0
|
69
|
+
void TY_(FixBrakes)( TidyDocImpl* pDoc, Node *pParent );
|
70
|
+
#endif
|
71
|
+
|
72
|
+
void TY_(VerifyHTTPEquiv)( TidyDocImpl* pDoc, Node *pParent );
|
73
|
+
|
74
|
+
void TY_(DropComments)(TidyDocImpl* doc, Node* node);
|
75
|
+
void TY_(DropFontElements)(TidyDocImpl* doc, Node* node, Node **pnode);
|
76
|
+
void TY_(WbrToSpace)(TidyDocImpl* doc, Node* node);
|
77
|
+
void TY_(DowngradeTypography)(TidyDocImpl* doc, Node* node);
|
78
|
+
void TY_(ReplacePreformattedSpaces)(TidyDocImpl* doc, Node* node);
|
79
|
+
void TY_(NormalizeSpaces)(Lexer *lexer, Node *node);
|
80
|
+
void TY_(ConvertCDATANodes)(TidyDocImpl* doc, Node* node);
|
81
|
+
|
82
|
+
void TY_(FixAnchors)(TidyDocImpl* doc, Node *node, Bool wantName, Bool wantId);
|
83
|
+
void TY_(FixXhtmlNamespace)(TidyDocImpl* doc, Bool wantXmlns);
|
84
|
+
void TY_(FixLanguageInformation)(TidyDocImpl* doc, Node* node, Bool wantXmlLang, Bool wantLang);
|
85
|
+
|
86
|
+
|
87
|
+
#endif /* __CLEAN_H__ */
|