@@ -50,7 +50,7 @@ function enterMathFlowMeta() {
50
50
}
51
51
52
52
function exitMathFlowMeta ( ) {
53
- var data = this . resume ( )
53
+ const data = this . resume ( )
54
54
this . stack [ this . stack . length - 1 ] . meta = data
55
55
}
56
56
@@ -62,8 +62,8 @@ function exitMathFlowFence() {
62
62
}
63
63
64
64
function exitMathFlow ( token ) {
65
- var data = this . resume ( ) . replace ( / ^ ( \r ? \n | \r ) | ( \r ? \n | \r ) $ / g, '' )
66
- var node = this . exit ( token )
65
+ const data = this . resume ( ) . replace ( / ^ ( \r ? \n | \r ) | ( \r ? \n | \r ) $ / g, '' )
66
+ const node = this . exit ( token )
67
67
node . value = data
68
68
node . data . hChildren [ 0 ] . value = data
69
69
this . setData ( 'mathFlowInside' )
@@ -86,8 +86,8 @@ function enterMathText(token) {
86
86
}
87
87
88
88
function exitMathText ( token ) {
89
- var data = this . resume ( )
90
- var node = this . exit ( token )
89
+ const data = this . resume ( )
90
+ const node = this . exit ( token )
91
91
node . value = data
92
92
node . data . hChildren [ 0 ] . value = data
93
93
}
@@ -98,11 +98,11 @@ function exitMathData(token) {
98
98
}
99
99
100
100
function math ( node , _ , context ) {
101
- var raw = node . value || ''
102
- var fence = '$' . repeat ( Math . max ( longestStreak ( raw , '$' ) + 1 , 2 ) )
103
- var exit = context . enter ( 'mathFlow' )
104
- var value = fence
105
- var subexit
101
+ const raw = node . value || ''
102
+ const fence = '$' . repeat ( Math . max ( longestStreak ( raw , '$' ) + 1 , 2 ) )
103
+ const exit = context . enter ( 'mathFlow' )
104
+ let value = fence
105
+ let subexit
106
106
107
107
if ( node . meta ) {
108
108
subexit = context . enter ( 'mathFlowMeta' )
@@ -122,10 +122,9 @@ function math(node, _, context) {
122
122
}
123
123
124
124
function inlineMath ( node ) {
125
- var value = node . value || ''
126
- var size = 1
127
- var pad = ''
128
- var sequence
125
+ const value = node . value || ''
126
+ let size = 1
127
+ let pad = ''
129
128
130
129
// If there is a single dollar sign on its own in the math, use a fence of
131
130
// two.
@@ -144,7 +143,7 @@ function inlineMath(node) {
144
143
pad = ' '
145
144
}
146
145
147
- sequence = '$' . repeat ( size )
146
+ const sequence = '$' . repeat ( size )
148
147
return sequence + pad + value + pad + sequence
149
148
}
150
149
0 commit comments