Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fitnesse.wikitext.widgets;
- import java.util.regex.*;
- public class BoldWidget extends ParentWidget {
- public static final String REGEXP = "'''.+?'''";
- private static final Pattern pattern = Pattern.compile("'''(.+?)'''",
- Pattern.MULTILINE + Pattern.DOTALL
- );
- public BoldWidget(ParentWidget parent, String text) throws Exception {
- super(parent);
- Matcher match = pattern.matcher(text);
- match.find();
- addChildWidgets(match.group(1));
- }
- public String render() throws Exception {
- StringBuffer html = new StringBuffer("<b>");
- html.append(childHtml()).append("</b>");
- return html.toString();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement