@Test public void getHtml() { when(context.getParameters()).thenReturn("3"); when(context.getBody()).thenReturn("body"); assertEquals("<div class=\"span3\">body</div>", runnable.getHtml(context)); }
@Override public String getHtml(IMacroContext macroContext) { String params = macroContext.getParameters(); String width = StringUtils.substringBefore(params, " ").trim(); boolean border = StringUtils.indexOf(params, " border") >= 0; return "<div class=\"span" + StringEscapeUtils.escapeHtml4(width) + "\">" + (border ? "<div class=\"span12 panel-border\">" : StringUtils.EMPTY) + macroContext.getBody() + (border ? "</div>" : StringUtils.EMPTY) + "</div>"; }
PanelMacro implements IMacroRunnable { @Override public String getHtml(IMacroContext macroContext) { String params = macroContext.getParameters(); String width = StringUtils.substringBefore(params, " ").trim(); boolean border = StringUtils.indexOf(params, " border") >= 0; return "<div class=\"span" + StringEscapeUtils.escapeHtml4(width) + "\">" + (border ? "<div class=\"span12 panel-border\">" : StringUtils.EMPTY) + macroContext.getBody() + (border ? "</div>" : StringUtils.EMPTY) + "</div>"; } }
PanelMacro implements IMacroRunnable { @Override public String getHtml(IMacroContext macroContext) { String params = macroContext.getParameters(); String width = StringUtils.substringBefore(params, " ").trim(); boolean border = StringUtils.indexOf(params, " border") >= 0; return "<div class=\"span" + StringEscapeUtils.escapeHtml4(width) + "\">" + (border ? "<div class=\"span12 panel-border\">" : StringUtils.EMPTY) + macroContext.getBody() + (border ? "</div>" : StringUtils.EMPTY) + "</div>"; }  }
PanelMacro implements IMacroRunnable { @Override public String getHtml(IMacroContext macroContext) { String params = macroContext.getParameters(); String width = StringUtils.substringBefore(params, " ").trim(); boolean border = StringUtils.indexOf(params, " border") >= 0; return "<div class=\"span" + StringEscapeUtils.escapeHtml4(width) + "\">" + (border ? "<div class=\"span12 panel-border\">" : StringUtils.EMPTY) + macroContext.getBody() + (border ? "</div>" : StringUtils.EMPTY) + "</div>"; }  @Override String getHtml(IMacroContext macroContext); @Override String cleanupHtml(String html); }
PanelMacro implements IMacroRunnable { @Override public String getHtml(IMacroContext macroContext) { String params = macroContext.getParameters(); String width = StringUtils.substringBefore(params, " ").trim(); boolean border = StringUtils.indexOf(params, " border") >= 0; return "<div class=\"span" + StringEscapeUtils.escapeHtml4(width) + "\">" + (border ? "<div class=\"span12 panel-border\">" : StringUtils.EMPTY) + macroContext.getBody() + (border ? "</div>" : StringUtils.EMPTY) + "</div>"; }  @Override String getHtml(IMacroContext macroContext); @Override String cleanupHtml(String html);  }