*
* @param options Specified options to use on this instance. See the docs for the Options class for common options sets.
*/
public Remark(Options options) {
this.options = options.getCopy();
Whitelist whitelist = Whitelist.basicWithImages()
.addTags("div",
"h1", "h2", "h3", "h4", "h5", "h6",
"table", "tbody", "td", "tfoot", "th", "thead", "tr",
"hr",
"span", "font")
.addAttributes("th", "colspan", "align", "style")
.addAttributes("td", "colspan", "align", "style")
.addAttributes(":all", "title", "style");
if(options.preserveRelativeLinks) {
whitelist.preserveRelativeLinks(true);
}
if(options.abbreviations) {
whitelist.addTags("abbr", "acronym");
}
if(options.headerIds) {
for(int i=1; i<=6; i++) {
whitelist.addAttributes("h"+i, "id");
}
}
for(final IgnoredHtmlElement el : options.getIgnoredHtmlElements()) {
whitelist.addTags(el.getTagName());
if(!el.getAttributes().isEmpty()) {
whitelist.addAttributes(el.getTagName(), el.getAttributes().toArray(new String[el.getAttributes().size()]));
}
}
cleaner = new Cleaner(whitelist);
if(options.getTables().isLeftAsHtml()) {