markdown-to-jsx 7.7.17 → 8.0.0

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.
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Analogous to `node.type`. Please note that the values here may change at any time,
3
+ * so do not hard code against the value directly.
4
+ */
5
+ export declare const RuleType: {
6
+ readonly blockQuote: "0";
7
+ readonly breakLine: "1";
8
+ readonly breakThematic: "2";
9
+ readonly codeBlock: "3";
10
+ readonly codeFenced: "4";
11
+ readonly codeInline: "5";
12
+ readonly footnote: "6";
13
+ readonly footnoteReference: "7";
14
+ readonly gfmTask: "8";
15
+ readonly heading: "9";
16
+ readonly headingSetext: "10";
17
+ readonly htmlBlock: "11";
18
+ readonly htmlComment: "12";
19
+ readonly htmlSelfClosing: "13";
20
+ readonly image: "14";
21
+ readonly link: "15";
22
+ readonly linkAngleBraceStyleDetector: "16";
23
+ readonly linkBareUrlDetector: "17";
24
+ readonly linkMailtoDetector: "18";
25
+ readonly newlineCoalescer: "19";
26
+ readonly orderedList: "20";
27
+ readonly paragraph: "21";
28
+ readonly ref: "22";
29
+ readonly refImage: "23";
30
+ readonly refLink: "24";
31
+ readonly table: "25";
32
+ readonly tableSeparator: "26";
33
+ readonly text: "27";
34
+ readonly textEscaped: "28";
35
+ readonly textFormatted: "34";
36
+ readonly unorderedList: "30";
37
+ };
38
+ export type RuleType = (typeof RuleType)[keyof typeof RuleType];
39
+ export declare function matchInlineFormatting(source: string, state?: {
40
+ inline?: boolean;
41
+ simple?: boolean;
42
+ }): RegExpMatchArray | null;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Convert markdown to JSX with ease for React and React-like projects. Super lightweight and highly configurable.",
4
4
  "homepage": "https://markdown-to-jsx.quantizor.dev",
5
5
  "license": "MIT",
