private boolean renderLineBreak(String breakText, final String suppressInTag, final Node node, NodeRendererContext context, HtmlWriter html) { if (myLines != null && myNextLine < myLines.size()) { // here we may need to close tags opened since the span tag List<String> openTags = html.getOpenTagsAfterLast("span"); int iMax = openTags.size(); final boolean outputBreakText = iMax == 0 || suppressInTag == null || !suppressInTag.equalsIgnoreCase(openTags.get(iMax - 1)); if (!outputBreakText && !html.isPendingSpace()) { // we add a space for EOL html.raw(" "); } for (int i = iMax; i-- > 0; ) { html.closeTag(openTags.get(i)); } html.tag("/span"); if (outputBreakText) { html.raw(breakText); } outputNextLineBreakSpan(node, html, outputBreakText); for (String tag : openTags) { if (!outputBreakText && context.getHtmlOptions().inlineCodeSpliceClass != null && !context.getHtmlOptions().inlineCodeSpliceClass.isEmpty()) { html.attr(Attribute.CLASS_ATTR, context.getHtmlOptions().inlineCodeSpliceClass).withAttr().tag(tag); } else { html.tag(tag); } } return true; } return false; }
private boolean renderLineBreak(String breakText, final String suppressInTag, final Node node, NodeRendererContext context, HtmlWriter html) { if (myLines != null && myNextLine < myLines.size()) { // here we may need to close tags opened since the span tag List<String> openTags = html.getOpenTagsAfterLast("span"); int iMax = openTags.size(); final boolean outputBreakText = iMax == 0 || suppressInTag == null || !suppressInTag.equalsIgnoreCase(openTags.get(iMax - 1)); if (!outputBreakText && !html.isPendingSpace()) { // we add a space for EOL html.raw(" "); } for (int i = iMax; i-- > 0; ) { html.closeTag(openTags.get(i)); } html.tag("/span"); if (outputBreakText) { html.raw(breakText); } outputNextLineBreakSpan(node, html, outputBreakText); for (String tag : openTags) { if (!outputBreakText && context.getHtmlOptions().inlineCodeSpliceClass != null && !context.getHtmlOptions().inlineCodeSpliceClass.isEmpty()) { html.attr(Attribute.CLASS_ATTR, context.getHtmlOptions().inlineCodeSpliceClass).withAttr().tag(tag); } else { html.tag(tag); } } return true; } return false; }