From ccd02296b0a571d84c7eca28f0951634cba094c9 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 14 Sep 2023 13:20:54 -0600 Subject: [PATCH] docs: remove slugger (#2984) --- docs/USING_PRO.md | 32 +------------------------------- test/unit/marked-spec.js | 2 +- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/docs/USING_PRO.md b/docs/USING_PRO.md index 8ef2a76284..2cc899d4c2 100644 --- a/docs/USING_PRO.md +++ b/docs/USING_PRO.md @@ -115,7 +115,7 @@ marked.use({ - **code**(*string* code, *string* infostring, *boolean* escaped) - **blockquote**(*string* quote) - **html**(*string* html, *boolean* block) -- **heading**(*string* text, *number* level, *string* raw, *Slugger* slugger) +- **heading**(*string* text, *number* level, *string* raw) - **hr**() - **list**(*string* body, *boolean* ordered, *number* start) - **listitem**(*string* text, *boolean* task, *boolean* checked) @@ -136,36 +136,6 @@ marked.use({ - **image**(*string* href, *string* title, *string* text) - **text**(*string* text) -`Slugger` is exposed from marked as `marked.Slugger`: - -```js -import { marked } from 'marked' -const slugger = new marked.Slugger() -``` - -`slugger` has the `slug` method to create a unique id from value: - -```js -slugger.slug('foo') // foo -slugger.slug('foo') // foo-1 -slugger.slug('foo') // foo-2 -slugger.slug('foo 1') // foo-1-1 -slugger.slug('foo-1') // foo-1-2 -... -``` - -`slugger.slug` can also be called with the `dryrun` option for stateless operation: -```js -slugger.slug('foo') // foo -slugger.slug('foo') // foo-1 -slugger.slug('foo') // foo-2 -slugger.slug('foo', { dryrun: true }) // foo-3 -slugger.slug('foo', { dryrun: true }) // foo-3 -slugger.slug('foo') // foo-3 -slugger.slug('foo') // foo-4 -... -``` - `flags` has the following properties: ```js diff --git a/test/unit/marked-spec.js b/test/unit/marked-spec.js index 6ee6eebebc..5be1b2b857 100644 --- a/test/unit/marked-spec.js +++ b/test/unit/marked-spec.js @@ -444,7 +444,7 @@ describe('use extension', () => { } }, renderer: { - heading(text, depth, raw, slugger) { + heading(text, depth, raw) { if (text === name) { return `${text}\n`; }