Example #1
0
  public void startL(Attributes attrs) {
    // Refer to Gen 3:14 in ESV for example use of type=x-indent
    String type = attrs.getValue(OSISUtil.OSIS_ATTR_TYPE);
    int level = TagHandlerHelper.getAttribute(OSISUtil.OSIS_ATTR_LEVEL, attrs, 1);
    // make numIndents default to zero
    int numIndents = Math.max(0, level - 1);

    LType ltype = LType.IGNORE;
    if (StringUtils.isNotEmpty(type)) {
      if (type.contains("indent")) {
        // this tag is specifically for indenting so ensure there is an indent
        numIndents = numIndents + 1;
        writer.write(StringUtils.repeat(indent_html, numIndents));
        ltype = LType.INDENT;
      } else if (type.contains("br")) {
        writer.write(HTML.BR);
        ltype = LType.BR;
      } else {
        ltype = LType.IGNORE;
        log.debug("Unknown <l> tag type:" + type);
      }
    } else if (TagHandlerHelper.isAttr(OSISUtil.OSIS_ATTR_SID, attrs)) {
      writer.write(StringUtils.repeat(indent_html, numIndents));
      ltype = LType.IGNORE;
    } else if (TagHandlerHelper.isAttr(OSISUtil.OSIS_ATTR_EID, attrs)) {
      // e.g. Isaiah 40:12
      writer.write(HTML.BR);
      ltype = LType.BR;
    } else {
      // simple <l>
      writer.write(StringUtils.repeat(indent_html, numIndents));
      ltype = LType.END_BR;
    }
    stack.push(ltype);
  }
Example #2
0
  @Override
  public void start(Attributes attrs) {
    // Refer to Gen 3:14 in ESV for example use of type=x-indent
    String src = attrs.getValue(OSISUtil.ATTRIBUTE_FIGURE_SRC);

    if (StringUtils.isNotEmpty(src)) {
      writer.write("<img class='sword' src='" + parameters.getModuleBasePath() + "/" + src + "'/>");
    }
  }
Example #3
0
 public void endL() {
   LType type = stack.pop();
   if (LType.END_BR.equals(type)) {
     writer.write(HTML.BR);
   }
 }