Package | Description |
---|---|
com.itextpdf.html2pdf.jsoup | |
com.itextpdf.html2pdf.jsoup.safety |
Modifier and Type | Method and Description |
---|---|
static String |
Jsoup.clean(String bodyHtml, String baseUri, Whitelist whitelist)
Get safe HTML from untrusted input HTML, by parsing input HTML and filtering it through a white-list of permitted tags and attributes.
|
static String |
Jsoup.clean(String bodyHtml, String baseUri, Whitelist whitelist, Document.OutputSettings outputSettings)
Get safe HTML from untrusted input HTML, by parsing input HTML and filtering it through a white-list of permitted tags and attributes.
|
static String |
Jsoup.clean(String bodyHtml, Whitelist whitelist)
Get safe HTML from untrusted input HTML, by parsing input HTML and filtering it through a white-list of permitted tags and attributes.
|
static boolean |
Jsoup.isValid(String bodyHtml, Whitelist whitelist)
Test if the input HTML has only tags and attributes allowed by the Whitelist.
|
Modifier and Type | Method and Description |
---|---|
Whitelist |
Whitelist.addAttributes(String tag, String... keys)
Add a list of allowed attributes to a tag.
|
Whitelist |
Whitelist.addEnforcedAttribute(String tag, String key, String value)
Add an enforced attribute to a tag.
|
Whitelist |
Whitelist.addProtocols(String tag, String key, String... protocols)
Add allowed URL protocols for an element's URL attribute.
|
Whitelist |
Whitelist.addTags(String... tags)
Add a list of allowed elements to a whitelist.
|
static Whitelist |
Whitelist.basic()
This whitelist allows a fuller range of text nodes: a, b, blockquote, br, cite, code, dd, dl, dt, em, i, li, ol, p, pre, q, small, span, strike, strong, sub, sup, u, ul , and appropriate attributes.
|
static Whitelist |
Whitelist.basicWithImages()
This whitelist allows the same text tags as basic() , and also allows img tags, with appropriate attributes, with src pointing to http or https .
|
static Whitelist |
Whitelist.none()
This whitelist allows only text nodes: all HTML will be stripped.
|
Whitelist |
Whitelist.preserveRelativeLinks(boolean preserve)
Configure this Whitelist to preserve relative links in an element's URL attribute, or convert them to absolute links.
|
static Whitelist |
Whitelist.relaxed()
This whitelist allows a full range of text and structural body HTML: a, b, blockquote, br, caption, cite, code, col, colgroup, dd, div, dl, dt, em, h1, h2, h3, h4, h5, h6, i, img, li, ol, p, pre, q, small, span, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, u, ul
|
Whitelist |
Whitelist.removeAttributes(String tag, String... keys)
Remove a list of allowed attributes from a tag.
|
Whitelist |
Whitelist.removeEnforcedAttribute(String tag, String key)
Remove a previously configured enforced attribute from a tag.
|
Whitelist |
Whitelist.removeProtocols(String tag, String key, String... protocols)
Remove allowed URL protocols for an element's URL attribute.
|
Whitelist |
Whitelist.removeTags(String... tags)
Remove a list of allowed elements from a whitelist.
|
static Whitelist |
Whitelist.simpleText()
This whitelist allows only simple text formatting: b, em, i, strong, u .
|
Constructor and Description |
---|
Cleaner(Whitelist whitelist)
Create a new cleaner, that sanitizes documents using the supplied whitelist.
|
Copyright © 1998–2019 iText Group NV. All rights reserved.