in src/main/java/com/atlassian/uwc/converters/sharepoint/CleanConverter.java [319:350]
protected boolean needsNL(List content) {
combineTextNodes(content);
if (content.isEmpty()) return false;
Object firstItem = content.get(0);
if (content.size() == 1) {
if (firstItem instanceof Text) return true; //just one text node
}
Object item = null;
int index;
for (index = 0; index < content.size(); index++) { //get the first Element node
item = content.get(index);
if (item instanceof Element) break;
}
if (item instanceof Element) { //assuming we found an Element node
Element el = (Element) item;
String name = el.getName();
for (int i = 0; i < TAG_HAS_NLS.length; i++) {
String tag = TAG_HAS_NLS[i];
String nextname = "";
for (int j = index+1; j < content.size(); j++) { //get the next Element node
Object next = content.get(j);
if (next instanceof Text) continue;
Element nextEl = (Element) next;
nextname = nextEl.getName();
}
//check to see if either this or the next node handles the break implicitly
if (tag.equals(name) || tag.equals(nextname)) return false;
}
return true; //we had Elements, but they were inline
}
return false; //we had no Elements, default is return false
}