Break after self-closing trkpt without ele (beeline)

This commit is contained in:
Norbert Renner 2021-06-12 11:11:08 +02:00
parent c3db03d1e3
commit da2043fb47

View file

@ -25,8 +25,12 @@ BR.Xml = {
} }
} else { } else {
if (singleLineTagList.includes(tag)) { if (singleLineTagList.includes(tag)) {
const closeIndex = xml.indexOf('>', match.index + 1);
const selfClosing = xml.charAt(closeIndex - 1) === '/';
if (!selfClosing) {
singleLineTag = tag; singleLineTag = tag;
} }
}
let endIndex = match.index + 1; let endIndex = match.index + 1;
lines.push(xml.substring(startIndex, endIndex)); lines.push(xml.substring(startIndex, endIndex));
startIndex = endIndex; startIndex = endIndex;