fitnesse.wikitext.parser.HorizontalRule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fitnesse Show documentation
Show all versions of fitnesse Show documentation
The fully integrated standalone wiki, and acceptance testing framework.
package fitnesse.wikitext.parser;
import fitnesse.html.HtmlTag;
public class HorizontalRule extends SymbolType implements Translation {
public static final HorizontalRule symbolType = new HorizontalRule();
public HorizontalRule() {
super("HorizontalRule");
wikiMatcher(new Matcher().string("---").repeat('-'));
htmlTranslation(this);
}
@Override
public String toTarget(Translator translator, Symbol symbol) {
HtmlTag html = new HtmlTag("hr");
int size = symbol.getContent().length() - 3;
if (size > 1) html.addAttribute("size", Integer.toString(size));
return html.html();
}
}