Skip to content

Instantly share code, notes, and snippets.

@Ralireza
Created April 17, 2020 02:06
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/e53ac900f8fbba03e4902b62b082b340 to your computer and use it in GitHub Desktop.
Save Ralireza/e53ac900f8fbba03e4902b62b082b340 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