Skip to content

Commit 6b3b6e0

Browse files
committed
Number paragraphs incrementally.
1 parent be488cc commit 6b3b6e0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

section.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,21 @@ limitations under the License.
6161
child = child.nextElementSibling) {
6262
if (child instanceof CxxSectionElement)
6363
return para_num;
64-
else if (child instanceof HTMLParagraphElement &&
65-
!child.classList.contains('cont'))
66-
this.numberParagraph(para_num++, child);
64+
else if (child instanceof HTMLParagraphElement && !child.classList.contains('cont'))
65+
para_num = this.numberParagraph(para_num, child);
6766
else if (child instanceof CxxFunctionElement) {
68-
this.numberParagraph(para_num++, child);
67+
para_num = this.numberParagraph(para_num, child);
6968
para_num = this.numberParagraphChildren(child, para_num);
7069
} else if (child instanceof CxxFunctionAttributeElement)
71-
this.numberParagraph(para_num++, child);
70+
para_num = this.numberParagraph(para_num, child);
7271
}
7372
return para_num;
7473
},
7574

7675
numberParagraph: function(number, element) {
7776
// If the paragraph is explicitly numbered, use that number.
7877
if (element.hasAttribute("number"))
79-
number = element.getAttribute("number")
78+
number = Number(element.getAttribute("number"))
8079

8180
var id = this.id + '.' + number;
8281
if (element.id) {
@@ -88,6 +87,7 @@ limitations under the License.
8887
element.id = id;
8988
}
9089
element.setAttribute('para_num', number);
90+
return number + 1
9191
}
9292
})
9393
})();

0 commit comments

Comments
 (0)