Beispiel #1
0
  private static void appendNormalisedText(StringBuilder accum, TextNode textNode) {
    String text = textNode.getWholeText();

    if (!preserveWhitespace(textNode.parent())) {
      text = TextNode.normaliseWhitespace(text);
      if (TextNode.lastCharIsWhitespace(accum)) text = TextNode.stripLeadingWhitespace(text);
    }
    accum.append(text);
  }
Beispiel #2
0
 private static void appendWhitespaceIfBr(Element element, StringBuilder accum) {
   if (element.tag.getName().equals("br") && !TextNode.lastCharIsWhitespace(accum))
     accum.append(" ");
 }