Package | Description |
---|---|
org.w3c.tidy |
Modifier and Type | Method and Description |
---|---|
private void |
Clean.addColorRule(Lexer lexer,
java.lang.String selector,
java.lang.String color)
Adds a css rule for color.
|
void |
PPrint.addTransitionEffect(Lexer lexer,
Node root,
double duration)
Add meta element for page transition effect, this works on IE but not NS.
|
void |
Report.attrError(Lexer lexer,
Node node,
AttVal attribute,
short code)
Prints error messages for attributes.
|
(package private) static void |
ParserImpl.badForm(Lexer lexer)
errors in positioning of form start or end tags generally require human intervention to fix.
|
private boolean |
Clean.blockStyle(Lexer lexer,
Node node)
Symptom: the only child of a block-level element is a presentation element such as B, I or FONT.
|
(package private) static void |
Clean.bumpObject(Lexer lexer,
Node html)
Where appropriate move object elements from head to body.
|
private boolean |
Clean.center2Div(Lexer lexer,
Node node,
Node[] pnode)
Symptom:
|
void |
TagCheck.check(Lexer lexer,
Node node)
Checks attributes in given Node.
|
void |
TagCheckImpl.CheckHTML.check(Lexer lexer,
Node node) |
void |
TagCheckImpl.CheckSCRIPT.check(Lexer lexer,
Node node) |
void |
TagCheckImpl.CheckTABLE.check(Lexer lexer,
Node node) |
void |
TagCheckImpl.CheckCaption.check(Lexer lexer,
Node node) |
void |
TagCheckImpl.CheckHR.check(Lexer lexer,
Node node) |
void |
TagCheckImpl.CheckIMG.check(Lexer lexer,
Node node) |
void |
TagCheckImpl.CheckAREA.check(Lexer lexer,
Node node) |
void |
TagCheckImpl.CheckAnchor.check(Lexer lexer,
Node node) |
void |
TagCheckImpl.CheckMap.check(Lexer lexer,
Node node) |
void |
TagCheckImpl.CheckSTYLE.check(Lexer lexer,
Node node) |
void |
TagCheckImpl.CheckForm.check(Lexer lexer,
Node node) |
void |
TagCheckImpl.CheckMeta.check(Lexer lexer,
Node node) |
void |
TagCheckImpl.CheckTableCell.check(Lexer lexer,
Node node) |
void |
TagCheckImpl.CheckLINK.check(Lexer lexer,
Node node) |
void |
AttrCheckImpl.CheckUrl.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckScript.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckAlign.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckValign.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckBool.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckLength.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckTarget.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckFsubmit.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckClear.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckShape.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckScope.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckNumber.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckId.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckName.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckColor.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckVType.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckScroll.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckTextDir.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheckImpl.CheckLang.check(Lexer lexer,
Node node,
AttVal attval) |
void |
AttrCheck.check(Lexer lexer,
Node node,
AttVal attval)
Check the value of an attribute.
|
Attribute |
AttVal.checkAttribute(Lexer lexer,
Node node)
Check attribute name/value and report errors.
|
void |
Node.checkAttributes(Lexer lexer)
Default method for checking an element's attributes.
|
(package private) void |
AttVal.checkLowerCaseAttrValue(Lexer lexer,
Node node)
Check the attribute value for uppercase letters (only if the value should be lowercase, required for literal
values in xhtml).
|
private void |
Clean.cleanBodyAttrs(Lexer lexer,
Node body)
Move presentation attribs from body to style element.
|
private Node |
Clean.cleanNode(Lexer lexer,
Node node)
Applies all matching rules to a node.
|
void |
Clean.cleanTree(Lexer lexer,
Node doc)
Clean an html tree.
|
void |
Clean.cleanWord2000(Lexer lexer,
Node node)
This is a major clean up to strip out all the extra stuff you get when you save as web page from Word 2000.
|
static void |
Node.coerceNode(Lexer lexer,
Node node,
Dict tag)
Coerce a node.
|
void |
PPrint.createSlides(Lexer lexer,
Node root)
Creates slides from h2.
|
private void |
Clean.createStyleElement(Lexer lexer,
Node doc)
Create style element using rules from dictionary.
|
private Node |
Clean.createStyleProperties(Lexer lexer,
Node node,
Node[] prepl)
Special case: if the current node is destroyed by CleanNode() lower in the tree, this node and its parent no
longer exist.
|
private void |
Clean.defineStyleRules(Lexer lexer,
Node node)
Find style attribute in node content, and replace it by corresponding class attribute.
|
private boolean |
Clean.dir2Div(Lexer lexer,
Node node)
Symptom:
<dir><li> where <li> is only child. |
void |
Clean.dropSections(Lexer lexer,
Node node)
Drop if/endif sections inserted by word2000.
|
void |
Report.encodingError(Lexer lexer,
int code,
int c)
Prints encoding error messages.
|
void |
Report.entityError(Lexer lexer,
short code,
java.lang.String entity,
int c)
Prints entity error messages.
|
void |
Report.error(Lexer lexer,
Node element,
Node node,
short code)
Prints errors.
|
void |
Report.errorSummary(Lexer lexer)
Prints error summary.
|
protected static Node |
Node.escapeTag(Lexer lexer,
Node element)
Escapes the given tag.
|
private java.lang.String |
Clean.findStyle(Lexer lexer,
java.lang.String tag,
java.lang.String properties)
Finds a css style.
|
static void |
Node.fixEmptyRow(Lexer lexer,
Node row)
If a table row is empty then insert an empty cell.This practice is consistent with browser behavior and avoids
potential problems with row spanning cells.
|
private boolean |
Clean.font2Span(Lexer lexer,
Node node,
Node[] pnode)
Replace font elements by span elements, deleting the font element's attributes and replacing them by a single
style attribute.
|
private java.lang.String |
Clean.gensymClass(Lexer lexer)
Generates a new css class name.
|
protected java.lang.String |
Report.getMessage(int errorCode,
Lexer lexer,
java.lang.String message,
java.lang.Object[] params,
TidyMessage.Level level)
Generates a complete message for the warning/error.
|
private java.lang.String |
Report.getPosition(Lexer lexer)
Returns a formatted String describing the current position in file.
|
(package private) static boolean |
PPrint.hasCDATA(Lexer lexer,
Node node)
Does the current node contain a CDATA section?
|
private boolean |
Clean.inlineStyle(Lexer lexer,
Node node,
Node[] pnode)
If the node has only one b, i, or font child remove the child node and add the appropriate style attributes to
parent.
|
static void |
Node.insertDocType(Lexer lexer,
Node element,
Node doctype)
The doctype has been found after other tags, and needs moving to before the html element.
|
boolean |
Node.isBlank(Lexer lexer)
Is the node content empty or blank? Assumes node is a text node.
|
private boolean |
Clean.mergeDivs(Lexer lexer,
Node node)
Symptom:
<div><div>...</div></div> Action: merge the two divs. |
(package private) static void |
ParserImpl.moveNodeToBody(Lexer lexer,
Node node)
moves given node to end of body element.
|
protected static void |
ParserImpl.moveToHead(Lexer lexer,
Node element,
Node node)
Move node to the head, where element is used as starting point in hunt for head.
|
private boolean |
Clean.nestedList(Lexer lexer,
Node node,
Node[] pnode)
Symptom:
...
|
private boolean |
Clean.niceBody(Lexer lexer,
Node doc)
Check deprecated attributes in body tag.
|
private void |
Clean.normalizeSpaces(Lexer lexer,
Node node)
Map non-breaking spaces to regular spaces.
|
void |
Parser.parse(Lexer lexer,
Node node,
short mode)
Parse the given node.
|
void |
ParserImpl.ParseHTML.parse(Lexer lexer,
Node html,
short mode) |
void |
ParserImpl.ParseHead.parse(Lexer lexer,
Node head,
short mode) |
void |
ParserImpl.ParseTitle.parse(Lexer lexer,
Node title,
short mode) |
void |
ParserImpl.ParseScript.parse(Lexer lexer,
Node script,
short mode) |
void |
ParserImpl.ParseBody.parse(Lexer lexer,
Node body,
short mode) |
void |
ParserImpl.ParseFrameSet.parse(Lexer lexer,
Node frameset,
short mode) |
void |
ParserImpl.ParseInline.parse(Lexer lexer,
Node element,
short mode) |
void |
ParserImpl.ParseList.parse(Lexer lexer,
Node list,
short mode) |
void |
ParserImpl.ParseEmpty.parse(Lexer lexer,
Node element,
short mode) |
void |
ParserImpl.ParseDefList.parse(Lexer lexer,
Node list,
short mode) |
void |
ParserImpl.ParsePre.parse(Lexer lexer,
Node pre,
short mode) |
void |
ParserImpl.ParseBlock.parse(Lexer lexer,
Node element,
short mode) |
void |
ParserImpl.ParseTableTag.parse(Lexer lexer,
Node table,
short mode) |
void |
ParserImpl.ParseColGroup.parse(Lexer lexer,
Node colgroup,
short mode) |
void |
ParserImpl.ParseRowGroup.parse(Lexer lexer,
Node rowgroup,
short mode) |
void |
ParserImpl.ParseRow.parse(Lexer lexer,
Node row,
short mode) |
void |
ParserImpl.ParseNoFrames.parse(Lexer lexer,
Node noframes,
short mode) |
void |
ParserImpl.ParseSelect.parse(Lexer lexer,
Node field,
short mode) |
void |
ParserImpl.ParseText.parse(Lexer lexer,
Node field,
short mode) |
void |
ParserImpl.ParseOptGroup.parse(Lexer lexer,
Node field,
short mode) |
static Node |
ParserImpl.parseDocument(Lexer lexer)
HTML is the top level element.
|
protected static void |
ParserImpl.parseTag(Lexer lexer,
Node node,
short mode) |
static Node |
ParserImpl.parseXMLDocument(Lexer lexer) |
static void |
ParserImpl.parseXMLElement(Lexer lexer,
Node element,
short mode)
XML documents.
|
(package private) void |
PPrint.printBody(Out fout,
Lexer lexer,
Node root,
boolean xml)
Print just the content of the body element.
|
private void |
PPrint.printDocType(Out fout,
int indent,
Lexer lexer,
Node node) |
private void |
Report.printMessage(int errorCode,
Lexer lexer,
java.lang.String message,
java.lang.Object[] params,
TidyMessage.Level level)
Prints a message to lexer.errout after calling getMessage().
|
private void |
PPrint.printScriptStyle(Out fout,
short mode,
int indent,
Lexer lexer,
Node node)
Print script and style elements.
|
void |
PPrint.printSlide(Out fout,
short mode,
int indent,
Lexer lexer)
Called from printTree to print the content of a slide from the node slidecontent.
|
private void |
PPrint.printTag(Lexer lexer,
Out fout,
short mode,
int indent,
Node node) |
void |
PPrint.printTree(Out fout,
short mode,
int indent,
Lexer lexer,
Node node) |
void |
PPrint.printXMLTree(Out fout,
short mode,
int indent,
Lexer lexer,
Node node) |
Node |
Clean.pruneSection(Lexer lexer,
Node node)
node is
<![if ...]> prune up to <![endif]> . |
void |
Node.repairDuplicateAttributes(Lexer lexer)
The same attribute name can't be used more than once in each element.
|
void |
Report.reportNumWarnings(java.io.PrintWriter errout,
Lexer lexer)
Prints the number of error/warnings found.
|
void |
Report.reportVersion(java.io.PrintWriter errout,
Lexer lexer,
java.lang.String filename,
Node doctype)
Prints information for html version in input file.
|
void |
StreamIn.setLexer(Lexer lexer)
Setter for lexer instance (needed for error reporting).
|
void |
StreamInJavaImpl.setLexer(Lexer lexer) |
(package private) boolean |
Clean.singleSpace(Lexer lexer,
Node node)
Does element have a single space as its content?
|
Node |
Clean.stripSpan(Lexer lexer,
Node span)
Word2000 uses span excessively, so we strip span out.
|
private void |
Clean.style2Rule(Lexer lexer,
Node node)
Find style attribute in node, and replace it by corresponding class attribute.
|
private void |
Clean.textAlign(Lexer lexer,
Node node)
Symptom:
<p align=center> . |
private int |
PPrint.textEndsWithNewline(Lexer lexer,
Node node)
Is text node and already ends w/ a newline? Used to pretty print CDATA/PRE text content.
|
static void |
Node.trimEmptyElement(Lexer lexer,
Node element)
Trim an empty element.
|
static void |
Node.trimInitialSpace(Lexer lexer,
Node element,
Node text)
This maps
<p> hello <em> world </em> to <p> hello <em> world </em> . |
static void |
Node.trimSpaces(Lexer lexer,
Node element)
Move initial and trailing space out.
|
static void |
Node.trimTrailingSpace(Lexer lexer,
Node element,
Node last)
This maps hello world to hello world .
|
void |
Report.warning(Lexer lexer,
Node element,
Node node,
short code)
Prints warnings.
|