Package fitnesse.wikitext.parser

Source Code of fitnesse.wikitext.parser.HorizontalRule

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);
    }
   
    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();
    }
}
TOP

Related Classes of fitnesse.wikitext.parser.HorizontalRule

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.