@humanspeak/svelte-markdown 0.8.10 → 0.8.12

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/README.md CHANGED
@@ -445,4 +445,4 @@ MIT © [Humanspeak, Inc.](LICENSE)
445
445
 
446
446
  ## Credits
447
447
 
448
- Made with by [Humanspeak](https://humanspeak.com)
448
+ Made with ❤️ by [Humanspeak](https://humanspeak.com)
@@ -0,0 +1,8 @@
1
+ <script lang="ts">
2
+ interface Props {
3
+ text?: string
4
+ }
5
+ const { text }: Props = $props()
6
+ </script>
7
+
8
+ {text}
@@ -0,0 +1,6 @@
1
+ interface Props {
2
+ text?: string;
3
+ }
4
+ declare const Escape: import("svelte").Component<Props, {}, "">;
5
+ type Escape = ReturnType<typeof Escape>;
6
+ export default Escape;
@@ -4,6 +4,6 @@ type $$ComponentProps = {
4
4
  tag: string;
5
5
  attributes?: Record<string, string>;
6
6
  };
7
- declare const UnsupportedHtml: import("svelte").Component<$$ComponentProps, {}, "">;
8
- type UnsupportedHtml = ReturnType<typeof UnsupportedHtml>;
9
- export default UnsupportedHtml;
7
+ declare const UnsupportedHTML: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type UnsupportedHTML = ReturnType<typeof UnsupportedHTML>;
9
+ export default UnsupportedHTML;
@@ -5,6 +5,7 @@ export { default as Code } from './Code.svelte';
5
5
  export { default as Codespan } from './Codespan.svelte';
6
6
  export { default as Del } from './Del.svelte';
7
7
  export { default as Em } from './Em.svelte';
8
+ export { default as Escape } from './Escape.svelte';
8
9
  export { default as Heading } from './Heading.svelte';
9
10
  export { default as Hr } from './Hr.svelte';
10
11
  export { default as Html } from './html/index.js';
@@ -5,6 +5,7 @@ export { default as Code } from './Code.svelte';
5
5
  export { default as Codespan } from './Codespan.svelte';
6
6
  export { default as Del } from './Del.svelte';
7
7
  export { default as Em } from './Em.svelte';
8
+ export { default as Escape } from './Escape.svelte';
8
9
  export { default as Heading } from './Heading.svelte';
9
10
  export { default as Hr } from './Hr.svelte';
10
11
  export { default as Html } from './html/index.js';
@@ -1,7 +1,7 @@
1
1
  export { default as Slugger } from 'github-slugger';
2
2
  export { Lexer, type MarkedOptions, type Token, type Tokens, type TokensList } from 'marked';
3
- import type { Component } from 'svelte';
4
3
  import { type HtmlRenderers } from '../renderers/html/index.js';
4
+ import type { Component } from 'svelte';
5
5
  import type { SvelteMarkdownOptions } from '../types.js';
6
6
  /**
7
7
  * Represents a Svelte component that can be used as a renderer.
@@ -26,6 +26,7 @@ export type RendererComponent = Component<any, any, any> | undefined | null;
26
26
  export type Renderers = {
27
27
  html: HtmlRenderers;
28
28
  rawtext: RendererComponent;
29
+ escape: RendererComponent;
29
30
  heading: RendererComponent;
30
31
  paragraph: RendererComponent;
31
32
  blockquote: RendererComponent;
@@ -1,7 +1,7 @@
1
1
  export { default as Slugger } from 'github-slugger';
2
2
  export { Lexer } from 'marked';
3
3
  import {} from '../renderers/html/index.js';
4
- import { Blockquote, Br, Code, Codespan, Del, Em, Heading, Hr, Html, Image, Link, List, ListItem, Paragraph, RawText, Strong, Table, TableBody, TableCell, TableHead, TableRow, Text } from '../renderers/index.js';
4
+ import { Blockquote, Br, Code, Codespan, Del, Em, Escape, Heading, Hr, Html, Image, Link, List, ListItem, Paragraph, RawText, Strong, Table, TableBody, TableCell, TableHead, TableRow, Text } from '../renderers/index.js';
5
5
  /**
6
6
  * Default renderer configuration mapping markdown elements to Svelte components.
7
7
  * Provides out-of-the-box rendering capabilities while allowing for customization.
@@ -20,6 +20,7 @@ export const defaultRenderers = {
20
20
  image: Image,
21
21
  link: Link,
22
22
  em: Em,
23
+ escape: Escape,
23
24
  strong: Strong,
24
25
  codespan: Codespan,
25
26
  del: Del,
@@ -38,6 +38,7 @@ export const isHtmlOpenTag = (raw) => {
38
38
  return null;
39
39
  // If we found a tag, extract its name and check if it's an opening tag
40
40
  const match = raw.match(HTML_TAG_PATTERN);
41
+ // c8 ignore next
41
42
  if (!match)
42
43
  return null;
43
44
  return { tag: match[1], isOpening: !raw.startsWith('</') };
package/package.json CHANGED
@@ -1,131 +1,132 @@
1
1
  {
2
- "name": "@humanspeak/svelte-markdown",
3
- "version": "0.8.10",
4
- "description": "A powerful, customizable markdown renderer for Svelte with TypeScript support",
5
- "keywords": [
6
- "svelte",
7
- "markdown",
8
- "renderer",
9
- "parser",
10
- "marked",
11
- "component",
12
- "sveltekit",
13
- "svelte5",
14
- "md",
15
- "documentation",
16
- "html",
17
- "converter",
18
- "formatting"
19
- ],
20
- "homepage": "https://markdown.svelte.page",
21
- "bugs": {
22
- "url": "https://github.com/humanspeak/svelte-markdown/issues"
23
- },
24
- "repository": {
25
- "type": "git",
26
- "url": "git+https://github.com/humanspeak/svelte-markdown.git"
27
- },
28
- "funding": {
29
- "type": "github",
30
- "url": "https://github.com/sponsors/humanspeak"
31
- },
32
- "license": "MIT",
33
- "author": "Humanspeak, Inc.",
34
- "sideEffects": [
35
- "**/*.css"
36
- ],
37
- "type": "module",
38
- "exports": {
39
- ".": {
40
- "types": "./dist/index.d.ts",
41
- "svelte": "./dist/index.js"
42
- }
43
- },
44
- "svelte": "./dist/index.js",
45
- "types": "./dist/index.d.ts",
46
- "files": [
47
- "dist",
48
- "!dist/**/*.test.*",
49
- "!dist/**/*.spec.*",
50
- "!dist/test/**/*"
51
- ],
52
- "scripts": {
53
- "build": "vite build && npm run package",
54
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
55
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
56
- "dev": "vite dev",
57
- "format": "prettier --write .",
58
- "lint": "prettier --check . && eslint .",
59
- "lint:fix": "npm run format && eslint . --fix",
60
- "package": "svelte-kit sync && svelte-package && publint",
61
- "prepare": "husky",
62
- "prepublishOnly": "npm run package",
63
- "preview": "vite preview",
64
- "test": "vitest run --coverage",
65
- "test:all": "npm run test && npm run test:e2e",
66
- "test:e2e": "playwright test",
67
- "test:e2e:debug": "playwright test --debug",
68
- "test:e2e:report": "playwright show-report",
69
- "test:e2e:ui": "playwright test --ui",
70
- "test:only": "vitest run",
71
- "test:watch": "vitest"
72
- },
73
- "overrides": {
74
- "@sveltejs/kit": {
75
- "cookie": "^0.7.0"
76
- }
77
- },
78
- "dependencies": {
79
- "github-slugger": "^2.0.0",
80
- "htmlparser2": "^10.0.0",
81
- "marked": "^16.1.2"
82
- },
83
- "devDependencies": {
84
- "@eslint/compat": "^1.3.2",
85
- "@eslint/js": "^9.33.0",
86
- "@playwright/test": "^1.54.2",
87
- "@sveltejs/adapter-auto": "^6.0.2",
88
- "@sveltejs/kit": "^2.27.3",
89
- "@sveltejs/package": "^2.4.1",
90
- "@sveltejs/vite-plugin-svelte": "^6.1.1",
91
- "@testing-library/jest-dom": "^6.6.4",
92
- "@testing-library/svelte": "^5.2.8",
93
- "@testing-library/user-event": "^14.6.1",
94
- "@types/node": "^24.2.1",
95
- "@typescript-eslint/eslint-plugin": "^8.39.0",
96
- "@typescript-eslint/parser": "^8.39.0",
97
- "@vitest/coverage-v8": "^3.2.4",
98
- "eslint": "^9.33.0",
99
- "eslint-config-prettier": "^10.1.8",
100
- "eslint-plugin-import": "^2.32.0",
101
- "eslint-plugin-svelte": "^3.11.0",
102
- "eslint-plugin-unused-imports": "^4.1.4",
103
- "globals": "^16.3.0",
104
- "husky": "^9.1.7",
105
- "jsdom": "^26.1.0",
106
- "prettier": "^3.6.2",
107
- "prettier-plugin-organize-imports": "^4.2.0",
108
- "prettier-plugin-svelte": "^3.4.0",
109
- "prettier-plugin-tailwindcss": "^0.6.14",
110
- "publint": "^0.3.12",
111
- "svelte": "^5.38.0",
112
- "svelte-check": "^4.3.1",
113
- "typescript": "^5.9.2",
114
- "typescript-eslint": "^8.39.0",
115
- "vite": "^7.1.1",
116
- "vitest": "^3.2.4"
117
- },
118
- "peerDependencies": {
119
- "svelte": "^5.0.0"
120
- },
121
- "volta": {
122
- "node": "22.17.1"
123
- },
124
- "publishConfig": {
125
- "access": "public"
126
- },
127
- "tags": [
128
- "svelte",
129
- "markdown"
130
- ]
131
- }
2
+ "name": "@humanspeak/svelte-markdown",
3
+ "version": "0.8.12",
4
+ "description": "A powerful, customizable markdown renderer for Svelte with TypeScript support",
5
+ "keywords": [
6
+ "svelte",
7
+ "markdown",
8
+ "renderer",
9
+ "parser",
10
+ "marked",
11
+ "component",
12
+ "sveltekit",
13
+ "svelte5",
14
+ "md",
15
+ "documentation",
16
+ "html",
17
+ "converter",
18
+ "formatting"
19
+ ],
20
+ "homepage": "https://markdown.svelte.page",
21
+ "bugs": {
22
+ "url": "https://github.com/humanspeak/svelte-markdown/issues"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/humanspeak/svelte-markdown.git"
27
+ },
28
+ "funding": {
29
+ "type": "github",
30
+ "url": "https://github.com/sponsors/humanspeak"
31
+ },
32
+ "license": "MIT",
33
+ "author": "Humanspeak, Inc.",
34
+ "sideEffects": [
35
+ "**/*.css"
36
+ ],
37
+ "type": "module",
38
+ "exports": {
39
+ ".": {
40
+ "types": "./dist/index.d.ts",
41
+ "svelte": "./dist/index.js"
42
+ }
43
+ },
44
+ "svelte": "./dist/index.js",
45
+ "types": "./dist/index.d.ts",
46
+ "files": [
47
+ "dist",
48
+ "!dist/**/*.test.*",
49
+ "!dist/**/*.spec.*",
50
+ "!dist/test/**/*"
51
+ ],
52
+ "overrides": {
53
+ "@sveltejs/kit": {
54
+ "cookie": "^0.7.0"
55
+ }
56
+ },
57
+ "dependencies": {
58
+ "github-slugger": "^2.0.0",
59
+ "htmlparser2": "^10.0.0",
60
+ "marked": "^16.3.0"
61
+ },
62
+ "devDependencies": {
63
+ "@eslint/compat": "^1.4.0",
64
+ "@eslint/js": "^9.36.0",
65
+ "@playwright/test": "^1.55.1",
66
+ "@sveltejs/adapter-auto": "^6.1.0",
67
+ "@sveltejs/kit": "^2.43.5",
68
+ "@sveltejs/package": "^2.5.4",
69
+ "@sveltejs/vite-plugin-svelte": "^6.2.1",
70
+ "@testing-library/jest-dom": "^6.8.0",
71
+ "@testing-library/svelte": "^5.2.8",
72
+ "@testing-library/user-event": "^14.6.1",
73
+ "@types/node": "^24.5.2",
74
+ "@typescript-eslint/eslint-plugin": "^8.44.1",
75
+ "@typescript-eslint/parser": "^8.44.1",
76
+ "@vitest/coverage-v8": "^3.2.4",
77
+ "concurrently": "^9.2.1",
78
+ "eslint": "^9.36.0",
79
+ "eslint-config-prettier": "^10.1.8",
80
+ "eslint-plugin-import": "^2.32.0",
81
+ "eslint-plugin-svelte": "^3.12.4",
82
+ "eslint-plugin-unused-imports": "^4.2.0",
83
+ "globals": "^16.4.0",
84
+ "husky": "^9.1.7",
85
+ "jsdom": "^27.0.0",
86
+ "prettier": "^3.6.2",
87
+ "prettier-plugin-organize-imports": "^4.3.0",
88
+ "prettier-plugin-svelte": "^3.4.0",
89
+ "prettier-plugin-tailwindcss": "^0.6.14",
90
+ "publint": "^0.3.13",
91
+ "svelte": "^5.39.6",
92
+ "svelte-check": "^4.3.2",
93
+ "typescript": "^5.9.2",
94
+ "typescript-eslint": "^8.44.1",
95
+ "vite": "^7.1.7",
96
+ "vitest": "^3.2.4"
97
+ },
98
+ "peerDependencies": {
99
+ "svelte": "^5.0.0"
100
+ },
101
+ "volta": {
102
+ "node": "22.17.1"
103
+ },
104
+ "publishConfig": {
105
+ "access": "public"
106
+ },
107
+ "tags": [
108
+ "svelte",
109
+ "markdown"
110
+ ],
111
+ "scripts": {
112
+ "build": "vite build && npm run package",
113
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
114
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
115
+ "dev": "vite dev",
116
+ "dev:all": "concurrently -k -n pkg,docs -c green,cyan \"pnpm -w -r --filter @humanspeak/svelte-motion run dev:pkg\" \"pnpm --filter docs run dev\"",
117
+ "dev:pkg": "svelte-kit sync && svelte-package --watch",
118
+ "format": "prettier --write .",
119
+ "lint": "prettier --check . && eslint .",
120
+ "lint:fix": "npm run format && eslint . --fix",
121
+ "package": "svelte-kit sync && svelte-package && publint",
122
+ "preview": "vite preview",
123
+ "test": "vitest run --coverage",
124
+ "test:all": "npm run test && npm run test:e2e",
125
+ "test:e2e": "playwright test",
126
+ "test:e2e:debug": "playwright test --debug",
127
+ "test:e2e:report": "playwright show-report",
128
+ "test:e2e:ui": "playwright test --ui",
129
+ "test:only": "vitest run",
130
+ "test:watch": "vitest"
131
+ }
132
+ }