@@ -50,7 +50,7 @@ function enterMathFlowMeta() {
5050}
5151
5252function exitMathFlowMeta ( ) {
53- var data = this . resume ( )
53+ const data = this . resume ( )
5454 this . stack [ this . stack . length - 1 ] . meta = data
5555}
5656
@@ -62,8 +62,8 @@ function exitMathFlowFence() {
6262}
6363
6464function 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 )
6767 node . value = data
6868 node . data . hChildren [ 0 ] . value = data
6969 this . setData ( 'mathFlowInside' )
@@ -86,8 +86,8 @@ function enterMathText(token) {
8686}
8787
8888function exitMathText ( token ) {
89- var data = this . resume ( )
90- var node = this . exit ( token )
89+ const data = this . resume ( )
90+ const node = this . exit ( token )
9191 node . value = data
9292 node . data . hChildren [ 0 ] . value = data
9393}
@@ -98,11 +98,11 @@ function exitMathData(token) {
9898}
9999
100100function 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
106106
107107 if ( node . meta ) {
108108 subexit = context . enter ( 'mathFlowMeta' )
@@ -122,10 +122,9 @@ function math(node, _, context) {
122122}
123123
124124function 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 = ''
129128
130129 // If there is a single dollar sign on its own in the math, use a fence of
131130 // two.
@@ -144,7 +143,7 @@ function inlineMath(node) {
144143 pad = ' '
145144 }
146145
147- sequence = '$' . repeat ( size )
146+ const sequence = '$' . repeat ( size )
148147 return sequence + pad + value + pad + sequence
149148}
150149
0 commit comments