Skip to content

Instantly share code, notes, and snippets.

@Ralireza
Last active April 17, 2020 02:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ralireza/a7fdf4954654ea02aa26a91cdcee85c2 to your computer and use it in GitHub Desktop.
Save Ralireza/a7fdf4954654ea02aa26a91cdcee85c2 to your computer and use it in GitHub Desktop.
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();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment