All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fitnesse.wikitext.parser.HorizontalRule Maven / Gradle / Ivy

There is a newer version: 20241026
Show newest version
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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy