We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6fc0102 commit a79ac77Copy full SHA for a79ac77
index.js
@@ -7,7 +7,9 @@ module.exports = shiftHeading
7
var floor = Math.floor
8
var min = 1
9
var max = 6
10
-var offset = 48 // '0'.charCodeAt(0)
+
11
+// Character codes.
12
+var digit0 = 48
13
14
function shiftHeading(tree, shift) {
15
if (
@@ -35,7 +37,7 @@ function shiftHeading(tree, shift) {
35
37
name === 'h5' ||
36
38
name === 'h6'
39
) {
- rank = name.charCodeAt(1) - offset + shift
40
+ rank = name.charCodeAt(1) - digit0 + shift
41
node.tagName = 'h' + (rank > max ? max : rank < min ? min : rank)
42
}
43
0 commit comments