@peaceroad/markdown-it-footnote-here 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +8 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -203,11 +203,12 @@ const footnote_plugin = (md, option) =>{
203
203
  }
204
204
 
205
205
  let tokenStart = 0
206
+ let openToken = null
206
207
  if (!isDuplicate) {
207
- const token = new state.Token('footnote_open', '', 1)
208
- token.meta = { id, isEndnote }
209
- token.level = state.level++
210
- state.tokens.push(token)
208
+ openToken = new state.Token('footnote_open', '', 1)
209
+ openToken.meta = { id, isEndnote }
210
+ openToken.level = state.level++
211
+ state.tokens.push(openToken)
211
212
  fn.positions.push(state.tokens.length - 1)
212
213
  } else {
213
214
  tokenStart = state.tokens.length
@@ -249,6 +250,9 @@ const footnote_plugin = (md, option) =>{
249
250
  }
250
251
 
251
252
  state.md.block.tokenize(state, startLine, endLine, true)
253
+ if (openToken) {
254
+ openToken.map = [startLine, state.line]
255
+ }
252
256
 
253
257
  state.parentType = oldParentType
254
258
  state.blkIndent -= 4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peaceroad/markdown-it-footnote-here",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "A markdown-it plugin. This generate aside[role|doc-footnote] element just below the footnote reference paragraph.",
5
5
  "main": "index.js",
6
6
  "type":"module",