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

marked-gfm-heading-id

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marked-gfm-heading-id - npm Package Compare versions

Comparing version 4.0.1 to 4.1.0

5

lib/index.umd.js

@@ -124,8 +124,7 @@ (function (global, factory) {

const raw = unescape(this.parser.parseInline(tokens, this.parser.textRenderer))
.toLowerCase()
.trim()
.replace(/<[!\/a-z].*?>/gi, '');
const level = depth;
const id = `${prefix}${slugger.slug(raw)}`;
const heading = { level, text, id };
const id = `${prefix}${slugger.slug(raw.toLowerCase())}`;
const heading = { level, text, id, raw };
headings.push(heading);

@@ -132,0 +131,0 @@

10

package.json
{
"name": "marked-gfm-heading-id",
"version": "4.0.1",
"version": "4.1.0",
"description": "marked GFM heading ids",

@@ -55,14 +55,14 @@ "main": "./lib/index.cjs",

"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^10.1.3",
"@semantic-release/github": "^10.1.6",
"@semantic-release/npm": "^12.0.1",
"@semantic-release/release-notes-generator": "^14.0.1",
"babel-jest": "^29.7.0",
"eslint": "^9.8.0",
"eslint": "^9.9.0",
"globals": "^15.9.0",
"jest-cli": "^29.7.0",
"marked": "^14.0.0",
"rollup": "^4.20.0",
"semantic-release": "^24.0.0",
"rollup": "^4.21.0",
"semantic-release": "^24.1.0",
"tsd": "^0.31.1"
}
}

@@ -32,2 +32,3 @@ # marked-gfm-heading-id

- `level`: The heading level (1-7)
- `raw`: The raw text (stripped of HTML rendering if any; this is usefull for situation like `marked("# [heading](./link)");`)
- `id`: The id given to the heading including any prefix

@@ -46,3 +47,3 @@

<ul id="table-of-contents">
${headings.map(({id, text, level}) => `<li><a href="#${id}" class="h${level}">${text}</a></li>`)}
${headings.map(({id, raw, level}) => `<li><a href="#${id}" class="h${level}">${raw}</a></li>`)}
</ul>

@@ -49,0 +50,0 @@ ${html}`;

@@ -25,2 +25,3 @@ // eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars

text: string;
raw: string;
id: string;

@@ -27,0 +28,0 @@ }

@@ -39,8 +39,7 @@ import GithubSlugger from 'github-slugger';

const raw = unescape(this.parser.parseInline(tokens, this.parser.textRenderer))
.toLowerCase()
.trim()
.replace(/<[!\/a-z].*?>/gi, '');
const level = depth;
const id = `${prefix}${slugger.slug(raw)}`;
const heading = { level, text, id };
const id = `${prefix}${slugger.slug(raw.toLowerCase())}`;
const heading = { level, text, id, raw };
headings.push(heading);

@@ -47,0 +46,0 @@

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