6
- "version": "7.7.17",
6
+ "version": "8.0.0",
7
7
  "publishConfig": {
8
8
  "access": "public",
9
9
  "mangle": {
@@ -78,7 +78,7 @@
78
78
  "jest-serializer-html": "^7.1.0",
79
79
  "jest-watch-typeahead": "^2.2.2",
80
80
  "markdown-it": "^14.0.0",
81
- "markdown-to-jsx-latest": "npm:markdown-to-jsx@latest",
81
+ "markdown-to-jsx-latest": "npm:markdown-to-jsx@7.7.16",
82
82
  "microbundle": "^0.15.1",
83
83
  "microtime": "^3.1.1",
84
84
  "mkdirp": "^3.0.1",
@@ -105,25 +105,27 @@
105
105
  "scripts": {
106
106
  "prepublish": "in-publish && npm run build && npm run release || not-in-publish",
107
107
  "prebuild": "rimraf dist && mkdirp dist",
108
- "build": "microbundle --tsconfig tsconfig.json -f cjs,umd index.cjs.tsx --name MarkdownToJSX --define process.env.NODE_ENV=production,process.env.DEBUG=0 --globals react=React && microbundle --tsconfig tsconfig.json -f es,modern --name MarkdownToJSX --define process.env.NODE_ENV=production,process.env.DEBUG=0 && microbundle --tsconfig tsconfig.json -f es --define process.env.NODE_ENV=production -o dist/debug.mjs",
109
- "build-site": "microbundle site.tsx -o docs -f iife --tsconfig tsconfig.site.json --define process.env.NODE_ENV=production --jsx React.createElement --external react,react-dom,styled-components,katex --globals react=React,react-dom=ReactDOM,styled-components=styled --no-pkg-main",
108
+ "build": "microbundle --tsconfig tsconfig.json -f cjs,umd index.cjs.tsx --name MarkdownToJSX --define process.env.NODE_ENV=production,process.env.DEBUG=0 --globals react=React && microbundle --tsconfig tsconfig.json -f es,modern --name MarkdownToJSX --define process.env.NODE_ENV=production,process.env.DEBUG=0 && microbundle --tsconfig tsconfig.json -f es --define process.env.NODE_ENV=production --no-compress -o dist/debug.mjs",
109
+ "build-site": "microbundle site.tsx -o docs -f iife --tsconfig tsconfig.site.json --define process.env.NODE_ENV=production,process.env.DEBUG=0 --jsx React.createElement --external react,react-dom,styled-components,katex --globals react=React,react-dom=ReactDOM,styled-components=styled --no-pkg-main",
110
110
  "dev": "microbundle watch site.tsx -o docs -f iife --tsconfig tsconfig.site.json --define process.env.NODE_ENV=development --jsx React.createElement --external react,react-dom,styled-components,katex --globals react=React,react-dom=ReactDOM,styled-components=styled --no-pkg-main",
111
- "dev:debug": "microbundle watch --tsconfig tsconfig.json -f es --define process.env.NODE_ENV=production -o dist/debug.mjs",
111
+ "dev:debug": "microbundle watch --tsconfig tsconfig.json -f es --define process.env.NODE_ENV=production --no-compress -o dist/debug.mjs",
112
112
  "test": "jest --verbose",
113
- "metrics": "DEBUG=\"${DEBUG:-1}\" node -e \"const fs=await import('fs');const {compiler}=await import('./dist/debug.module.js');console.log('='.repeat(50));compiler(fs.readFileSync('fixture.md','utf8'));\"",
113
+ "test:fuzz": "jest fuzz.spec.ts --verbose",
114
+ "metrics": "DEBUG=\"${DEBUG:-1}\" bun --expose-gc -e \"import fs from 'fs';import {performance}from 'perf_hooks';import {compiler} from './index.tsx';const markdown=fs.readFileSync('fixture.md','utf8');if(gc)gc();const baseline=process.memoryUsage();const before=process.memoryUsage();const t0=performance.now();compiler(markdown);const t1=performance.now();const during=process.memoryUsage();if(gc)gc();const after=process.memoryUsage();console.log('='.repeat(50));console.log('Input size:',Math.round(markdown.length/1024)+'KB');console.log('Parse time:',(t1-t0).toFixed(2)+'ms');console.log('='.repeat(50));console.log('Memory Usage:');console.log(' Baseline (Node + imports):',Math.round(baseline.heapUsed/1024)+'KB');console.log(' Peak (during parse):',Math.round(during.heapUsed/1024)+'KB');console.log(' Final (after GC):',Math.round(after.heapUsed/1024)+'KB');console.log('='.repeat(50));console.log('True Delta:');console.log(' Parsing allocated:',Math.round((during.heapUsed-before.heapUsed)/1024)+'KB');console.log(' GC freed:',Math.round((during.heapUsed-after.heapUsed)/1024)+'KB');console.log(' Final overhead:',Math.round((after.heapUsed-before.heapUsed)/1024)+'KB');console.log('='.repeat(50));\"",
115
+ "profile": "node --cpu-prof --expose-gc profile.js && node profile.post.js",
114
116
  "size": "size-limit",
115
117
  "benchmark": "node benchmark.js",
116
118
  "benchmark:all": "node benchmark.js --all",
117
- "changeset-publish": "yarn build && changeset publish"
119
+ "changeset-publish": "bun run build && changeset publish"
118
120
  },
119
121
  "size-limit": [
120
122
  {
121
123
  "path": "./dist/index.module.js",
122
- "limit": "6.75 kB"
124
+ "limit": "8 kB"
123
125
  },
124
126
  {
125
127
  "path": "./dist/index.modern.js",
126
- "limit": "6.75 kB"
128
+ "limit": "8 kB"
127
129
  }
128
130
  ],
129
131
  "jest": {
@@ -148,6 +150,5 @@
148
150
  "jest-watch-typeahead/filename",
149
151
  "jest-watch-typeahead/testname"
150
152
  ]
151
- },
152
- "packageManager": "yarn@4.10.3"
153
+ }
153
154
  }