marked 7.0.4 → 7.0.5

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.
package/lib/marked.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * marked v7.0.4 - a markdown parser
2
+ * marked v7.0.5 - a markdown parser
3
3
  * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)
4
4
  * https://github.com/markedjs/marked
5
5
  */
package/lib/marked.d.ts CHANGED
@@ -303,6 +303,7 @@ declare module "Instance" {
303
303
  import type { MarkedExtension, MarkedOptions } from "MarkedOptions";
304
304
  import type { Token, TokensList } from "Tokens";
305
305
  export type ResultCallback = (error: Error | null, parseResult?: string) => undefined | void;
306
+ export type MaybePromise = void | Promise<void>;
306
307
  export class Marked {
307
308
  #private;
308
309
  defaults: MarkedOptions;
@@ -322,7 +323,7 @@ declare module "Instance" {
322
323
  /**
323
324
  * Run callback for every token
324
325
  */
325
- walkTokens<T = void>(tokens: Token[] | TokensList, callback: (token: Token) => T | T[]): T[];
326
+ walkTokens(tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]): MaybePromise[];
326
327
  use(...args: MarkedExtension[]): this;
327
328
  setOptions(opt: MarkedOptions): this;
328
329
  }
@@ -567,7 +568,7 @@ declare module "MarkedOptions" {
567
568
  * Each token is passed by reference so updates are persisted when passed to the parser.
568
569
  * The return value of the function is ignored.
569
570
  */
570
- walkTokens?: ((token: Token) => void | unknown | Promise<void>) | undefined | null;
571
+ walkTokens?: ((token: Token) => void | Promise<void>) | undefined | null;
571
572
  /**
572
573
  * Generate closing slash for self-closing tags (<br/> instead of <br>)
573
574
  * @deprecated Deprecated in v5.0.0 use marked-xhtml to emit self-closing HTML tags for void elements (<br/>, <img/>, etc.) with a "/" as required by XHTML.
@@ -603,7 +604,7 @@ declare module "MarkedOptions" {
603
604
  /**
604
605
  * walkTokens function returns array of values for Promise.all
605
606
  */
606
- walkTokens?: null | ((token: Token) => void | (unknown | Promise<void>)[]);
607
+ walkTokens?: null | ((token: Token) => void | Promise<void> | (void | Promise<void>)[]);
607
608
  }
608
609
  }
609
610
  declare module "defaults" {
@@ -642,7 +643,7 @@ declare module "marked" {
642
643
  import { _getDefaults } from "defaults";
643
644
  import type { MarkedExtension, MarkedOptions } from "MarkedOptions";
644
645
  import type { Token, TokensList } from "Tokens";
645
- import type { ResultCallback } from "Instance";
646
+ import type { ResultCallback, MaybePromise } from "Instance";
646
647
  /**
647
648
  * Compiles markdown to HTML asynchronously.
648
649
  *
@@ -689,7 +690,7 @@ declare module "marked" {
689
690
  var getDefaults: typeof _getDefaults;
690
691
  var defaults: MarkedOptions;
691
692
  var use: (...args: MarkedExtension[]) => typeof marked;
692
- var walkTokens: <T = void>(tokens: Token[] | TokensList, callback: (token: Token) => T | T[]) => T[];
693
+ var walkTokens: (tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) => MaybePromise[];
693
694
  var parseInline: (src: string, optOrCallback?: MarkedOptions | ResultCallback | null | undefined, callback?: ResultCallback | undefined) => string | Promise<string | undefined> | undefined;
694
695
  var Parser: typeof _Parser;
695
696
  var parser: typeof _Parser.parse;
@@ -705,7 +706,7 @@ declare module "marked" {
705
706
  export const options: (options: MarkedOptions) => typeof marked;
706
707
  export const setOptions: (options: MarkedOptions) => typeof marked;
707
708
  export const use: (...args: MarkedExtension[]) => typeof marked;
708
- export const walkTokens: <T = void>(tokens: Token[] | TokensList, callback: (token: Token) => T | T[]) => T[];
709
+ export const walkTokens: (tokens: Token[] | TokensList, callback: (token: Token) => MaybePromise | MaybePromise[]) => MaybePromise[];
709
710
  export const parseInline: (src: string, optOrCallback?: MarkedOptions | ResultCallback | null | undefined, callback?: ResultCallback | undefined) => string | Promise<string | undefined> | undefined;
710
711
  export const parse: typeof marked;
711
712
  export const parser: typeof _Parser.parse;
package/lib/marked.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * marked v7.0.4 - a markdown parser
2
+ * marked v7.0.5 - a markdown parser
3
3
  * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)
4
4
  * https://github.com/markedjs/marked
5
5
  */
package/lib/marked.umd.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * marked v7.0.4 - a markdown parser
2
+ * marked v7.0.5 - a markdown parser
3
3
  * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)
4
4
  * https://github.com/markedjs/marked
5
5
  */
package/marked.min.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * marked v7.0.4 - a markdown parser
2
+ * marked v7.0.5 - a markdown parser
3
3
  * Copyright (c) 2011-2023, Christopher Jeffrey. (MIT Licensed)
4
4
  * https://github.com/markedjs/marked
5
5
  */
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "marked",
3
3
  "description": "A markdown parser built for speed",
4
4
  "author": "Christopher Jeffrey",
5
- "version": "7.0.4",
5
+ "version": "7.0.5",
6
6
  "type": "module",
7
7
  "main": "./lib/marked.cjs",
8
8
  "module": "./lib/marked.esm.js",
@@ -49,16 +49,16 @@
49
49
  "@semantic-release/commit-analyzer": "^10.0.1",
50
50
  "@semantic-release/git": "^10.0.1",
51
51
  "@semantic-release/github": "^9.0.4",
52
- "@semantic-release/npm": "^10.0.4",
52
+ "@semantic-release/npm": "^10.0.5",
53
53
  "@semantic-release/release-notes-generator": "^11.0.4",
54
- "@typescript-eslint/eslint-plugin": "^6.3.0",
55
- "@typescript-eslint/parser": "^6.3.0",
54
+ "@typescript-eslint/eslint-plugin": "^6.4.1",
55
+ "@typescript-eslint/parser": "^6.4.1",
56
56
  "cheerio": "^1.0.0-rc.12",
57
57
  "commonmark": "0.30.0",
58
58
  "cross-env": "^7.0.3",
59
59
  "eslint": "^8.47.0",
60
60
  "eslint-config-standard": "^17.1.0",
61
- "eslint-plugin-import": "^2.28.0",
61
+ "eslint-plugin-import": "^2.28.1",
62
62
  "eslint-plugin-n": "^16.0.1",
63
63
  "eslint-plugin-promise": "^6.1.1",
64
64
  "front-matter": "^4.0.2",
@@ -69,7 +69,7 @@
69
69
  "node-fetch": "^3.3.2",
70
70
  "recheck": "^4.4.5",
71
71
  "rollup": "^3.28.0",
72
- "semantic-release": "^21.0.7",
72
+ "semantic-release": "^21.0.9",
73
73
  "titleize": "^3.0.0",
74
74
  "ts-expect": "^1.3.0",
75
75
  "ts-node": "^10.9.1",