Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

marked-footnote

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marked-footnote - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

7

changelog.md

@@ -0,1 +1,8 @@

## marked-footnote [1.2.3](https://github.com/bent10/marked-extensions/compare/marked-footnote@1.2.2...marked-footnote@1.2.3) (2024-08-29)
### Bug Fixes
* lint code ([c75dfc9](https://github.com/bent10/marked-extensions/commit/c75dfc94eb2fc61d258d2e36caf20d4a91e06a16))
## marked-footnote [1.2.2](https://github.com/bent10/marked-extensions/compare/marked-footnote@1.2.1...marked-footnote@1.2.2) (2023-12-16)

@@ -2,0 +9,0 @@

10

dist/index.js

@@ -25,5 +25,3 @@ function p(t, l) {

f += // add lines after list, blockquote, codefence, and table
u && /^[ \t]*?[>\-\*][ ]|[`]{3,}$|^[ \t]*?[\|].+[\|]$/.test(
u
) ? `
u && /^[ \t]*?[>\-*][ ]|[`]{3,}$|^[ \t]*?[|].+[|]$/.test(u) ? `

@@ -57,4 +55,3 @@ ` : "";

);
if (!f.length)
return;
if (!f.length) return;
const u = f[0], a = h.items.filter((s) => s.label === i)[0], c = {

@@ -80,4 +77,3 @@ type: "footnoteRef",

renderer({ raw: l, items: o = [] }) {
if (o.length === 0)
return "";
if (o.length === 0) return "";
const r = o.reduce(

@@ -84,0 +80,0 @@ (n, { label: i, content: h, refs: f }) => {

(function(h,p){typeof exports=="object"&&typeof module<"u"?module.exports=p():typeof define=="function"&&define.amd?define(p):(h=typeof globalThis<"u"?globalThis:h||self,h.markedFootnote=p())})(this,function(){"use strict";function h(t,c){const n={type:"footnotes",raw:c,rawItems:[],items:[]};return{name:"footnote",level:"block",childTokens:["content"],tokenizer(r){t.hasFootnotes||(this.lexer.tokens.push(n),t.tokens=this.lexer.tokens,t.hasFootnotes=!0,n.rawItems=[],n.items=[]);const e=/^\[\^([^\]\n]+)\]:(?:[ \t]+|[\n]*?|$)([^\n]*?(?:\n|$)(?:\n*?[ ]{4,}[^\n]*)*)/.exec(r);if(e){const[o,f,u=""]=e;let l=u.split(`
`).reduce((i,s)=>i+`
`+s.replace(/^(?:[ ]{4}|[\t])/,""),"");const d=l.trimEnd().split(`
`).pop();l+=d&&/^[ \t]*?[>\-\*][ ]|[`]{3,}$|^[ \t]*?[\|].+[\|]$/.test(d)?`
`).pop();l+=d&&/^[ \t]*?[>\-*][ ]|[`]{3,}$|^[ \t]*?[|].+[|]$/.test(d)?`

@@ -6,0 +6,0 @@ `:"";const a={type:"footnote",raw:o,label:f,refs:[],content:this.lexer.blockTokens(l)};return n.rawItems.push(a),a}},renderer(){return""}}}function p(t,c=!1){let n=0;return{name:"footnoteRef",level:"inline",tokenizer(r){const e=/^\[\^([^\]\n]+)\]/.exec(r);if(e){const[o,f]=e,u=this.lexer.tokens[0],l=u.rawItems.filter(s=>s.label===f);if(!l.length)return;const d=l[0],a=u.items.filter(s=>s.label===f)[0],i={type:"footnoteRef",raw:o,id:"",label:f};return a?(i.id=`${n}:${a.refs.length+1}`,a.refs.push(i)):(n++,i.id=String(n),d.refs.push(i),u.items.push(d)),i}},renderer({id:r,label:e}){n=0;const o=encodeURIComponent(e);return`<sup><a id="${t}ref-${o}" href="#${t+o}" data-${t}ref aria-describedby="${t}label">${c?`[${r}]`:r}</a></sup>`}}}function $(t){return{name:"footnotes",renderer({raw:c,items:n=[]}){if(n.length===0)return"";const r=n.reduce((o,{label:f,content:u,refs:l})=>{const d=encodeURIComponent(f),a=this.parser.parse(u).trimEnd(),i=a.endsWith("</p>");let s=`<li id="${t+d}">

{
"name": "marked-footnote",
"description": "A marked extension to support GFM footnotes",
"version": "1.2.2",
"version": "1.2.3",
"publishConfig": {

@@ -6,0 +6,0 @@ "access": "public"

@@ -325,2 +325,2 @@ # marked-footnote

A project by [Stilearning](https://stilearning.com) &copy; 2023.
A project by [Stilearning](https://stilearning.com) &copy; 2023-2024.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc