@Test public void getHtml() { when(context.getParameters()).thenReturn("info label text"); assertEquals("<span class=\"label label-info\">label text</span>", runnable.getHtml(context)); }
@Override public String getHtml(IMacroContext macroContext) { String params = macroContext.getParameters(); String type = StringUtils.substringBefore(params, " ").trim(); String text = StringUtils.substringAfter(params, " ").trim(); return "<span class=\"label label-" + StringEscapeUtils.escapeHtml4(type) + "\">" + StringEscapeUtils.escapeHtml4(text) + "</span>"; }
LabelMacro implements IMacroRunnable { @Override public String getHtml(IMacroContext macroContext) { String params = macroContext.getParameters(); String type = StringUtils.substringBefore(params, " ").trim(); String text = StringUtils.substringAfter(params, " ").trim(); return "<span class=\"label label-" + StringEscapeUtils.escapeHtml4(type) + "\">" + StringEscapeUtils.escapeHtml4(text) + "</span>"; } }
LabelMacro implements IMacroRunnable { @Override public String getHtml(IMacroContext macroContext) { String params = macroContext.getParameters(); String type = StringUtils.substringBefore(params, " ").trim(); String text = StringUtils.substringAfter(params, " ").trim(); return "<span class=\"label label-" + StringEscapeUtils.escapeHtml4(type) + "\">" + StringEscapeUtils.escapeHtml4(text) + "</span>"; }  }
LabelMacro implements IMacroRunnable { @Override public String getHtml(IMacroContext macroContext) { String params = macroContext.getParameters(); String type = StringUtils.substringBefore(params, " ").trim(); String text = StringUtils.substringAfter(params, " ").trim(); return "<span class=\"label label-" + StringEscapeUtils.escapeHtml4(type) + "\">" + StringEscapeUtils.escapeHtml4(text) + "</span>"; }  @Override String getHtml(IMacroContext macroContext); @Override String cleanupHtml(String html); }
LabelMacro implements IMacroRunnable { @Override public String getHtml(IMacroContext macroContext) { String params = macroContext.getParameters(); String type = StringUtils.substringBefore(params, " ").trim(); String text = StringUtils.substringAfter(params, " ").trim(); return "<span class=\"label label-" + StringEscapeUtils.escapeHtml4(type) + "\">" + StringEscapeUtils.escapeHtml4(text) + "</span>"; }  @Override String getHtml(IMacroContext macroContext); @Override String cleanupHtml(String html);  }