@humanspeak/svelte-markdown 0.8.5 → 0.8.7

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.
@@ -3,8 +3,11 @@
3
3
 
4
4
  interface Props {
5
5
  children?: Snippet
6
+ listItemIndex?: number
6
7
  }
7
- const { children }: Props = $props()
8
+
9
+ // trunk-ignore(eslint/@typescript-eslint/no-unused-vars,eslint/no-unused-vars)
10
+ const { children, listItemIndex = undefined }: Props = $props()
8
11
  </script>
9
12
 
10
13
  <li>{@render children?.()}</li>
@@ -1,6 +1,7 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  interface Props {
3
3
  children?: Snippet;
4
+ listItemIndex?: number;
4
5
  }
5
6
  declare const ListItem: import("svelte").Component<Props, {}, "">;
6
7
  type ListItem = ReturnType<typeof ListItem>;
@@ -240,7 +240,15 @@ export const containsMultipleTags = (html) => {
240
240
  export const shrinkHtmlTokens = (tokens) => {
241
241
  const result = [];
242
242
  for (const token of tokens) {
243
- if (token.type === 'table') {
243
+ if (token.type === 'list') {
244
+ token.items = token.items.map((item, index) => ({
245
+ ...item,
246
+ listItemIndex: index,
247
+ tokens: item.tokens ? shrinkHtmlTokens(item.tokens) : []
248
+ }));
249
+ result.push(token);
250
+ }
251
+ else if (token.type === 'table') {
244
252
  // Process header cells
245
253
  if (token.header) {
246
254
  token.header = token.header.map((cell) => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@humanspeak/svelte-markdown",
3
- "version": "0.8.5",
3
+ "version": "0.8.7",
4
4
  "description": "A powerful, customizable markdown renderer for Svelte with TypeScript support",
5
5
  "keywords": [
6
6
  "svelte",
@@ -69,44 +69,49 @@
69
69
  "test:only": "vitest run",
70
70
  "test:watch": "vitest"
71
71
  },
72
+ "overrides": {
73
+ "@sveltejs/kit": {
74
+ "cookie": "^0.7.0"
75
+ }
76
+ },
72
77
  "dependencies": {
73
78
  "github-slugger": "^2.0.0",
74
79
  "htmlparser2": "^10.0.0",
75
- "marked": "^15.0.11"
80
+ "marked": "^15.0.12"
76
81
  },
77
82
  "devDependencies": {
78
83
  "@eslint/compat": "^1.2.9",
79
84
  "@eslint/js": "^9.27.0",
80
85
  "@playwright/test": "^1.52.0",
81
86
  "@sveltejs/adapter-auto": "^6.0.1",
82
- "@sveltejs/kit": "^2.21.0",
87
+ "@sveltejs/kit": "^2.21.1",
83
88
  "@sveltejs/package": "^2.3.11",
84
89
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
85
90
  "@testing-library/jest-dom": "^6.6.3",
86
- "@testing-library/svelte": "^5.2.7",
91
+ "@testing-library/svelte": "^5.2.8",
87
92
  "@testing-library/user-event": "^14.6.1",
88
- "@types/node": "^22.15.18",
89
- "@typescript-eslint/eslint-plugin": "^8.32.1",
90
- "@typescript-eslint/parser": "^8.32.1",
91
- "@vitest/coverage-v8": "^3.1.3",
93
+ "@types/node": "^22.15.24",
94
+ "@typescript-eslint/eslint-plugin": "^8.33.0",
95
+ "@typescript-eslint/parser": "^8.33.0",
96
+ "@vitest/coverage-v8": "^3.1.4",
92
97
  "eslint": "^9.27.0",
93
98
  "eslint-config-prettier": "^10.1.5",
94
99
  "eslint-plugin-import": "^2.31.0",
95
- "eslint-plugin-svelte": "^3.8.0",
100
+ "eslint-plugin-svelte": "^3.9.0",
96
101
  "eslint-plugin-unused-imports": "^4.1.4",
97
- "globals": "^16.1.0",
102
+ "globals": "^16.2.0",
98
103
  "jsdom": "^26.1.0",
99
104
  "prettier": "^3.5.3",
100
105
  "prettier-plugin-organize-imports": "^4.1.0",
101
106
  "prettier-plugin-svelte": "^3.4.0",
102
107
  "prettier-plugin-tailwindcss": "^0.6.11",
103
108
  "publint": "^0.3.12",
104
- "svelte": "^5.30.1",
109
+ "svelte": "^5.33.4",
105
110
  "svelte-check": "^4.2.1",
106
111
  "typescript": "^5.8.3",
107
- "typescript-eslint": "^8.32.1",
112
+ "typescript-eslint": "^8.33.0",
108
113
  "vite": "^6.3.5",
109
- "vitest": "^3.1.3"
114
+ "vitest": "^3.1.4"
110
115
  },
111
116
  "peerDependencies": {
112
117
  "svelte": "^5.0.0"
@@ -117,11 +122,6 @@
117
122
  "publishConfig": {
118
123
  "access": "public"
119
124
  },
120
- "overrides": {
121
- "@sveltejs/kit": {
122
- "cookie": "^0.7.0"
123
- }
124
- },
125
125
  "tags": [
126
126
  "svelte",
127
127
  "markdown"