respec 35.8.0 → 35.9.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.
@@ -1,8 +1,12 @@
1
1
  // ReSpec Worker v1.0.0
2
- try {
3
- importScripts("https://www.w3.org/Tools/respec/respec-highlight");
4
- } catch (err) {
5
- console.error("Network error loading highlighter", err);
2
+ // hljs is either inlined by core/worker.js (preferred) or loaded below via
3
+ // importScripts as a fallback when the inline fetch was not possible.
4
+ if (typeof self.hljs === "undefined" && self.RESPEC_HIGHLIGHT_URL) {
5
+ try {
6
+ importScripts(self.RESPEC_HIGHLIGHT_URL);
7
+ } catch (err) {
8
+ console.error("Network error loading highlighter", err);
9
+ }
6
10
  }
7
11
 
8
12
  self.addEventListener("message", ({ data: originalData }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "respec",
3
- "version": "35.8.0",
3
+ "version": "35.9.0",
4
4
  "license": "W3C",
5
5
  "description": "A technical specification pre-processor.",
6
6
  "engines": {
@@ -25,24 +25,26 @@
25
25
  ],
26
26
  "devDependencies": {
27
27
  "@rollup/plugin-alias": "^5.1.1",
28
- "@rollup/plugin-commonjs": "^29.0.0",
28
+ "@rollup/plugin-commonjs": "^29.0.2",
29
29
  "@rollup/plugin-node-resolve": "^16.0.3",
30
- "@rollup/plugin-terser": "^0.4.4",
30
+ "@rollup/plugin-terser": "^1.0.0",
31
31
  "@types/pluralize": "0.0.33",
32
+ "@eslint/js": "^9.8.0",
32
33
  "boxen": "^8.0.1",
33
34
  "chokidar": "^5.0.0",
34
35
  "clean-css": "^5.3.3",
35
36
  "epipebomb": "^1.0.0",
36
- "eslint": "^8.57.1",
37
+ "eslint": "^9.8.0",
37
38
  "eslint-config-prettier": "^10.1.8",
38
39
  "eslint-plugin-import": "^2.32.0",
39
40
  "eslint-plugin-jasmine": "^4.2.2",
40
41
  "eslint-plugin-prettier": "^5.5.5",
42
+ "globals": "^16.0.0",
41
43
  "highlight.js": "^11.11.1",
42
44
  "hyperhtml": "^2.34.2",
43
45
  "idb": "^8.0.3",
44
- "jasmine": "^6.0.0",
45
- "jasmine-core": "^6.0.1",
46
+ "jasmine": "^6.1.0",
47
+ "jasmine-core": "^6.1.0",
46
48
  "karma": "^6.4.4",
47
49
  "karma-chrome-launcher": "^3.2.0",
48
50
  "karma-firefox-launcher": "^2.1.3",
@@ -54,13 +56,13 @@
54
56
  "pluralize": "^8.0.0",
55
57
  "prettier": "^3.8.1",
56
58
  "prompt": "^1.3.0",
57
- "rollup": "^4.57.1",
59
+ "rollup": "^4.59.0",
58
60
  "rollup-plugin-minify-html-literals": "^1.2.6",
59
61
  "serve": "^14.2.5",
60
- "serve-handler": "^6.1.6",
62
+ "serve-handler": "^6.1.7",
61
63
  "sniffy-mimetype": "^1.1.1",
62
64
  "typescript": "^5.9.3",
63
- "vnu-jar": "^26.2.19",
65
+ "vnu-jar": "^26.3.8",
64
66
  "webidl2": "^24.5.0"
65
67
  },
66
68
  "scripts": {
@@ -88,7 +90,7 @@
88
90
  "dependencies": {
89
91
  "colors": "1.4.0",
90
92
  "finalhandler": "^2.1.1",
91
- "marked": "^12.0.2",
93
+ "marked": "^16.3.0",
92
94
  "puppeteer": "^24.37.5",
93
95
  "sade": "^1.8.1",
94
96
  "serve-static": "^2.2.1"
@@ -105,6 +107,9 @@
105
107
  "pnpm": {
106
108
  "onlyBuiltDependencies": [
107
109
  "puppeteer"
110
+ ],
111
+ "ignoredBuiltDependencies": [
112
+ "vnu-jar"
108
113
  ]
109
114
  },
110
115
  "funding": {
@@ -13,25 +13,28 @@ import { toHTML } from "./respecDocWriter.js";
13
13
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
14
14
 
15
15
  class Renderer extends marked.Renderer {
16
- strong(text) {
17
- return colors.bold(text);
16
+ strong(token) {
17
+ return colors.bold(this.parser.parseInline(token.tokens));
18
18
  }
19
- em(text) {
20
- return colors.italic(text);
19
+ em(token) {
20
+ return colors.italic(this.parser.parseInline(token.tokens));
21
21
  }
22
- codespan(text) {
23
- return colors.underline(unescape(text));
22
+ codespan(token) {
23
+ return colors.underline(unescape(token.text));
24
24
  }
25
- paragraph(text) {
26
- return unescape(text);
25
+ paragraph(token) {
26
+ return unescape(this.parser.parseInline(token.tokens));
27
27
  }
28
- link(href, _title, text) {
29
- return `[${text}](${colors.blue.dim.underline(href)})`;
28
+ link(token) {
29
+ const text = this.parser.parseInline(token.tokens);
30
+ return `[${text}](${colors.blue.dim.underline(token.href)})`;
30
31
  }
31
- list(body, _orderered) {
32
+ list(token) {
33
+ const body = token.items.map(item => this.listitem(item)).join("");
32
34
  return `\n${body}`;
33
35
  }
34
- listitem(text) {
36
+ listitem(token) {
37
+ const text = this.parser.parseInline(token.tokens);
35
38
  return `* ${text}\n`;
36
39
  }
37
40
  }
@@ -85,7 +88,7 @@ class Logger {
85
88
 
86
89
  _formatMarkdown(str) {
87
90
  if (typeof str !== "string") return str;
88
- return marked(str, { smartypants: true, renderer: new Renderer() });
91
+ return marked(str, { renderer: new Renderer() });
89
92
  }
90
93
 
91
94
  /** @param {import("./respecDocWriter").ReSpecError} rsError */