info.bliki.html.wikipedia.OpenCloseTag Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bliki-core Show documentation
Show all versions of bliki-core Show documentation
This is the core project.
The newest version!
package info.bliki.html.wikipedia;
import info.bliki.htmlcleaner.TagNode;
import java.util.List;
public class OpenCloseTag extends AbstractHTMLTag {
protected String openStr;
protected String closeStr;
protected final boolean formatContent;
/**
*
* @param opener
* opening string for this tag
* @param closer
* closing string for this tag
* @param convertPlainText
* create plain text output without wiki tags
* @param formatContent
* format the intermediate resulting wiki content by reducing
* multiple spaces to only one space ' ' character
*/
public OpenCloseTag(String opener, String closer, boolean convertPlainText, boolean formatContent) {
super(convertPlainText);
this.openStr = opener;
this.closeStr = closer;
this.formatContent = formatContent;
}
public OpenCloseTag(String opener, String closer, boolean convertPlainText) {
this(opener, closer, convertPlainText, false);
}
public OpenCloseTag(String opener, String closer) {
this(opener, closer, false, false);
}
@Override
public void open(TagNode node, StringBuilder resultBuffer) {
resultBuffer.append(openStr);
}
@Override
public void content(AbstractHTMLToWiki w, TagNode node, StringBuilder resultBuffer, boolean showWithoutTag) {
List