@mdit/plugin-footnote
Advanced tools
+1
-1
@@ -5,3 +5,3 @@ import { PluginSimple } from 'markdown-it'; | ||
| /** | ||
| * Forked from https://github.com/markdown-it/markdown-it-footnote/blob/master/index.js | ||
| * Forked from https://github.com/markdown-it/markdown-it-footnote/blob/master/index.mjs | ||
| */ | ||
@@ -8,0 +8,0 @@ |
+5
-5
@@ -1,9 +0,9 @@ | ||
| import $ from"markdown-it/lib/helpers/parse_link_label.mjs";import i from"markdown-it/lib/token.mjs";const h=(e,n)=>e[n].meta.subId>0?`:${e[n].meta.subId}`:"",A=(e,n,t,s)=>`${typeof s.docId=="string"?`-${s.docId}-`:""}${(e[n].meta.id+1).toString()}`,C=(e,n)=>`[${(e[n].meta.id+1).toString()}${h(e,n)}]`,g=(e,n,t,s,o)=>{const c=o.rules.footnoteAnchorName(e,n,t,s,o),f=o.rules.footnoteCaption(e,n,t,s,o);return`<sup class="footnote-ref"><a href="#footnote${c}">${f}</a><a class="footnote-anchor" id="footnote-ref${c}${h(e,n)}" /></sup>`},I=(e,n,t)=>`<hr class="footnotes-sep"${t.xhtmlOut?" /":""}> | ||
| const b=(e,t)=>e[t].meta.subId>0?`:${e[t].meta.subId}`:"",$=(e,t,l,c)=>`${typeof c.docId=="string"?`-${c.docId}-`:""}${(e[t].meta.id+1).toString()}`,v=(e,t)=>`[${(e[t].meta.id+1).toString()}${b(e,t)}]`,g=(e,t,l,c,n)=>{const s=n.rules.footnote_anchorName(e,t,l,c,n),r=n.rules.footnote_caption(e,t,l,c,n);return`<sup class="footnote-ref"><a href="#footnote${s}">${r}</a><a class="footnote-anchor" id="footnote-ref${s}${b(e,t)}" /></sup>`},A=(e,t,l)=>`<hr class="footnotes-sep"${l.xhtmlOut?" /":""}> | ||
| <section class="footnotes"> | ||
| <ol class="footnotes-list"> | ||
| `,w=()=>`</ol> | ||
| `,I=()=>`</ol> | ||
| </section> | ||
| `,M=(e,n,t,s,o)=>`<li id="footnote${o.rules.footnoteAnchorName(e,n,t,s,o)}${h(e,n)}" class="footnote-item">`,y=()=>`</li> | ||
| `,R=(e,n,t,s,o)=>` <a href="#footnote-ref${o.rules.footnoteAnchorName(e,n,t,s,o)}${h(e,n)}" class="footnote-backref">↩︎</a>`,S=(e,n,t,s)=>{let o,c,f,a;const r=e.bMarks[n]+e.tShift[n],l=e.eMarks[n];if(r+4>l||e.src.charAt(r)!=="["||e.src.charAt(r+1)!=="^")return!1;for(o=r+2;o<l;o++){if(e.src.charAt(o)===" ")return!1;if(e.src.charAt(o)==="]")break}if(o===r+2||o+1>=l||e.src.charAt(++o)!==":")return!1;if(s)return!0;o+=1,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={});const p=e.src.slice(r+2,o-2);e.env.footnotes.refs[`:${p}`]=-1,c=new i("footnoteReferenceOpen","",1),c.meta={label:p},c.level=e.level++,e.tokens.push(c);const u=e.bMarks[n],b=e.tShift[n],d=e.sCount[n],v=e.parentType,k=o,m=e.sCount[n]+o-(e.bMarks[n]+e.tShift[n]);for(f=e.sCount[n]+o-(e.bMarks[n]+e.tShift[n]);o<l;){if(a=e.src.charAt(o),a===" ")f+=4-f%4;else if(a===" ")f+=1;else break;o+=1}return e.tShift[n]=o-k,e.sCount[n]=f-m,e.bMarks[n]=k,e.blkIndent+=4,e.parentType="footnote",e.sCount[n]<e.blkIndent&&(e.sCount[n]+=e.blkIndent),e.md.block.tokenize(e,n,t),e.parentType=v,e.blkIndent-=4,e.tShift[n]=b,e.sCount[n]=d,e.bMarks[n]=u,c=new i("footnoteReferenceClose","",-1),c.level=--e.level,e.tokens.push(c),!0},O=(e,n)=>{let t,s,o;const c=e.posMax,f=e.pos;if(f+2>=c||e.src.charAt(f)!=="^"||e.src.charAt(f+1)!=="[")return!1;const a=f+2,r=$(e,f+1);return r<0?!1:(n||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),t=e.env.footnotes.list.length,e.md.inline.parse(e.src.slice(a,r),e.md,e.env,o=[]),s=e.push("footnoteRef","",0),s.meta={id:t},e.env.footnotes.list[t]={content:e.src.slice(a,r),tokens:o}),e.pos=r+1,e.posMax=c,!0)},x=(e,n)=>{let t,s,o,c;const f=e.posMax,a=e.pos;if(a+3>f||!e.env.footnotes||!e.env.footnotes.refs||e.src.charAt(a)!=="["||e.src.charAt(a+1)!=="^")return!1;for(t=a+2;t<f;t++){if(e.src.charAt(t)===" "||e.src.charAt(t)===` | ||
| `)return!1;if(e.src.charAt(t)==="]")break}if(t===a+2||t>=f)return!1;t+=1;const r=e.src.slice(a+2,t-1);return typeof e.env.footnotes.refs[`:${r}`]>"u"?!1:(n||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[`:${r}`]<0?(s=e.env.footnotes.list.length,e.env.footnotes.list[s]={label:r,count:0},e.env.footnotes.refs[`:${r}`]=s):s=e.env.footnotes.refs[`:${r}`],o=e.env.footnotes.list[s].count,e.env.footnotes.list[s].count=e.env.footnotes.list[s].count+1,c=e.push("footnoteRef","",0),c.meta={id:s,subId:o,label:r}),e.pos=t,e.posMax=f,!0)},N=e=>{let n,t,s,o,c,f=!1;const a={};if(!e.env.footnotes||(e.tokens=e.tokens.filter(l=>l.type==="footnoteReferenceOpen"?(f=!0,o=[],c=l.meta.label,!1):l.type==="footnoteReferenceClose"?(f=!1,a[`:${c}`]=o,!1):(f&&o.push(l),!f)),!e.env.footnotes.list))return!1;const{list:r}=e.env.footnotes;t=new i("footnoteBlockOpen","",1),e.tokens.push(t);for(let l=0,{length:p}=r;l<p;l++){t=new i("footnoteOpen","",1),t.meta={id:l,label:r[l].label},e.tokens.push(t),r[l].tokens?(s=[],t=new i("paragraph_open","p",1),t.block=!0,s.push(t),t=new i("inline","",0),t.children=r[l].tokens,t.content=r[l].content,s.push(t),t=new i("paragraph_close","p",-1),t.block=!0,s.push(t)):r[l].label?s=a[`:${r[l].label}`]:s=[],s&&(e.tokens=e.tokens.concat(s)),e.tokens[e.tokens.length-1].type==="paragraph_close"?n=e.tokens.pop()||null:n=null;for(let u=0;u<(Number(r[l].count)>0?r[l].count:1);u++)t=new i("footnoteAnchor","",0),t.meta={id:l,subId:u,label:r[l].label},e.tokens.push(t);n&&e.tokens.push(n),t=new i("footnoteClose","",-1),e.tokens.push(t)}return t=new i("footnoteBlockClose","",-1),e.tokens.push(t),!0},T=e=>{e.renderer.rules.footnoteRef=g,e.renderer.rules.footnoteBlockOpen=I,e.renderer.rules.footnoteBlockClose=w,e.renderer.rules.footnoteOpen=M,e.renderer.rules.footnoteClose=y,e.renderer.rules.footnoteAnchor=R,e.renderer.rules.footnoteCaption=C,e.renderer.rules.footnoteAnchorName=A,e.block.ruler.before("reference","footnoteDef",S,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnoteInline",O),e.inline.ruler.after("footnoteInline","footnoteRef",x),e.core.ruler.after("inline","footnoteTail",N)};export{T as footnote}; | ||
| `,T=(e,t,l,c,n)=>`<li id="footnote${n.rules.footnote_anchorName(e,t,l,c,n)}${b(e,t)}" class="footnote-item">`,M=()=>`</li> | ||
| `,w=(e,t,l,c,n)=>` <a href="#footnote-ref${n.rules.footnote_anchorName(e,t,l,c,n)}${b(e,t)}" class="footnote-backref">↩︎</a>`,y=(e,t,l,c)=>{const n=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(n+4>s||e.src.charAt(n)!=="["||e.src.charAt(n+1)!=="^")return!1;let r=n+2;for(;r<s;){if(e.src.charAt(r)===" ")return!1;if(e.src.charAt(r)==="]")break;r++}if(r===n+2||r+1>=s||e.src.charAt(++r)!==":")return!1;if(c)return!0;r++,(e.env.footnotes??={}).refs??={};const o=e.src.slice(n+2,r-2);e.env.footnotes.refs[`:${o}`]=-1;const f=e.push("footnote_reference_open","",1);f.meta={label:o},f.level=e.level++;const p=e.bMarks[t],i=e.tShift[t],a=e.sCount[t],u=e.parentType,h=r,d=e.sCount[t]+r-(e.bMarks[t]+e.tShift[t]);let k=e.sCount[t]+r-(e.bMarks[t]+e.tShift[t]);for(;r<s;){const _=e.src.charAt(r);if(_===" ")k+=4-k%4;else if(_===" ")k++;else break;r++}e.tShift[t]=r-h,e.sCount[t]=k-d,e.bMarks[t]=h,e.blkIndent+=4,e.parentType="footnote",e.sCount[t]<e.blkIndent&&(e.sCount[t]+=e.blkIndent),e.md.block.tokenize(e,t,l),e.parentType=u,e.blkIndent-=4,e.tShift[t]=i,e.sCount[t]=a,e.bMarks[t]=p;const m=e.push("footnote_reference_close","",-1);return m.level=--e.level,!0},S=(e,t)=>{const l=e.posMax,c=e.pos;if(c+2>=l||e.src.charAt(c)!=="^"||e.src.charAt(c+1)!=="[")return!1;const n=e.md.helpers.parseLinkLabel(e,c+1);if(n<0)return!1;const s=c+2;if(!t){const r=((e.env.footnotes??={}).list??=[]).length,o=[];e.md.inline.parse(e.src.slice(s,n),e.md,e.env,o);const f=e.push("footnote_ref","",0);f.meta={id:r},e.env.footnotes.list[r]={content:e.src.slice(s,n),tokens:o}}return e.pos=n+1,e.posMax=l,!0},C=(e,t)=>{const l=e.pos,c=e.posMax;if(l+3>c||!e.env.footnotes?.refs||e.src.charAt(l)!=="["||e.src.charAt(l+1)!=="^")return!1;let n=l+2;for(;n<c;){if(e.src.charAt(n)===" "||e.src.charAt(n)===` | ||
| `)return!1;if(e.src.charAt(n)==="]")break;n++}if(n===l+2||n>=c)return!1;n++;const s=e.src.slice(l+2,n-1);if(typeof e.env.footnotes.refs[`:${s}`]>"u")return!1;if(!t){const r=e.env.footnotes.list??=[],{refs:o}=e.env.footnotes;let f;o[`:${s}`]<0?(f=r.length,r[f]={label:s,count:0},o[`:${s}`]=f):f=o[`:${s}`];const p=r[f].count;r[f].count=r[f].count+1;const i=e.push("footnote_ref","",0);i.meta={id:f,subId:p,label:s}}return e.pos=n,e.posMax=c,!0},x=e=>{const t={};let l,c,n=!1;if(!e.env.footnotes?.list)return!1;const{list:s}=e.env.footnotes;e.tokens=e.tokens.filter(o=>o.type==="footnote_reference_open"?(n=!0,l=[],c=o.meta.label,!1):o.type==="footnote_reference_close"?(n=!1,t[`:${c}`]=l,!1):(n&&l.push(o),!n));const r=new e.Token("footnote_block_open","",1);e.tokens.push(r);for(let o=0,{length:f}=s;o<f;o++){const p=new e.Token("footnote_open","",1);p.meta={id:o,label:s[o].label},e.tokens.push(p);let i;if(s[o].tokens){const a=new e.Token("paragraph_open","p",1);a.block=!0;const u=new e.Token("inline","",0);u.children=s[o].tokens,u.content=s[o].content;const h=new e.Token("paragraph_close","p",-1);h.block=!0,e.tokens.push(a,u,h)}else if(s[o].label){const a=t[`:${s[o].label}`];a&&e.tokens.push(...a)}e.tokens[e.tokens.length-1].type==="paragraph_close"?i=e.tokens.pop()??null:i=null;for(let a=0;a<(Number(s[o].count)>0?s[o].count:1);a++){const u=new e.Token("footnote_anchor","",0);u.meta={id:o,subId:a,label:s[o].label},e.tokens.push(u)}i&&e.tokens.push(i),e.tokens.push(new e.Token("footnote_close","",-1))}return e.tokens.push(new e.Token("footnote_block_close","",-1)),!0},N=e=>{e.renderer.rules.footnote_ref=g,e.renderer.rules.footnote_block_open=A,e.renderer.rules.footnote_block_close=I,e.renderer.rules.footnote_open=T,e.renderer.rules.footnote_close=M,e.renderer.rules.footnote_anchor=w,e.renderer.rules.footnote_caption=v,e.renderer.rules.footnote_anchorName=$,e.block.ruler.before("reference","footnoteDef",y,{alt:["paragraph","reference"]}),e.inline.ruler.after("image","footnoteInline",S),e.inline.ruler.after("footnoteInline","footnote_ref",C),e.core.ruler.after("inline","footnoteTail",x)};export{N as footnote}; | ||
| //# sourceMappingURL=index.js.map |
+1
-1
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"index.js","sources":["../src/plugin.ts"],"sourcesContent":["/**\n * Forked from https://github.com/markdown-it/markdown-it-footnote/blob/master/index.js\n */\n\nimport type { PluginSimple } from \"markdown-it\";\nimport parseLinkLabel from \"markdown-it/lib/helpers/parse_link_label.mjs\";\nimport type { RuleBlock } from \"markdown-it/lib/parser_block.mjs\";\nimport type { RuleInline } from \"markdown-it/lib/parser_inline.mjs\";\nimport type { RenderRule } from \"markdown-it/lib/renderer.mjs\";\nimport type { ParentType } from \"markdown-it/lib/rules_block/state_block.mjs\";\nimport type StateBlock from \"markdown-it/lib/rules_block/state_block.mjs\";\nimport type StateCore from \"markdown-it/lib/rules_core/state_core.mjs\";\nimport type StateInline from \"markdown-it/lib/rules_inline/state_inline.mjs\";\nimport Token from \"markdown-it/lib/token.mjs\";\n\nimport type { FootNoteEnv, FootNoteToken } from \"./types.js\";\n\ninterface FootNoteStateBlock extends StateBlock {\n tokens: FootNoteToken[];\n env: FootNoteEnv;\n}\n\ninterface FootNoteStateInline extends StateInline {\n tokens: FootNoteToken[];\n env: FootNoteEnv;\n}\n\ninterface FootNoteStateCore extends StateCore {\n tokens: FootNoteToken[];\n env: FootNoteEnv;\n}\n\nconst getIDSuffix = (tokens: FootNoteToken[], index: number): string =>\n // add suffix when multiple id was found\n tokens[index].meta.subId > 0 ? `:${tokens[index].meta.subId}` : \"\";\n\nconst renderFootnoteAnchorName: RenderRule = (\n tokens: FootNoteToken[],\n index,\n _options,\n env: FootNoteEnv,\n): string =>\n `${\n // prefix\n typeof env.docId === \"string\" ? `-${env.docId}-` : \"\"\n }${\n // increasing id\n (tokens[index].meta.id + 1).toString()\n }`;\n\nconst renderFootnoteCaption: RenderRule = (\n tokens: FootNoteToken[],\n index,\n): string =>\n `[${\n // number\n (tokens[index].meta.id + 1).toString()\n }${getIDSuffix(tokens, index)}]`;\n\nconst renderFootnoteRef: RenderRule = (\n tokens: FootNoteToken[],\n index,\n options,\n env: FootNoteEnv,\n self,\n): string => {\n const id = self.rules[\"footnoteAnchorName\"]!(\n tokens,\n index,\n options,\n env,\n self,\n );\n const caption = self.rules[\"footnoteCaption\"]!(\n tokens,\n index,\n options,\n env,\n self,\n );\n\n return `<sup class=\"footnote-ref\"><a href=\"#footnote${id}\">${caption}</a><a class=\"footnote-anchor\" id=\"footnote-ref${id}${getIDSuffix(\n tokens,\n index,\n )}\" /></sup>`;\n};\n\nconst renderFootnoteBlockOpen: RenderRule = (\n _tokens: FootNoteToken[],\n _index,\n options,\n): string =>\n `\\\n<hr class=\"footnotes-sep\"${options.xhtmlOut ? \" /\" : \"\"}>\n<section class=\"footnotes\">\n<ol class=\"footnotes-list\">\n`;\n\nconst renderFootnoteBlockClose = (): string => `\\\n</ol>\n</section>\n`;\n\nconst renderFootnoteOpen: RenderRule = (\n tokens: FootNoteToken[],\n index,\n options,\n env: FootNoteEnv,\n self,\n): string =>\n `<li id=\"footnote${self.rules[\"footnoteAnchorName\"]!(\n tokens,\n index,\n options,\n env,\n self,\n )}${getIDSuffix(tokens, index)}\" class=\"footnote-item\">`;\n\nconst renderFootnoteClose = (): string => \"</li>\\n\";\n\nconst renderFootnoteAnchor: RenderRule = (\n tokens: FootNoteToken[],\n index,\n options,\n env: FootNoteEnv,\n self,\n): string =>\n ` <a href=\"#footnote-ref${self.rules[\"footnoteAnchorName\"]!(\n tokens,\n index,\n options,\n env,\n self,\n )}${\n getIDSuffix(tokens, index)\n /* ↩ with escape code to prevent display as Apple Emoji on iOS */\n }\" class=\"footnote-backref\">\\u21a9\\uFE0E</a>`;\n\n// Process footnote block definition\nconst footnoteDef: RuleBlock = (\n state: FootNoteStateBlock,\n startLine,\n endLine,\n silent,\n) => {\n let pos;\n let token;\n let offset;\n let ch;\n const start = state.bMarks[startLine] + state.tShift[startLine];\n const max = state.eMarks[startLine];\n\n // line should be at least 5 chars - \"[^x]:\"\n if (start + 4 > max) return false;\n\n if (state.src.charAt(start) !== \"[\") return false;\n\n if (state.src.charAt(start + 1) !== \"^\") return false;\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charAt(pos) === \" \") return false;\n if (state.src.charAt(pos) === \"]\") break;\n }\n\n // no empty footnote labels\n if (pos === start + 2) return false;\n\n if (pos + 1 >= max || state.src.charAt(++pos) !== \":\") return false;\n\n if (silent) return true;\n pos += 1;\n\n if (!state.env.footnotes) state.env.footnotes = {};\n if (!state.env.footnotes.refs) state.env.footnotes.refs = {};\n const label = state.src.slice(start + 2, pos - 2);\n\n state.env.footnotes.refs[`:${label}`] = -1;\n\n token = new Token(\"footnoteReferenceOpen\", \"\", 1);\n token.meta = { label };\n token.level = state.level++;\n state.tokens.push(token);\n\n const oldBMark = state.bMarks[startLine];\n const oldTShift = state.tShift[startLine];\n const oldSCount = state.sCount[startLine];\n const oldParentType = state.parentType;\n const posAfterColon = pos;\n const initial =\n state.sCount[startLine] +\n pos -\n (state.bMarks[startLine] + state.tShift[startLine]);\n\n offset =\n state.sCount[startLine] +\n pos -\n (state.bMarks[startLine] + state.tShift[startLine]);\n\n while (pos < max) {\n ch = state.src.charAt(pos);\n\n if (ch === \"\\t\") offset += 4 - (offset % 4);\n else if (ch === \" \") offset += 1;\n else break;\n\n pos += 1;\n }\n\n state.tShift[startLine] = pos - posAfterColon;\n state.sCount[startLine] = offset - initial;\n\n state.bMarks[startLine] = posAfterColon;\n state.blkIndent += 4;\n state.parentType = \"footnote\" as unknown as ParentType;\n\n if (state.sCount[startLine] < state.blkIndent)\n state.sCount[startLine] += state.blkIndent;\n\n state.md.block.tokenize(state, startLine, endLine);\n\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.sCount[startLine] = oldSCount;\n state.bMarks[startLine] = oldBMark;\n\n token = new Token(\"footnoteReferenceClose\", \"\", -1);\n token.level = --state.level;\n state.tokens.push(token);\n\n return true;\n};\n\n// Process inline footnotes (^[...])\nconst footnoteInline: RuleInline = (state: FootNoteStateInline, silent) => {\n let footnoteId;\n let token;\n let tokens: Token[];\n const max = state.posMax;\n const start = state.pos;\n\n if (start + 2 >= max) return false;\n if (state.src.charAt(start) !== \"^\") return false;\n\n if (state.src.charAt(start + 1) !== \"[\") return false;\n\n const labelStart = start + 2;\n const labelEnd = parseLinkLabel(state, start + 1);\n\n // parser failed to find ']', so it’s not a valid note\n if (labelEnd < 0) return false;\n\n /*\n * We found the end of the link, and know for a fact it’s a valid link;\n * so all that’s left to do is to call tokenizer.\n *\n */\n if (!silent) {\n if (!state.env.footnotes) state.env.footnotes = {};\n if (!state.env.footnotes.list) state.env.footnotes.list = [];\n footnoteId = state.env.footnotes.list.length;\n\n state.md.inline.parse(\n state.src.slice(labelStart, labelEnd),\n state.md,\n state.env,\n (tokens = []),\n );\n\n token = state.push(\"footnoteRef\", \"\", 0);\n token.meta = { id: footnoteId };\n\n state.env.footnotes.list[footnoteId] = {\n content: state.src.slice(labelStart, labelEnd),\n tokens,\n };\n }\n\n state.pos = labelEnd + 1;\n state.posMax = max;\n\n return true;\n};\n\n// Process footnote references ([^...])\nconst footnoteRef: RuleInline = (state: FootNoteStateInline, silent) => {\n let pos;\n let footnoteId;\n let footnoteSubId;\n let token;\n const max = state.posMax;\n const start = state.pos;\n\n // should be at least 4 chars - \"[^x]\"\n if (start + 3 > max) return false;\n\n if (!state.env.footnotes || !state.env.footnotes.refs) return false;\n if (state.src.charAt(start) !== \"[\") return false;\n\n if (state.src.charAt(start + 1) !== \"^\") return false;\n\n for (pos = start + 2; pos < max; pos++) {\n if (state.src.charAt(pos) === \" \") return false;\n if (state.src.charAt(pos) === \"\\n\") return false;\n if (state.src.charAt(pos) === \"]\") break;\n }\n\n if (pos === start + 2) return false; // no empty footnote labels\n if (pos >= max) return false;\n\n pos += 1;\n\n const label = state.src.slice(start + 2, pos - 1);\n\n if (typeof state.env.footnotes.refs[`:${label}`] === \"undefined\")\n return false;\n\n if (!silent) {\n if (!state.env.footnotes.list) state.env.footnotes.list = [];\n\n if (state.env.footnotes.refs[`:${label}`] < 0) {\n footnoteId = state.env.footnotes.list.length;\n state.env.footnotes.list[footnoteId] = { label, count: 0 };\n state.env.footnotes.refs[`:${label}`] = footnoteId;\n } else {\n footnoteId = state.env.footnotes.refs[`:${label}`];\n }\n\n footnoteSubId = state.env.footnotes.list[footnoteId].count!;\n state.env.footnotes.list[footnoteId].count =\n state.env.footnotes.list[footnoteId].count! + 1;\n\n token = state.push(\"footnoteRef\", \"\", 0);\n token.meta = { id: footnoteId, subId: footnoteSubId, label };\n }\n\n state.pos = pos;\n state.posMax = max;\n\n return true;\n};\n\n// Glue footnote tokens to end of token stream\nconst footnoteTail = (state: FootNoteStateCore): boolean => {\n let lastParagraph: FootNoteToken | null;\n let token: Token;\n let tokens: Token[];\n let current: Token[];\n let currentLabel: string;\n let insideRef = false;\n const refTokens: Record<string, Token[]> = {};\n\n if (!state.env.footnotes) return false;\n\n state.tokens = state.tokens.filter((stateToken) => {\n if (stateToken.type === \"footnoteReferenceOpen\") {\n insideRef = true;\n current = [];\n currentLabel = stateToken.meta.label;\n\n return false;\n }\n if (stateToken.type === \"footnoteReferenceClose\") {\n insideRef = false;\n // prepend ':' to avoid conflict with Object.prototype members\n refTokens[`:${currentLabel}`] = current;\n\n return false;\n }\n if (insideRef) current.push(stateToken);\n\n return !insideRef;\n });\n\n if (!state.env.footnotes.list) return false;\n const { list } = state.env.footnotes;\n\n token = new Token(\"footnoteBlockOpen\", \"\", 1);\n state.tokens.push(token);\n\n for (let i = 0, { length } = list; i < length; i++) {\n token = new Token(\"footnoteOpen\", \"\", 1);\n token.meta = { id: i, label: list[i].label };\n state.tokens.push(token);\n\n if (list[i].tokens) {\n tokens = [];\n\n token = new Token(\"paragraph_open\", \"p\", 1);\n token.block = true;\n tokens.push(token);\n\n token = new Token(\"inline\", \"\", 0);\n token.children = list[i].tokens!;\n token.content = list[i].content!;\n tokens.push(token);\n\n token = new Token(\"paragraph_close\", \"p\", -1);\n token.block = true;\n tokens.push(token);\n } else if (list[i].label) {\n tokens = refTokens[`:${list[i].label!}`];\n } else {\n tokens = [];\n }\n\n if (tokens) state.tokens = state.tokens.concat(tokens);\n if (state.tokens[state.tokens.length - 1].type === \"paragraph_close\")\n lastParagraph = state.tokens.pop() || null;\n else lastParagraph = null;\n\n for (let j = 0; j < (Number(list[i].count) > 0 ? list[i].count! : 1); j++) {\n token = new Token(\"footnoteAnchor\", \"\", 0);\n token.meta = { id: i, subId: j, label: list[i].label };\n state.tokens.push(token);\n }\n\n if (lastParagraph) state.tokens.push(lastParagraph);\n\n token = new Token(\"footnoteClose\", \"\", -1);\n state.tokens.push(token);\n }\n\n token = new Token(\"footnoteBlockClose\", \"\", -1);\n state.tokens.push(token);\n\n return true;\n};\n\nexport const footnote: PluginSimple = (md) => {\n md.renderer.rules[\"footnoteRef\"] = renderFootnoteRef;\n md.renderer.rules[\"footnoteBlockOpen\"] = renderFootnoteBlockOpen;\n md.renderer.rules[\"footnoteBlockClose\"] = renderFootnoteBlockClose;\n md.renderer.rules[\"footnoteOpen\"] = renderFootnoteOpen;\n md.renderer.rules[\"footnoteClose\"] = renderFootnoteClose;\n md.renderer.rules[\"footnoteAnchor\"] = renderFootnoteAnchor;\n\n // helpers (only used in other rules, no tokens are attached to those)\n // helpers (only used in other rules, no tokens are attached to those)\n md.renderer.rules[\"footnoteCaption\"] = renderFootnoteCaption;\n md.renderer.rules[\"footnoteAnchorName\"] = renderFootnoteAnchorName;\n\n md.block.ruler.before(\"reference\", \"footnoteDef\", footnoteDef, {\n alt: [\"paragraph\", \"reference\"],\n });\n md.inline.ruler.after(\"image\", \"footnoteInline\", footnoteInline);\n md.inline.ruler.after(\"footnoteInline\", \"footnoteRef\", footnoteRef);\n md.core.ruler.after(\"inline\", \"footnoteTail\", footnoteTail);\n};\n"],"names":["getIDSuffix","tokens","index","renderFootnoteAnchorName","_options","env","renderFootnoteCaption","renderFootnoteRef","options","self","id","caption","renderFootnoteBlockOpen","_tokens","_index","renderFootnoteBlockClose","renderFootnoteOpen","renderFootnoteClose","renderFootnoteAnchor","footnoteDef","state","startLine","endLine","silent","pos","token","offset","ch","start","max","label","Token","oldBMark","oldTShift","oldSCount","oldParentType","posAfterColon","initial","footnoteInline","footnoteId","labelStart","labelEnd","parseLinkLabel","footnoteRef","footnoteSubId","footnoteTail","lastParagraph","current","currentLabel","insideRef","refTokens","stateToken","list","i","length","j","footnote","md"],"mappings":"qGAgCA,MAA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ACzCX,EAAM,OAAO,KAAKK,CAAK,CACzB,CAEA,OAAAA,EAAQ,IAAIM,EAAM,qBAAsB,GAAI,EAAE,EAC9CX,EAAM,OAAO,KAAKK,CAAK,EAEhB,EACT,EAEa+B,EAA0BC,GAAO,CAC5CA,EAAG,SAAS,MAAM,YAAiBlD,EACnCkD,EAAG,SAAS,MAAM,kBAAuB7C,EACzC6C,EAAG,SAAS,MAAM,mBAAwB1C,EAC1C0C,EAAG,SAAS,MAAM,aAAkBzC,EACpCyC,EAAG,SAAS,MAAM,cAAmBxC,EACrCwC,EAAG,SAAS,MAAM,eAAoBvC,EAItCuC,EAAG,SAAS,MAAM,gBAAqBnD,EACvCmD,EAAG,SAAS,MAAM,mBAAwBtD,EAE1CsD,EAAG,MAAM,MAAM,OAAO,YAAa,cAAetC,EAAa,CAC7D,IAAK,CAAC,YAAa,WAAW,CAChC,CAAC,EACDsC,EAAG,OAAO,MAAM,MAAM,QAAS,iBAAkBnB,CAAc,EAC/DmB,EAAG,OAAO,MAAM,MAAM,iBAAkB,cAAed,CAAW,EAClEc,EAAG,KAAK,MAAM,MAAM,SAAU,eAAgBZ,CAAY,CAC5D"} | ||
| {"version":3,"file":"index.js","sources":["../src/plugin.ts"],"sourcesContent":["/**\n * Forked from https://github.com/markdown-it/markdown-it-footnote/blob/master/index.mjs\n */\n\nimport type { PluginSimple } from \"markdown-it\";\nimport type { RuleBlock } from \"markdown-it/lib/parser_block.mjs\";\nimport type { RuleCore } from \"markdown-it/lib/parser_core.mjs\";\nimport type { RuleInline } from \"markdown-it/lib/parser_inline.mjs\";\nimport type { RenderRule } from \"markdown-it/lib/renderer.mjs\";\nimport type { ParentType } from \"markdown-it/lib/rules_block/state_block.mjs\";\nimport type StateBlock from \"markdown-it/lib/rules_block/state_block.mjs\";\nimport type StateCore from \"markdown-it/lib/rules_core/state_core.mjs\";\nimport type StateInline from \"markdown-it/lib/rules_inline/state_inline.mjs\";\nimport type Token from \"markdown-it/lib/token.mjs\";\n\nimport type { FootNoteEnv, FootNoteToken } from \"./types.js\";\n\ninterface FootNoteStateBlock extends StateBlock {\n tokens: FootNoteToken[];\n env: FootNoteEnv;\n}\n\ninterface FootNoteStateInline extends StateInline {\n tokens: FootNoteToken[];\n env: FootNoteEnv;\n}\n\ninterface FootNoteStateCore extends StateCore {\n tokens: FootNoteToken[];\n env: FootNoteEnv;\n}\n\nconst getIDSuffix = (tokens: FootNoteToken[], index: number): string =>\n // add suffix when multiple id was found\n tokens[index].meta.subId > 0 ? `:${tokens[index].meta.subId}` : \"\";\n\nconst renderFootnoteAnchorName: RenderRule = (\n tokens: FootNoteToken[],\n index,\n _options,\n env: FootNoteEnv,\n): string =>\n `${\n // prefix\n typeof env.docId === \"string\" ? `-${env.docId}-` : \"\"\n }${\n // increasing id\n (tokens[index].meta.id + 1).toString()\n }`;\n\nconst renderFootnoteCaption: RenderRule = (\n tokens: FootNoteToken[],\n index,\n): string =>\n `[${\n // number\n (tokens[index].meta.id + 1).toString()\n }${getIDSuffix(tokens, index)}]`;\n\nconst renderFootnoteRef: RenderRule = (\n tokens: FootNoteToken[],\n index,\n options,\n env: FootNoteEnv,\n self,\n): string => {\n const id = self.rules[\"footnote_anchorName\"]!(\n tokens,\n index,\n options,\n env,\n self,\n );\n const caption = self.rules[\"footnote_caption\"]!(\n tokens,\n index,\n options,\n env,\n self,\n );\n\n return `<sup class=\"footnote-ref\"><a href=\"#footnote${id}\">${caption}</a><a class=\"footnote-anchor\" id=\"footnote-ref${id}${getIDSuffix(\n tokens,\n index,\n )}\" /></sup>`;\n};\n\nconst renderFootnoteBlockOpen: RenderRule = (\n _tokens: FootNoteToken[],\n _index,\n options,\n): string =>\n `\\\n<hr class=\"footnotes-sep\"${options.xhtmlOut ? \" /\" : \"\"}>\n<section class=\"footnotes\">\n<ol class=\"footnotes-list\">\n`;\n\nconst renderFootnoteBlockClose = (): string => `\\\n</ol>\n</section>\n`;\n\nconst renderFootnoteOpen: RenderRule = (\n tokens: FootNoteToken[],\n index,\n options,\n env: FootNoteEnv,\n self,\n): string =>\n `<li id=\"footnote${self.rules[\"footnote_anchorName\"]!(\n tokens,\n index,\n options,\n env,\n self,\n )}${getIDSuffix(tokens, index)}\" class=\"footnote-item\">`;\n\nconst renderFootnoteClose = (): string => \"</li>\\n\";\n\nconst renderFootnoteAnchor: RenderRule = (\n tokens: FootNoteToken[],\n index,\n options,\n env: FootNoteEnv,\n self,\n): string =>\n ` <a href=\"#footnote-ref${self.rules[\"footnote_anchorName\"]!(\n tokens,\n index,\n options,\n env,\n self,\n )}${\n getIDSuffix(tokens, index)\n /* ↩ with escape code to prevent display as Apple Emoji on iOS */\n }\" class=\"footnote-backref\">\\u21a9\\uFE0E</a>`;\n\n// Process footnote block definition\nconst footnoteDef: RuleBlock = (\n state: FootNoteStateBlock,\n startLine,\n endLine,\n silent,\n) => {\n const start = state.bMarks[startLine] + state.tShift[startLine];\n const max = state.eMarks[startLine];\n\n if (\n // line should be at least 5 chars - \"[^x]:\"\n start + 4 > max ||\n state.src.charAt(start) !== \"[\" ||\n state.src.charAt(start + 1) !== \"^\"\n )\n return false;\n\n let pos = start + 2;\n\n while (pos < max) {\n if (state.src.charAt(pos) === \" \") return false;\n if (state.src.charAt(pos) === \"]\") break;\n pos++;\n }\n\n if (\n // empty footnote label\n pos === start + 2 ||\n pos + 1 >= max ||\n state.src.charAt(++pos) !== \":\"\n )\n return false;\n\n if (silent) return true;\n pos++;\n\n (state.env.footnotes ??= {}).refs ??= {};\n\n const label = state.src.slice(start + 2, pos - 2);\n\n state.env.footnotes.refs[`:${label}`] = -1;\n\n const referenceOpenToken = state.push(\"footnote_reference_open\", \"\", 1);\n\n referenceOpenToken.meta = { label };\n referenceOpenToken.level = state.level++;\n\n const oldBMark = state.bMarks[startLine];\n const oldTShift = state.tShift[startLine];\n const oldSCount = state.sCount[startLine];\n const oldParentType = state.parentType;\n const posAfterColon = pos;\n const initial =\n state.sCount[startLine] +\n pos -\n (state.bMarks[startLine] + state.tShift[startLine]);\n\n let offset =\n state.sCount[startLine] +\n pos -\n (state.bMarks[startLine] + state.tShift[startLine]);\n\n while (pos < max) {\n const char = state.src.charAt(pos);\n\n if (char === \"\\t\") offset += 4 - (offset % 4);\n else if (char === \" \") offset++;\n else break;\n\n pos++;\n }\n\n state.tShift[startLine] = pos - posAfterColon;\n state.sCount[startLine] = offset - initial;\n\n state.bMarks[startLine] = posAfterColon;\n state.blkIndent += 4;\n state.parentType = \"footnote\" as unknown as ParentType;\n\n if (state.sCount[startLine] < state.blkIndent)\n state.sCount[startLine] += state.blkIndent;\n\n state.md.block.tokenize(state, startLine, endLine);\n\n state.parentType = oldParentType;\n state.blkIndent -= 4;\n state.tShift[startLine] = oldTShift;\n state.sCount[startLine] = oldSCount;\n state.bMarks[startLine] = oldBMark;\n\n const referenceCloseToken = state.push(\"footnote_reference_close\", \"\", -1);\n\n referenceCloseToken.level = --state.level;\n\n return true;\n};\n\n// Process inline footnotes (^[...])\nconst footnoteInline: RuleInline = (state: FootNoteStateInline, silent) => {\n const max = state.posMax;\n const start = state.pos;\n\n if (\n start + 2 >= max ||\n state.src.charAt(start) !== \"^\" ||\n state.src.charAt(start + 1) !== \"[\"\n )\n return false;\n\n const labelEnd = state.md.helpers.parseLinkLabel(state, start + 1);\n\n // parser failed to find ']', so it’s not a valid note\n if (labelEnd < 0) return false;\n\n const labelStart = start + 2;\n\n /*\n * We found the end of the link, and know for a fact it’s a valid link;\n * so all that’s left to do is to call tokenizer.\n *\n */\n if (!silent) {\n const list = ((state.env.footnotes ??= {}).list ??= []);\n const footnoteId = list.length;\n const tokens: Token[] = [];\n\n state.md.inline.parse(\n state.src.slice(labelStart, labelEnd),\n state.md,\n state.env,\n tokens,\n );\n\n const refToken = state.push(\"footnote_ref\", \"\", 0);\n\n refToken.meta = { id: footnoteId };\n\n state.env.footnotes.list[footnoteId] = {\n content: state.src.slice(labelStart, labelEnd),\n tokens,\n };\n }\n\n state.pos = labelEnd + 1;\n state.posMax = max;\n\n return true;\n};\n\n// Process footnote references ([^...])\nconst footnoteRef: RuleInline = (state: FootNoteStateInline, silent) => {\n const start = state.pos;\n const max = state.posMax;\n\n if (\n // should be at least 4 chars - \"[^x]\"\n start + 3 > max ||\n !state.env.footnotes?.refs ||\n state.src.charAt(start) !== \"[\" ||\n state.src.charAt(start + 1) !== \"^\"\n )\n return false;\n\n let pos = start + 2;\n\n while (pos < max) {\n if (state.src.charAt(pos) === \" \" || state.src.charAt(pos) === \"\\n\")\n return false;\n if (state.src.charAt(pos) === \"]\") break;\n pos++;\n }\n\n if (\n // empty footnote labels\n pos === start + 2 ||\n pos >= max\n )\n return false;\n\n pos++;\n\n const label = state.src.slice(start + 2, pos - 1);\n\n if (typeof state.env.footnotes.refs[`:${label}`] === \"undefined\")\n return false;\n\n if (!silent) {\n const list = (state.env.footnotes.list ??= []);\n const { refs } = state.env.footnotes;\n let footnoteId: number;\n\n if (refs[`:${label}`] < 0) {\n footnoteId = list.length;\n list[footnoteId] = { label, count: 0 };\n refs[`:${label}`] = footnoteId;\n } else {\n footnoteId = refs[`:${label}`];\n }\n\n const subId = list[footnoteId].count!;\n\n list[footnoteId].count = list[footnoteId].count! + 1;\n\n const refToken = state.push(\"footnote_ref\", \"\", 0);\n\n refToken.meta = { id: footnoteId, subId, label };\n }\n\n state.pos = pos;\n state.posMax = max;\n\n return true;\n};\n\n// Glue footnote tokens to end of token stream\nconst footnoteTail: RuleCore = (state: FootNoteStateCore): boolean => {\n const refTokens: Record<string, Token[]> = {};\n\n let current: Token[];\n let currentLabel: string;\n let insideRef = false;\n\n if (!state.env.footnotes?.list) return false;\n\n const { list } = state.env.footnotes;\n\n state.tokens = state.tokens.filter((stateToken) => {\n if (stateToken.type === \"footnote_reference_open\") {\n insideRef = true;\n current = [];\n currentLabel = stateToken.meta.label;\n\n return false;\n }\n\n if (stateToken.type === \"footnote_reference_close\") {\n insideRef = false;\n // prepend ':' to avoid conflict with Object.prototype members\n refTokens[`:${currentLabel}`] = current;\n\n return false;\n }\n if (insideRef) current.push(stateToken);\n\n return !insideRef;\n });\n\n const footnoteBlockOpenToken = new state.Token(\"footnote_block_open\", \"\", 1);\n\n state.tokens.push(footnoteBlockOpenToken);\n\n for (let i = 0, { length } = list; i < length; i++) {\n const footnoteOpenToken = new state.Token(\"footnote_open\", \"\", 1);\n\n footnoteOpenToken.meta = { id: i, label: list[i].label };\n state.tokens.push(footnoteOpenToken);\n\n let lastParagraph: FootNoteToken | null;\n\n if (list[i].tokens) {\n const paragraphOpenToken = new state.Token(\"paragraph_open\", \"p\", 1);\n\n paragraphOpenToken.block = true;\n\n const inlineToken = new state.Token(\"inline\", \"\", 0);\n\n inlineToken.children = list[i].tokens!;\n inlineToken.content = list[i].content!;\n\n const paragraphCloseToken = new state.Token(\"paragraph_close\", \"p\", -1);\n\n paragraphCloseToken.block = true;\n\n state.tokens.push(paragraphOpenToken, inlineToken, paragraphCloseToken);\n } else if (list[i].label) {\n const tokens = refTokens[`:${list[i].label!}`];\n\n if (tokens) state.tokens.push(...tokens);\n }\n\n if (state.tokens[state.tokens.length - 1].type === \"paragraph_close\")\n lastParagraph = state.tokens.pop() ?? null;\n else lastParagraph = null;\n\n for (let j = 0; j < (Number(list[i].count) > 0 ? list[i].count! : 1); j++) {\n const footnoteAnchorToken = new state.Token(\"footnote_anchor\", \"\", 0);\n\n footnoteAnchorToken.meta = { id: i, subId: j, label: list[i].label };\n state.tokens.push(footnoteAnchorToken);\n }\n\n if (lastParagraph) state.tokens.push(lastParagraph);\n\n state.tokens.push(new state.Token(\"footnote_close\", \"\", -1));\n }\n\n state.tokens.push(new state.Token(\"footnote_block_close\", \"\", -1));\n\n return true;\n};\n\nexport const footnote: PluginSimple = (md) => {\n md.renderer.rules[\"footnote_ref\"] = renderFootnoteRef;\n md.renderer.rules[\"footnote_block_open\"] = renderFootnoteBlockOpen;\n md.renderer.rules[\"footnote_block_close\"] = renderFootnoteBlockClose;\n md.renderer.rules[\"footnote_open\"] = renderFootnoteOpen;\n md.renderer.rules[\"footnote_close\"] = renderFootnoteClose;\n md.renderer.rules[\"footnote_anchor\"] = renderFootnoteAnchor;\n\n // helpers (only used in other rules, no tokens are attached to those)\n // helpers (only used in other rules, no tokens are attached to those)\n md.renderer.rules[\"footnote_caption\"] = renderFootnoteCaption;\n md.renderer.rules[\"footnote_anchorName\"] = renderFootnoteAnchorName;\n\n md.block.ruler.before(\"reference\", \"footnoteDef\", footnoteDef, {\n alt: [\"paragraph\", \"reference\"],\n });\n md.inline.ruler.after(\"image\", \"footnoteInline\", footnoteInline);\n md.inline.ruler.after(\"footnoteInline\", \"footnote_ref\", footnoteRef);\n md.core.ruler.after(\"inline\", \"footnoteTail\", footnoteTail);\n};\n"],"names":["getIDSuffix","tokens","index","renderFootnoteAnchorName","_options","env","renderFootnoteCaption","renderFootnoteRef","options","self","id","caption","renderFootnoteBlockOpen","_tokens","_index","renderFootnoteBlockClose","renderFootnoteOpen","renderFootnoteClose","renderFootnoteAnchor","footnoteDef","state","startLine","endLine","silent","start","max","pos","label","referenceOpenToken","oldBMark","oldTShift","oldSCount","oldParentType","posAfterColon","initial","offset","char","referenceCloseToken","footnoteInline","labelEnd","labelStart","footnoteId","refToken","footnoteRef","list","refs","subId","footnoteTail","refTokens","current","currentLabel","insideRef","stateToken","footnoteBlockOpenToken","i","length","footnoteOpenToken","lastParagraph","paragraphOpenToken","inlineToken","paragraphCloseToken","j","footnoteAnchorToken","footnote","md"],"mappings":"AAgCA,MAAMA,EAAc,CAACC,EAAyBC,IAE5CD,EAAOC,CAAK,EAAE,KAAK,MAAQ,EAAI,IAAID,EAAOC,CAAK,EAAE,KAAK,KAAK,GAAK,GAE5DC,EAAuC,CAC3CF,EACAC,EACAE,EACAC,IAEA,GAEE,OAAOA,EAAI,OAAU,SAAW,IAAIA,EAAI,KAAK,IAAM,EACrD,IAEGJ,EAAOC,CAAK,EAAE,KAAK,GAAK,GAAG,SAAA,CAC9B,GAEII,EAAoC,CACxCL,EACAC,IAEA,KAEGD,EAAOC,CA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rB,CAAW,EACnEqB,EAAG,KAAK,MAAM,MAAM,SAAU,eAAgBjB,CAAY,CAC5D"} |
+1
-2
| { | ||
| "name": "@mdit/plugin-footnote", | ||
| "version": "0.9.0", | ||
| "version": "0.10.0", | ||
| "description": "footnote plugin for MarkdownIt", | ||
| "keywords": [ | ||
| "markdownit", | ||
| "markdown-it", | ||
@@ -8,0 +7,0 @@ "markdown-it-plugin", |
28692
-2.13%51
-3.77%