fitnesse.wikitext.parser.Preformat 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.wikitext.shared.ToHtml;
public class Preformat extends SymbolType implements Rule {
public static final Preformat symbolType = new Preformat();
public Preformat() {
super("Preformat");
wikiMatcher(new Matcher().string("{{{"));
wikiRule(this);
htmlTranslation(Translate.with(ToHtml::pair).text("pre").child(0));
}
@Override
public Maybe parse(Symbol current, Parser parser) {
Symbol content = parser.parseToWithSymbols(SymbolType.ClosePreformat, SymbolProvider.preformatProvider, 0);
if (parser.atEnd()) return Symbol.nothing;
return new Maybe<>(current.add(content));
}
}