Package | Description |
---|---|
com.kamontat.utilities | |
com.overzealous.remark.convert |
This package contains the classes that walk the Jsoup document and processConvert it into Markdown code.
|
org.jsoup.examples |
Contains example programs and use of jsoup.
|
org.jsoup.nodes |
HTML document structure nodes.
|
org.jsoup.parser |
Contains the HTML parser, tag specifications, and HTML tokeniser.
|
org.jsoup.safety |
Contains the jsoup HTML cleaner, and whitelist definitions.
|
org.jsoup.select |
Packages to support the CSS-style element selector.
|
Modifier and Type | Method and Description |
---|---|
static Element |
HtmlUtil.coverTag(String html,
String... tagNames)
cover
html by tagNames by first element of tagName will be outermost. |
static Element |
HtmlUtil.toHtmlByHtml(String html)
insert html tag in the top
Beware: It's include head and body tag too |
static Element |
HtmlUtil.toHtmlByPlain(String plainText)
same work with
HtmlUtil.toHtmlByHtml(String) but think input parameter as plain text (so meaning if there have charactor that cannot convert to html it's will change to other) Example: |
Modifier and Type | Method and Description |
---|---|
String |
DocumentConverter.getInlineContent(NodeHandler currentNode,
Element el)
Recursively processes child nodes and returns the potential output string.
|
String |
DocumentConverter.getInlineContent(NodeHandler currentNode,
Element el,
boolean undoLeadingEscapes)
Recursively processes child nodes and returns the potential output string.
|
void |
NodeRemover.handleIgnoredHTMLElement(Element node,
DocumentConverter converter) |
void |
NodeHandler.handleIgnoredHTMLElement(Element node,
DocumentConverter converter)
Handle an ignored HTMLElement.
|
void |
AbstractNodeHandler.handleIgnoredHTMLElement(Element node,
DocumentConverter converter)
Handle an ignored HTMLElement.
|
void |
Table.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter) |
void |
Paragraph.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter)
Creates a standard text block, then walks down over inline nodes.
|
void |
NodeRemover.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter) |
void |
NodeHandler.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter)
Handles an HTML Element node.
|
void |
List.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter) |
void |
InlineStyle.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter)
Renders inline styling (bold, italics) for the given tag.
|
void |
InlineCode.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter)
Renders inline-styled code.
|
void |
Image.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter)
Creates a link reference to an image, and renders the correct output.
|
void |
HorizontalRule.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter) |
void |
Header.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter)
Renders a header node (h1..h6).
|
void |
Definitions.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter) |
void |
DefaultNodeHandler.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter)
For the default state element, the nodes are simply ignored, recursing as necessary.
|
void |
Codeblock.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter)
Converts a pre-formatted block of code.
|
void |
Break.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter)
Renders out forced linebreaks.
|
void |
BlockQuote.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter)
Processes a quoted section.
|
void |
Anchor.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter)
Creates a link reference, and renders the correct output.
|
void |
Abbr.handleNode(NodeHandler parent,
Element node,
DocumentConverter converter)
Handles abbreviations.
|
protected void |
AbstractNodeHandler.prependAndRecurse(String prepend,
Element node,
DocumentConverter converter,
Map<String,NodeHandler> nodes)
Recursively processes child nodes, and prepends the given string to the output.
|
void |
DocumentConverter.walkNodes(NodeHandler currentNode,
Element el)
Loops over the children of an HTML Element, handling TextNode and child Elements.
|
void |
DocumentConverter.walkNodes(NodeHandler currentNodeHandler,
Element el,
Map<String,NodeHandler> nodeList)
Loops over the children of an HTML Element, handling TextNode and child Elements.
|
Modifier and Type | Method and Description |
---|---|
String |
HtmlToPlainText.getPlainText(Element element)
Format an Element to plain-text
|
Modifier and Type | Class and Description |
---|---|
class |
Document
A HTML Document.
|
class |
FormElement
A HTML Form Element provides ready access to the form fields/controls that are associated with it.
|
Modifier and Type | Method and Description |
---|---|
Element |
Element.addClass(String className)
Add a class name to this element's
class attribute. |
Element |
Element.after(Node node)
Insert the specified node into the DOM after this node (as a following sibling).
|
Element |
Element.after(String html)
Insert the specified HTML into the DOM after this element (as a following sibling).
|
Element |
Element.append(String html)
Add inner HTML to this element.
|
Element |
Element.appendChild(Node child)
Add a node child node to this element.
|
Element |
Element.appendElement(String tagName)
Create a new element by tag name, and add it as the last child.
|
Element |
Element.appendText(String text)
Create and append a new TextNode to this element.
|
Element |
Element.attr(String attributeKey,
boolean attributeValue)
Set a boolean attribute value on this element.
|
Element |
Element.attr(String attributeKey,
String attributeValue)
Set an attribute value on this element.
|
Element |
Element.before(Node node)
Insert the specified node into the DOM before this node (as a preceding sibling).
|
Element |
Element.before(String html)
Insert the specified HTML into the DOM before this element (as a preceding sibling).
|
Element |
Document.body()
Accessor to the document's
body element. |
Element |
Element.child(int index)
Get a child element of this element, by its 0-based index number.
|
Element |
Element.classNames(Set<String> classNames)
Set the element's
class attribute to the supplied class names. |
Element |
Element.clone() |
Element |
Document.createElement(String tagName)
Create a new Element, with this document's base uri.
|
Element |
Element.empty()
Remove all of the element's child nodes.
|
Element |
Element.firstElementSibling()
Gets the first element sibling of this element.
|
Element |
Element.getElementById(String id)
Find an element by ID, including or under this element.
|
Element |
Document.head()
Accessor to the document's
head element. |
Element |
Element.html(String html)
Set this element's inner HTML.
|
Element |
Element.insertChildren(int index,
Collection<? extends Node> children)
Inserts the given child nodes into this element at the specified index.
|
Element |
Element.lastElementSibling()
Gets the last element sibling of this element
|
Element |
Element.nextElementSibling()
Gets the next sibling element of this element.
|
Element |
Element.parent() |
Element |
Element.prepend(String html)
Add inner HTML into this element.
|
Element |
Element.prependChild(Node child)
Add a node to the start of this element's children.
|
Element |
Element.prependElement(String tagName)
Create a new element by tag name, and add it as the first child.
|
Element |
Element.prependText(String text)
Create and prepend a new TextNode to this element.
|
Element |
Element.previousElementSibling()
Gets the previous element sibling of this element.
|
Element |
Element.removeClass(String className)
Remove a class name from this element's
class attribute. |
Element |
Element.tagName(String tagName)
Change the tag of this element.
|
Element |
Element.text(String text)
Set the text of this element.
|
Element |
Document.text(String text)
Set the text of the
body of this document. |
Element |
Element.toggleClass(String className)
Toggle a class name on this element's
class attribute: if present, remove it; otherwise add it. |
Element |
Element.val(String value)
Set the value of a form element (input, textarea, etc).
|
Element |
Element.wrap(String html)
Wrap the supplied HTML around this element.
|
Modifier and Type | Method and Description |
---|---|
FormElement |
FormElement.addElement(Element element)
Add a form control element to this form.
|
Modifier and Type | Method and Description |
---|---|
static List<Node> |
Parser.parseFragment(String fragmentHtml,
Element context,
String baseUri)
Parse a fragment of HTML into a list of nodes.
|
static List<Node> |
Parser.parseFragment(String fragmentHtml,
Element context,
String baseUri,
ParseErrorList errorList)
Parse a fragment of HTML into a list of nodes.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
Whitelist.isSafeAttribute(String tagName,
Element el,
Attribute attr)
Test if the supplied attribute is allowed by this whitelist for this tag
|
Modifier and Type | Method and Description |
---|---|
Element |
Elements.first()
Get the first matched element.
|
Element |
Elements.last()
Get the last matched element.
|
Modifier and Type | Method and Description |
---|---|
protected abstract int |
Evaluator.CssNthEvaluator.calculatePosition(Element root,
Element element) |
protected int |
Evaluator.IsNthChild.calculatePosition(Element root,
Element element) |
protected int |
Evaluator.IsNthLastChild.calculatePosition(Element root,
Element element) |
protected int |
Evaluator.IsNthOfType.calculatePosition(Element root,
Element element) |
protected int |
Evaluator.IsNthLastOfType.calculatePosition(Element root,
Element element) |
static Elements |
Collector.collect(Evaluator eval,
Element root)
Build a list of elements, by visiting root and every descendant of root, and testing it against the evaluator.
|
abstract boolean |
Evaluator.matches(Element root,
Element element)
Test if the element meets the evaluator's requirements.
|
boolean |
Evaluator.Tag.matches(Element root,
Element element) |
boolean |
Evaluator.TagEndsWith.matches(Element root,
Element element) |
boolean |
Evaluator.Id.matches(Element root,
Element element) |
boolean |
Evaluator.Class.matches(Element root,
Element element) |
boolean |
Evaluator.Attribute.matches(Element root,
Element element) |
boolean |
Evaluator.AttributeStarting.matches(Element root,
Element element) |
boolean |
Evaluator.AttributeWithValue.matches(Element root,
Element element) |
boolean |
Evaluator.AttributeWithValueNot.matches(Element root,
Element element) |
boolean |
Evaluator.AttributeWithValueStarting.matches(Element root,
Element element) |
boolean |
Evaluator.AttributeWithValueEnding.matches(Element root,
Element element) |
boolean |
Evaluator.AttributeWithValueContaining.matches(Element root,
Element element) |
boolean |
Evaluator.AttributeWithValueMatching.matches(Element root,
Element element) |
boolean |
Evaluator.AllElements.matches(Element root,
Element element) |
boolean |
Evaluator.IndexLessThan.matches(Element root,
Element element) |
boolean |
Evaluator.IndexGreaterThan.matches(Element root,
Element element) |
boolean |
Evaluator.IndexEquals.matches(Element root,
Element element) |
boolean |
Evaluator.IsLastChild.matches(Element root,
Element element) |
boolean |
Evaluator.CssNthEvaluator.matches(Element root,
Element element) |
boolean |
Evaluator.IsFirstChild.matches(Element root,
Element element) |
boolean |
Evaluator.IsRoot.matches(Element root,
Element element) |
boolean |
Evaluator.IsOnlyChild.matches(Element root,
Element element) |
boolean |
Evaluator.IsOnlyOfType.matches(Element root,
Element element) |
boolean |
Evaluator.IsEmpty.matches(Element root,
Element element) |
boolean |
Evaluator.ContainsText.matches(Element root,
Element element) |
boolean |
Evaluator.ContainsData.matches(Element root,
Element element) |
boolean |
Evaluator.ContainsOwnText.matches(Element root,
Element element) |
boolean |
Evaluator.Matches.matches(Element root,
Element element) |
boolean |
Evaluator.MatchesOwn.matches(Element root,
Element element) |
static Elements |
Selector.select(Evaluator evaluator,
Element root)
Find elements matching selector.
|
static Elements |
Selector.select(String query,
Element root)
Find elements matching selector.
|
Modifier and Type | Method and Description |
---|---|
static Elements |
Selector.select(String query,
Iterable<Element> roots)
Find elements matching selector.
|
Constructor and Description |
---|
Elements(Element... elements) |
Constructor and Description |
---|
Elements(Collection<Element> elements) |
Elements(List<Element> elements) |
Copyright © 2017. All rights reserved.