ExportHelper: Simplify _analyzeLine() a bit

This commit is contained in:
Richard Hansen 2021-09-30 23:54:10 -04:00
parent d8cbd134d3
commit a7c78768a1

View file

@ -53,7 +53,8 @@ exports._analyzeLine = (text, aline, apool) => {
if (aline) {
const opIter = Changeset.opIterator(aline);
if (opIter.hasNext()) {
let listType = Changeset.opAttributeValue(opIter.next(), 'list', apool);
const op = opIter.next();
let listType = Changeset.opAttributeValue(op, 'list', apool);
if (listType) {
lineMarker = 1;
listType = /([a-z]+)([0-9]+)/.exec(listType);
@ -62,10 +63,7 @@ exports._analyzeLine = (text, aline, apool) => {
line.listLevel = Number(listType[2]);
}
}
}
const opIter2 = Changeset.opIterator(aline);
if (opIter2.hasNext()) {
const start = Changeset.opAttributeValue(opIter2.next(), 'start', apool);
const start = Changeset.opAttributeValue(op, 'start', apool);
if (start) {
line.start = start;
}