
fitnesse.wikitext.parser.AnchorName 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;
import java.util.List;
public class AnchorName extends SymbolType implements Rule {
public AnchorName() {
super("AnchorName");
wikiMatcher(new Matcher().string("!anchor"));
wikiRule(this);
htmlTranslation(Translate.with(ToHtml::anchorName).child(0));
}
@Override
public Maybe parse(Symbol current, Parser parser) {
List tokens = parser.moveNext(new SymbolType[] {SymbolType.Whitespace, SymbolType.Text});
if (tokens.isEmpty()) return Symbol.nothing;
String anchor = tokens.get(1).getContent();
if (!ScanString.isWord(anchor)) return Symbol.nothing;
current.add(tokens.get(1));
return new Maybe<>(current);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy