@memberjunction/ng-markdown 5.44.0 → 5.45.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.
- package/dist/__tests__/markdown.service.dom.test.d.ts +2 -0
- package/dist/__tests__/markdown.service.dom.test.d.ts.map +1 -0
- package/dist/__tests__/markdown.service.dom.test.js +86 -0
- package/dist/__tests__/markdown.service.dom.test.js.map +1 -0
- package/dist/__tests__/web-dom-utils.test.d.ts +2 -0
- package/dist/__tests__/web-dom-utils.test.d.ts.map +1 -0
- package/dist/__tests__/web-dom-utils.test.js +160 -0
- package/dist/__tests__/web-dom-utils.test.js.map +1 -0
- package/dist/lib/components/markdown.component.d.ts +1 -1
- package/dist/lib/components/markdown.component.d.ts.map +1 -1
- package/dist/lib/components/markdown.component.dom.test.js.map +1 -1
- package/dist/lib/components/markdown.component.js +1 -1
- package/dist/lib/components/markdown.component.js.map +1 -1
- package/dist/lib/extensions/code-copy.extension.d.ts +0 -7
- package/dist/lib/extensions/code-copy.extension.d.ts.map +1 -1
- package/dist/lib/extensions/code-copy.extension.js +1 -58
- package/dist/lib/extensions/code-copy.extension.js.map +1 -1
- package/dist/lib/extensions/collapsible-headings.extension.d.ts +5 -67
- package/dist/lib/extensions/collapsible-headings.extension.d.ts.map +1 -1
- package/dist/lib/extensions/collapsible-headings.extension.js +5 -179
- package/dist/lib/extensions/collapsible-headings.extension.js.map +1 -1
- package/dist/lib/extensions/svg-renderer.extension.d.ts +5 -28
- package/dist/lib/extensions/svg-renderer.extension.d.ts.map +1 -1
- package/dist/lib/extensions/svg-renderer.extension.js +5 -72
- package/dist/lib/extensions/svg-renderer.extension.js.map +1 -1
- package/dist/lib/services/markdown.service.d.ts +27 -43
- package/dist/lib/services/markdown.service.d.ts.map +1 -1
- package/dist/lib/services/markdown.service.js +56 -235
- package/dist/lib/services/markdown.service.js.map +1 -1
- package/dist/public-api.d.ts +0 -1
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +6 -3
- package/dist/public-api.js.map +1 -1
- package/package.json +4 -7
- package/dist/__tests__/markdown-types.test.d.ts +0 -2
- package/dist/__tests__/markdown-types.test.d.ts.map +0 -1
- package/dist/__tests__/markdown-types.test.js +0 -78
- package/dist/__tests__/markdown-types.test.js.map +0 -1
- package/dist/lib/extensions/html-block-repair.extension.d.ts +0 -20
- package/dist/lib/extensions/html-block-repair.extension.d.ts.map +0 -1
- package/dist/lib/extensions/html-block-repair.extension.js +0 -43
- package/dist/lib/extensions/html-block-repair.extension.js.map +0 -1
- package/dist/lib/types/markdown.types.d.ts +0 -194
- package/dist/lib/types/markdown.types.d.ts.map +0 -1
- package/dist/lib/types/markdown.types.js +0 -25
- package/dist/lib/types/markdown.types.js.map +0 -1
package/dist/public-api.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
// Public API Surface of @memberjunction/ng-markdown
|
|
2
|
+
//
|
|
3
|
+
// Framework-agnostic parsing, config, custom marked extensions, and types live
|
|
4
|
+
// in @memberjunction/markdown-core — import those directly from that package.
|
|
5
|
+
// This package exposes the Angular component/service plus the web-only DOM
|
|
6
|
+
// helpers that operate on rendered markup.
|
|
2
7
|
// Module
|
|
3
8
|
export * from './lib/markdown.module';
|
|
4
9
|
// Components
|
|
5
10
|
export * from './lib/components/markdown.component';
|
|
6
11
|
// Services
|
|
7
12
|
export * from './lib/services/markdown.service';
|
|
8
|
-
//
|
|
13
|
+
// Web-only DOM helpers (the pure marked extensions are in @memberjunction/markdown-core)
|
|
9
14
|
export * from './lib/extensions/collapsible-headings.extension';
|
|
10
15
|
export * from './lib/extensions/code-copy.extension';
|
|
11
16
|
export * from './lib/extensions/svg-renderer.extension';
|
|
12
|
-
// Types
|
|
13
|
-
export * from './lib/types/markdown.types';
|
|
14
17
|
//# sourceMappingURL=public-api.js.map
|
package/dist/public-api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA,oDAAoD;
|
|
1
|
+
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,2EAA2E;AAC3E,2CAA2C;AAE3C,SAAS;AACT,cAAc,uBAAuB,CAAC;AAEtC,aAAa;AACb,cAAc,qCAAqC,CAAC;AAEpD,WAAW;AACX,cAAc,iCAAiC,CAAC;AAEhD,yFAAyF;AACzF,cAAc,iDAAiD,CAAC;AAChE,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC","sourcesContent":["// Public API Surface of @memberjunction/ng-markdown\n//\n// Framework-agnostic parsing, config, custom marked extensions, and types live\n// in @memberjunction/markdown-core — import those directly from that package.\n// This package exposes the Angular component/service plus the web-only DOM\n// helpers that operate on rendered markup.\n\n// Module\nexport * from './lib/markdown.module';\n\n// Components\nexport * from './lib/components/markdown.component';\n\n// Services\nexport * from './lib/services/markdown.service';\n\n// Web-only DOM helpers (the pure marked extensions are in @memberjunction/markdown-core)\nexport * from './lib/extensions/collapsible-headings.extension';\nexport * from './lib/extensions/code-copy.extension';\nexport * from './lib/extensions/svg-renderer.extension';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-markdown",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.45.0",
|
|
4
4
|
"description": "MemberJunction: Lightweight Angular markdown component with Prism.js highlighting, Mermaid diagrams, and extensible features",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@angular/compiler": "21.1.3",
|
|
27
27
|
"@angular/compiler-cli": "21.1.3",
|
|
28
|
-
"@memberjunction/ng-test-utils": "5.
|
|
28
|
+
"@memberjunction/ng-test-utils": "5.45.0",
|
|
29
|
+
"jsdom": "^28.0.0",
|
|
29
30
|
"vitest": "^4.0.18"
|
|
30
31
|
},
|
|
31
32
|
"peerDependencies": {
|
|
@@ -34,11 +35,7 @@
|
|
|
34
35
|
"@angular/platform-browser": "21.1.3"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"
|
|
38
|
-
"marked-alert": "^2.1.2",
|
|
39
|
-
"marked-gfm-heading-id": "^4.1.3",
|
|
40
|
-
"marked-highlight": "^2.2.3",
|
|
41
|
-
"marked-smartypants": "^1.1.11",
|
|
38
|
+
"@memberjunction/markdown-core": "5.45.0",
|
|
42
39
|
"prismjs": "^1.30.0",
|
|
43
40
|
"mermaid": "^11.12.2",
|
|
44
41
|
"tslib": "^2.8.1"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-types.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/markdown-types.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest';
|
|
2
|
-
import { DEFAULT_MARKDOWN_CONFIG } from '../lib/types/markdown.types';
|
|
3
|
-
describe('DEFAULT_MARKDOWN_CONFIG', () => {
|
|
4
|
-
it('should enable syntax highlighting', () => {
|
|
5
|
-
expect(DEFAULT_MARKDOWN_CONFIG.enableHighlight).toBe(true);
|
|
6
|
-
});
|
|
7
|
-
it('should enable mermaid', () => {
|
|
8
|
-
expect(DEFAULT_MARKDOWN_CONFIG.enableMermaid).toBe(true);
|
|
9
|
-
});
|
|
10
|
-
it('should enable code copy', () => {
|
|
11
|
-
expect(DEFAULT_MARKDOWN_CONFIG.enableCodeCopy).toBe(true);
|
|
12
|
-
});
|
|
13
|
-
it('should disable collapsible headings by default', () => {
|
|
14
|
-
expect(DEFAULT_MARKDOWN_CONFIG.enableCollapsibleHeadings).toBe(false);
|
|
15
|
-
});
|
|
16
|
-
it('should set collapsible heading level to 2', () => {
|
|
17
|
-
expect(DEFAULT_MARKDOWN_CONFIG.collapsibleHeadingLevel).toBe(2);
|
|
18
|
-
});
|
|
19
|
-
it('should have collapsible default expanded true', () => {
|
|
20
|
-
expect(DEFAULT_MARKDOWN_CONFIG.collapsibleDefaultExpanded).toBe(true);
|
|
21
|
-
});
|
|
22
|
-
it('should enable alerts', () => {
|
|
23
|
-
expect(DEFAULT_MARKDOWN_CONFIG.enableAlerts).toBe(true);
|
|
24
|
-
});
|
|
25
|
-
it('should enable smartypants', () => {
|
|
26
|
-
expect(DEFAULT_MARKDOWN_CONFIG.enableSmartypants).toBe(true);
|
|
27
|
-
});
|
|
28
|
-
it('should enable SVG renderer', () => {
|
|
29
|
-
expect(DEFAULT_MARKDOWN_CONFIG.enableSvgRenderer).toBe(true);
|
|
30
|
-
});
|
|
31
|
-
it('should disable HTML passthrough by default', () => {
|
|
32
|
-
expect(DEFAULT_MARKDOWN_CONFIG.enableHtml).toBe(false);
|
|
33
|
-
});
|
|
34
|
-
it('should disable JavaScript by default', () => {
|
|
35
|
-
expect(DEFAULT_MARKDOWN_CONFIG.enableJavaScript).toBe(false);
|
|
36
|
-
});
|
|
37
|
-
it('should enable heading IDs', () => {
|
|
38
|
-
expect(DEFAULT_MARKDOWN_CONFIG.enableHeadingIds).toBe(true);
|
|
39
|
-
});
|
|
40
|
-
it('should enable sanitization', () => {
|
|
41
|
-
expect(DEFAULT_MARKDOWN_CONFIG.sanitize).toBe(true);
|
|
42
|
-
});
|
|
43
|
-
it('should use default mermaid theme', () => {
|
|
44
|
-
expect(DEFAULT_MARKDOWN_CONFIG.mermaidTheme).toBe('auto');
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
describe('HeadingInfo', () => {
|
|
48
|
-
it('should construct heading info', () => {
|
|
49
|
-
const heading = {
|
|
50
|
-
id: 'introduction',
|
|
51
|
-
text: 'Introduction',
|
|
52
|
-
level: 1,
|
|
53
|
-
raw: '# Introduction'
|
|
54
|
-
};
|
|
55
|
-
expect(heading.level).toBe(1);
|
|
56
|
-
expect(heading.id).toBe('introduction');
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
describe('MarkdownRenderEvent', () => {
|
|
60
|
-
it('should construct render event', () => {
|
|
61
|
-
const event = {
|
|
62
|
-
html: '<h1>Hello</h1>',
|
|
63
|
-
renderTime: 5.2,
|
|
64
|
-
hasMermaid: false,
|
|
65
|
-
hasCodeBlocks: true,
|
|
66
|
-
headingIds: [{ id: 'hello', text: 'Hello', level: 1, raw: '# Hello' }]
|
|
67
|
-
};
|
|
68
|
-
expect(event.renderTime).toBeCloseTo(5.2);
|
|
69
|
-
expect(event.headingIds).toHaveLength(1);
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
describe('AlertType', () => {
|
|
73
|
-
it('should support all alert types', () => {
|
|
74
|
-
const types = ['note', 'tip', 'important', 'warning', 'caution'];
|
|
75
|
-
expect(types).toHaveLength(5);
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
//# sourceMappingURL=markdown-types.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-types.test.js","sourceRoot":"","sources":["../../src/__tests__/markdown-types.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAGtE,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,CAAC,uBAAuB,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uBAAuB,EAAE,GAAG,EAAE;QAC/B,MAAM,CAAC,uBAAuB,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3D,CAAC,CAAC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AAK;YACjB,aAAa,EAAE,IAAI;YACnB,UAAU,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC;SACvE,CAAC;QACF,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QAC1C,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;QACxC,MAAM,KAAK,GAAgB,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;QAC9E,MAAM,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { describe, it, expect } from 'vitest';\nimport { DEFAULT_MARKDOWN_CONFIG } from '../lib/types/markdown.types';\nimport type { MarkdownConfig, HeadingInfo, MarkdownRenderEvent, AlertType } from '../lib/types/markdown.types';\n\ndescribe('DEFAULT_MARKDOWN_CONFIG', () => {\n it('should enable syntax highlighting', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableHighlight).toBe(true);\n });\n\n it('should enable mermaid', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableMermaid).toBe(true);\n });\n\n it('should enable code copy', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableCodeCopy).toBe(true);\n });\n\n it('should disable collapsible headings by default', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableCollapsibleHeadings).toBe(false);\n });\n\n it('should set collapsible heading level to 2', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.collapsibleHeadingLevel).toBe(2);\n });\n\n it('should have collapsible default expanded true', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.collapsibleDefaultExpanded).toBe(true);\n });\n\n it('should enable alerts', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableAlerts).toBe(true);\n });\n\n it('should enable smartypants', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableSmartypants).toBe(true);\n });\n\n it('should enable SVG renderer', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableSvgRenderer).toBe(true);\n });\n\n it('should disable HTML passthrough by default', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableHtml).toBe(false);\n });\n\n it('should disable JavaScript by default', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableJavaScript).toBe(false);\n });\n\n it('should enable heading IDs', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.enableHeadingIds).toBe(true);\n });\n\n it('should enable sanitization', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.sanitize).toBe(true);\n });\n\n it('should use default mermaid theme', () => {\n expect(DEFAULT_MARKDOWN_CONFIG.mermaidTheme).toBe('auto');\n });\n});\n\ndescribe('HeadingInfo', () => {\n it('should construct heading info', () => {\n const heading: HeadingInfo = {\n id: 'introduction',\n text: 'Introduction',\n level: 1,\n raw: '# Introduction'\n };\n expect(heading.level).toBe(1);\n expect(heading.id).toBe('introduction');\n });\n});\n\ndescribe('MarkdownRenderEvent', () => {\n it('should construct render event', () => {\n const event: MarkdownRenderEvent = {\n html: '<h1>Hello</h1>',\n renderTime: 5.2,\n hasMermaid: false,\n hasCodeBlocks: true,\n headingIds: [{ id: 'hello', text: 'Hello', level: 1, raw: '# Hello' }]\n };\n expect(event.renderTime).toBeCloseTo(5.2);\n expect(event.headingIds).toHaveLength(1);\n });\n});\n\ndescribe('AlertType', () => {\n it('should support all alert types', () => {\n const types: AlertType[] = ['note', 'tip', 'important', 'warning', 'caution'];\n expect(types).toHaveLength(5);\n });\n});\n"]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { MarkedExtension } from 'marked';
|
|
2
|
-
/**
|
|
3
|
-
* Creates a marked extension that repairs HTML blocks split by a blank line.
|
|
4
|
-
*
|
|
5
|
-
* Raw HTML embedded in markdown (e.g. a Skip PRD "## Mockup" section) is meant
|
|
6
|
-
* to be a single HTML block, but CommonMark ends an HTML block at the first
|
|
7
|
-
* blank line. Any following indented (4+ space) markup is then tokenized as an
|
|
8
|
-
* indented code block and rendered as escaped text — a "black box" of raw
|
|
9
|
-
* markup instead of the intended HTML.
|
|
10
|
-
*
|
|
11
|
-
* This hook detects that case in the token stream and reclassifies the
|
|
12
|
-
* misparsed code token back to an html token so it renders. To stay precise it
|
|
13
|
-
* only fires when the code token is ALL of:
|
|
14
|
-
* - an indented code block (no `lang` → not a fenced ``` example),
|
|
15
|
-
* - whose content starts with an HTML tag or comment, and
|
|
16
|
-
* - directly adjacent to an `html` token (the signature of a split block).
|
|
17
|
-
* Prose, fenced code examples, and standalone indented code are left untouched.
|
|
18
|
-
*/
|
|
19
|
-
export declare function createHtmlBlockRepairExtension(): MarkedExtension;
|
|
20
|
-
//# sourceMappingURL=html-block-repair.extension.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"html-block-repair.extension.d.ts","sourceRoot":"","sources":["../../../src/lib/extensions/html-block-repair.extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,QAAQ,CAAC;AAExD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,8BAA8B,IAAI,eAAe,CAuBhE"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates a marked extension that repairs HTML blocks split by a blank line.
|
|
3
|
-
*
|
|
4
|
-
* Raw HTML embedded in markdown (e.g. a Skip PRD "## Mockup" section) is meant
|
|
5
|
-
* to be a single HTML block, but CommonMark ends an HTML block at the first
|
|
6
|
-
* blank line. Any following indented (4+ space) markup is then tokenized as an
|
|
7
|
-
* indented code block and rendered as escaped text — a "black box" of raw
|
|
8
|
-
* markup instead of the intended HTML.
|
|
9
|
-
*
|
|
10
|
-
* This hook detects that case in the token stream and reclassifies the
|
|
11
|
-
* misparsed code token back to an html token so it renders. To stay precise it
|
|
12
|
-
* only fires when the code token is ALL of:
|
|
13
|
-
* - an indented code block (no `lang` → not a fenced ``` example),
|
|
14
|
-
* - whose content starts with an HTML tag or comment, and
|
|
15
|
-
* - directly adjacent to an `html` token (the signature of a split block).
|
|
16
|
-
* Prose, fenced code examples, and standalone indented code are left untouched.
|
|
17
|
-
*/
|
|
18
|
-
export function createHtmlBlockRepairExtension() {
|
|
19
|
-
const looksLikeHtml = (text) => /^\s*<\/?[a-zA-Z!]/.test(text || '');
|
|
20
|
-
return {
|
|
21
|
-
hooks: {
|
|
22
|
-
processAllTokens(tokens) {
|
|
23
|
-
for (let i = 0; i < tokens.length; i++) {
|
|
24
|
-
const token = tokens[i];
|
|
25
|
-
if (token.type !== 'code')
|
|
26
|
-
continue;
|
|
27
|
-
const code = token;
|
|
28
|
-
if (code.lang || !looksLikeHtml(code.text))
|
|
29
|
-
continue;
|
|
30
|
-
const prev = tokens[i - 1];
|
|
31
|
-
const next = tokens[i + 1];
|
|
32
|
-
if (prev?.type === 'html' || next?.type === 'html') {
|
|
33
|
-
// Reclassify as a raw HTML block so the html renderer emits it verbatim.
|
|
34
|
-
const html = { type: 'html', raw: code.raw, pre: false, text: code.text, block: true };
|
|
35
|
-
tokens[i] = html;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return tokens;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=html-block-repair.extension.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"html-block-repair.extension.js","sourceRoot":"","sources":["../../../src/lib/extensions/html-block-repair.extension.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,8BAA8B;IAC5C,MAAM,aAAa,GAAG,CAAC,IAAY,EAAW,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IACtF,OAAO;QACL,KAAK,EAAE;YACL,gBAAgB,CAAC,MAAe;gBAC9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBACvC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;oBACxB,IAAI,KAAK,CAAC,IAAI,KAAK,MAAM;wBAAE,SAAS;oBACpC,MAAM,IAAI,GAAG,KAAoB,CAAC;oBAClC,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC;wBAAE,SAAS;oBAErD,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;oBAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;oBAC3B,IAAI,IAAI,EAAE,IAAI,KAAK,MAAM,IAAI,IAAI,EAAE,IAAI,KAAK,MAAM,EAAE,CAAC;wBACnD,yEAAyE;wBACzE,MAAM,IAAI,GAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;wBACpG,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;oBACnB,CAAC;gBACH,CAAC;gBACD,OAAO,MAAM,CAAC;YAChB,CAAC;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { MarkedExtension, Token, Tokens } from 'marked';\n\n/**\n * Creates a marked extension that repairs HTML blocks split by a blank line.\n *\n * Raw HTML embedded in markdown (e.g. a Skip PRD \"## Mockup\" section) is meant\n * to be a single HTML block, but CommonMark ends an HTML block at the first\n * blank line. Any following indented (4+ space) markup is then tokenized as an\n * indented code block and rendered as escaped text — a \"black box\" of raw\n * markup instead of the intended HTML.\n *\n * This hook detects that case in the token stream and reclassifies the\n * misparsed code token back to an html token so it renders. To stay precise it\n * only fires when the code token is ALL of:\n * - an indented code block (no `lang` → not a fenced ``` example),\n * - whose content starts with an HTML tag or comment, and\n * - directly adjacent to an `html` token (the signature of a split block).\n * Prose, fenced code examples, and standalone indented code are left untouched.\n */\nexport function createHtmlBlockRepairExtension(): MarkedExtension {\n const looksLikeHtml = (text: string): boolean => /^\\s*<\\/?[a-zA-Z!]/.test(text || '');\n return {\n hooks: {\n processAllTokens(tokens: Token[]): Token[] {\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n if (token.type !== 'code') continue;\n const code = token as Tokens.Code;\n if (code.lang || !looksLikeHtml(code.text)) continue;\n\n const prev = tokens[i - 1];\n const next = tokens[i + 1];\n if (prev?.type === 'html' || next?.type === 'html') {\n // Reclassify as a raw HTML block so the html renderer emits it verbatim.\n const html: Tokens.HTML = { type: 'html', raw: code.raw, pre: false, text: code.text, block: true };\n tokens[i] = html;\n }\n }\n return tokens;\n }\n }\n };\n}\n"]}
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration options for the markdown component
|
|
3
|
-
*/
|
|
4
|
-
export interface MarkdownConfig {
|
|
5
|
-
/**
|
|
6
|
-
* Enable Prism.js syntax highlighting for code blocks
|
|
7
|
-
* @default true
|
|
8
|
-
*/
|
|
9
|
-
enableHighlight?: boolean;
|
|
10
|
-
/**
|
|
11
|
-
* Enable Mermaid diagram rendering
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
enableMermaid?: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Enable copy-to-clipboard button on code blocks
|
|
17
|
-
* @default true
|
|
18
|
-
*/
|
|
19
|
-
enableCodeCopy?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Enable collapsible heading sections
|
|
22
|
-
* @default false
|
|
23
|
-
*/
|
|
24
|
-
enableCollapsibleHeadings?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Heading level at which to start collapsing (1-6)
|
|
27
|
-
* Only applies when enableCollapsibleHeadings is true
|
|
28
|
-
* @default 2
|
|
29
|
-
*/
|
|
30
|
-
collapsibleHeadingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
31
|
-
/**
|
|
32
|
-
* Whether collapsible sections should be expanded by default
|
|
33
|
-
* @default true
|
|
34
|
-
*/
|
|
35
|
-
collapsibleDefaultExpanded?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Specify which heading levels should start expanded.
|
|
38
|
-
* Array of heading levels (2-6) that should be expanded by default.
|
|
39
|
-
* Takes precedence over collapsibleDefaultExpanded for specified levels.
|
|
40
|
-
*
|
|
41
|
-
* Examples:
|
|
42
|
-
* - [2] = Only h2 expanded, h3-h6 collapsed
|
|
43
|
-
* - [2, 3] = h2 and h3 expanded, h4-h6 collapsed
|
|
44
|
-
* - [] = All collapsed (same as collapsibleDefaultExpanded: false)
|
|
45
|
-
* - undefined = Uses collapsibleDefaultExpanded for all levels
|
|
46
|
-
*
|
|
47
|
-
* @default undefined (uses collapsibleDefaultExpanded)
|
|
48
|
-
*/
|
|
49
|
-
autoExpandLevels?: number[];
|
|
50
|
-
/**
|
|
51
|
-
* Enable GitHub-style alerts ([!NOTE], [!WARNING], etc.)
|
|
52
|
-
* @default true
|
|
53
|
-
*/
|
|
54
|
-
enableAlerts?: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Enable smartypants for typography (curly quotes, em/en dashes, ellipses)
|
|
57
|
-
* Converts:
|
|
58
|
-
* - "quotes" to "curly quotes"
|
|
59
|
-
* - -- to en-dash (–)
|
|
60
|
-
* - --- to em-dash (—)
|
|
61
|
-
* - ... to ellipsis (…)
|
|
62
|
-
* @default true
|
|
63
|
-
*/
|
|
64
|
-
enableSmartypants?: boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Enable SVG code block rendering
|
|
67
|
-
* When enabled, ```svg code blocks are rendered as actual SVG images
|
|
68
|
-
* @default true
|
|
69
|
-
*/
|
|
70
|
-
enableSvgRenderer?: boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Enable raw HTML passthrough in markdown content.
|
|
73
|
-
* When enabled, HTML tags in the markdown are rendered as actual HTML
|
|
74
|
-
* instead of being sanitized/stripped.
|
|
75
|
-
*
|
|
76
|
-
* Note: Even with enableHtml=true, scripts and event handlers are stripped
|
|
77
|
-
* unless enableJavaScript is also true.
|
|
78
|
-
*
|
|
79
|
-
* @default false
|
|
80
|
-
*/
|
|
81
|
-
enableHtml?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Enable JavaScript execution in HTML content.
|
|
84
|
-
* When enabled, <script> tags and on* event handlers are allowed.
|
|
85
|
-
*
|
|
86
|
-
* WARNING: This is a major security risk. Only enable for fully trusted content.
|
|
87
|
-
* In most cases, you want enableHtml=true with enableJavaScript=false.
|
|
88
|
-
*
|
|
89
|
-
* @default false
|
|
90
|
-
*/
|
|
91
|
-
enableJavaScript?: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Enable GitHub-style heading IDs for anchor links
|
|
94
|
-
* @default true
|
|
95
|
-
*/
|
|
96
|
-
enableHeadingIds?: boolean;
|
|
97
|
-
/**
|
|
98
|
-
* Prefix for heading IDs to avoid conflicts
|
|
99
|
-
* @default ''
|
|
100
|
-
*/
|
|
101
|
-
headingIdPrefix?: string;
|
|
102
|
-
/**
|
|
103
|
-
* Enable line numbers in code blocks
|
|
104
|
-
* @default false
|
|
105
|
-
*/
|
|
106
|
-
enableLineNumbers?: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Custom CSS class to apply to the markdown container
|
|
109
|
-
*/
|
|
110
|
-
containerClass?: string;
|
|
111
|
-
/**
|
|
112
|
-
* Prism.js theme to use (must be loaded in angular.json or via CSS import)
|
|
113
|
-
* Common themes: 'prism', 'prism-dark', 'prism-okaidia', 'prism-tomorrow', 'prism-coy'
|
|
114
|
-
*/
|
|
115
|
-
prismTheme?: string;
|
|
116
|
-
/**
|
|
117
|
-
* Mermaid theme configuration.
|
|
118
|
-
* 'auto' (default) detects light/dark from the document's data-theme attribute
|
|
119
|
-
* and maps to mermaid's 'default' (light) or 'dark' theme accordingly.
|
|
120
|
-
* @default 'auto'
|
|
121
|
-
*/
|
|
122
|
-
mermaidTheme?: 'auto' | 'default' | 'dark' | 'forest' | 'neutral' | 'base';
|
|
123
|
-
/**
|
|
124
|
-
* Whether to sanitize HTML output
|
|
125
|
-
* Set to false only if you trust the markdown source completely
|
|
126
|
-
* @default true
|
|
127
|
-
*/
|
|
128
|
-
sanitize?: boolean;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Default configuration values
|
|
132
|
-
*/
|
|
133
|
-
export declare const DEFAULT_MARKDOWN_CONFIG: Required<Omit<MarkdownConfig, 'autoExpandLevels'>> & {
|
|
134
|
-
autoExpandLevels?: number[];
|
|
135
|
-
};
|
|
136
|
-
/**
|
|
137
|
-
* Event emitted when markdown rendering is complete
|
|
138
|
-
*/
|
|
139
|
-
export interface MarkdownRenderEvent {
|
|
140
|
-
/**
|
|
141
|
-
* The rendered HTML string
|
|
142
|
-
*/
|
|
143
|
-
html: string;
|
|
144
|
-
/**
|
|
145
|
-
* Time taken to render in milliseconds
|
|
146
|
-
*/
|
|
147
|
-
renderTime: number;
|
|
148
|
-
/**
|
|
149
|
-
* Whether mermaid diagrams were rendered
|
|
150
|
-
*/
|
|
151
|
-
hasMermaid: boolean;
|
|
152
|
-
/**
|
|
153
|
-
* Whether code blocks were highlighted
|
|
154
|
-
*/
|
|
155
|
-
hasCodeBlocks: boolean;
|
|
156
|
-
/**
|
|
157
|
-
* List of heading IDs generated (for TOC building)
|
|
158
|
-
*/
|
|
159
|
-
headingIds: HeadingInfo[];
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Information about a heading in the document
|
|
163
|
-
*/
|
|
164
|
-
export interface HeadingInfo {
|
|
165
|
-
/**
|
|
166
|
-
* The heading ID (for anchor links)
|
|
167
|
-
*/
|
|
168
|
-
id: string;
|
|
169
|
-
/**
|
|
170
|
-
* The heading text content
|
|
171
|
-
*/
|
|
172
|
-
text: string;
|
|
173
|
-
/**
|
|
174
|
-
* The heading level (1-6)
|
|
175
|
-
*/
|
|
176
|
-
level: number;
|
|
177
|
-
/**
|
|
178
|
-
* The raw markdown text
|
|
179
|
-
*/
|
|
180
|
-
raw: string;
|
|
181
|
-
}
|
|
182
|
-
/**
|
|
183
|
-
* Alert types supported by marked-alert
|
|
184
|
-
*/
|
|
185
|
-
export type AlertType = 'note' | 'tip' | 'important' | 'warning' | 'caution';
|
|
186
|
-
/**
|
|
187
|
-
* Configuration for a custom alert variant
|
|
188
|
-
*/
|
|
189
|
-
export interface AlertVariant {
|
|
190
|
-
type: string;
|
|
191
|
-
icon: string;
|
|
192
|
-
titleClassName?: string;
|
|
193
|
-
}
|
|
194
|
-
//# sourceMappingURL=markdown.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.types.d.ts","sourceRoot":"","sources":["../../../src/lib/types/markdown.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAEpC;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAEhD;;;OAGG;IACH,0BAA0B,CAAC,EAAE,OAAO,CAAC;IAErC;;;;;;;;;;;;OAYG;IACH,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AAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;AAE7E;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Default configuration values
|
|
3
|
-
*/
|
|
4
|
-
export const DEFAULT_MARKDOWN_CONFIG = {
|
|
5
|
-
enableHighlight: true,
|
|
6
|
-
enableMermaid: true,
|
|
7
|
-
enableCodeCopy: true,
|
|
8
|
-
enableCollapsibleHeadings: false,
|
|
9
|
-
collapsibleHeadingLevel: 2,
|
|
10
|
-
collapsibleDefaultExpanded: true,
|
|
11
|
-
autoExpandLevels: undefined,
|
|
12
|
-
enableAlerts: true,
|
|
13
|
-
enableSmartypants: true,
|
|
14
|
-
enableSvgRenderer: true,
|
|
15
|
-
enableHtml: false,
|
|
16
|
-
enableJavaScript: false,
|
|
17
|
-
enableHeadingIds: true,
|
|
18
|
-
headingIdPrefix: '',
|
|
19
|
-
enableLineNumbers: false,
|
|
20
|
-
containerClass: '',
|
|
21
|
-
prismTheme: 'prism-okaidia',
|
|
22
|
-
mermaidTheme: 'auto',
|
|
23
|
-
sanitize: true
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=markdown.types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.types.js","sourceRoot":"","sources":["../../../src/lib/types/markdown.types.ts"],"names":[],"mappings":"AAoJA;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAyF;IAC3H,eAAe,EAAE,IAAI;IACrB,aAAa,EAAE,IAAI;IACnB,cAAc,EAAE,IAAI;IACpB,yBAAyB,EAAE,KAAK;IAChC,uBAAuB,EAAE,CAAC;IAC1B,0BAA0B,EAAE,IAAI;IAChC,gBAAgB,EAAE,SAAS;IAC3B,YAAY,EAAE,IAAI;IAClB,iBAAiB,EAAE,IAAI;IACvB,iBAAiB,EAAE,IAAI;IACvB,UAAU,EAAE,KAAK;IACjB,gBAAgB,EAAE,KAAK;IACvB,gBAAgB,EAAE,IAAI;IACtB,eAAe,EAAE,EAAE;IACnB,iBAAiB,EAAE,KAAK;IACxB,cAAc,EAAE,EAAE;IAClB,UAAU,EAAE,eAAe;IAC3B,YAAY,EAAE,MAAM;IACpB,QAAQ,EAAE,IAAI;CACf,CAAC","sourcesContent":["/**\n * Configuration options for the markdown component\n */\nexport interface MarkdownConfig {\n /**\n * Enable Prism.js syntax highlighting for code blocks\n * @default true\n */\n enableHighlight?: boolean;\n\n /**\n * Enable Mermaid diagram rendering\n * @default true\n */\n enableMermaid?: boolean;\n\n /**\n * Enable copy-to-clipboard button on code blocks\n * @default true\n */\n enableCodeCopy?: boolean;\n\n /**\n * Enable collapsible heading sections\n * @default false\n */\n enableCollapsibleHeadings?: boolean;\n\n /**\n * Heading level at which to start collapsing (1-6)\n * Only applies when enableCollapsibleHeadings is true\n * @default 2\n */\n collapsibleHeadingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n\n /**\n * Whether collapsible sections should be expanded by default\n * @default true\n */\n collapsibleDefaultExpanded?: boolean;\n\n /**\n * Specify which heading levels should start expanded.\n * Array of heading levels (2-6) that should be expanded by default.\n * Takes precedence over collapsibleDefaultExpanded for specified levels.\n *\n * Examples:\n * - [2] = Only h2 expanded, h3-h6 collapsed\n * - [2, 3] = h2 and h3 expanded, h4-h6 collapsed\n * - [] = All collapsed (same as collapsibleDefaultExpanded: false)\n * - undefined = Uses collapsibleDefaultExpanded for all levels\n *\n * @default undefined (uses collapsibleDefaultExpanded)\n */\n autoExpandLevels?: number[];\n\n /**\n * Enable GitHub-style alerts ([!NOTE], [!WARNING], etc.)\n * @default true\n */\n enableAlerts?: boolean;\n\n /**\n * Enable smartypants for typography (curly quotes, em/en dashes, ellipses)\n * Converts:\n * - \"quotes\" to \"curly quotes\"\n * - -- to en-dash (–)\n * - --- to em-dash (—)\n * - ... to ellipsis (…)\n * @default true\n */\n enableSmartypants?: boolean;\n\n /**\n * Enable SVG code block rendering\n * When enabled, ```svg code blocks are rendered as actual SVG images\n * @default true\n */\n enableSvgRenderer?: boolean;\n\n /**\n * Enable raw HTML passthrough in markdown content.\n * When enabled, HTML tags in the markdown are rendered as actual HTML\n * instead of being sanitized/stripped.\n *\n * Note: Even with enableHtml=true, scripts and event handlers are stripped\n * unless enableJavaScript is also true.\n *\n * @default false\n */\n enableHtml?: boolean;\n\n /**\n * Enable JavaScript execution in HTML content.\n * When enabled, <script> tags and on* event handlers are allowed.\n *\n * WARNING: This is a major security risk. Only enable for fully trusted content.\n * In most cases, you want enableHtml=true with enableJavaScript=false.\n *\n * @default false\n */\n enableJavaScript?: boolean;\n\n /**\n * Enable GitHub-style heading IDs for anchor links\n * @default true\n */\n enableHeadingIds?: boolean;\n\n /**\n * Prefix for heading IDs to avoid conflicts\n * @default ''\n */\n headingIdPrefix?: string;\n\n /**\n * Enable line numbers in code blocks\n * @default false\n */\n enableLineNumbers?: boolean;\n\n /**\n * Custom CSS class to apply to the markdown container\n */\n containerClass?: string;\n\n /**\n * Prism.js theme to use (must be loaded in angular.json or via CSS import)\n * Common themes: 'prism', 'prism-dark', 'prism-okaidia', 'prism-tomorrow', 'prism-coy'\n */\n prismTheme?: string;\n\n /**\n * Mermaid theme configuration.\n * 'auto' (default) detects light/dark from the document's data-theme attribute\n * and maps to mermaid's 'default' (light) or 'dark' theme accordingly.\n * @default 'auto'\n */\n mermaidTheme?: 'auto' | 'default' | 'dark' | 'forest' | 'neutral' | 'base';\n\n /**\n * Whether to sanitize HTML output\n * Set to false only if you trust the markdown source completely\n * @default true\n */\n sanitize?: boolean;\n}\n\n/**\n * Default configuration values\n */\nexport const DEFAULT_MARKDOWN_CONFIG: Required<Omit<MarkdownConfig, 'autoExpandLevels'>> & { autoExpandLevels?: number[] } = {\n enableHighlight: true,\n enableMermaid: true,\n enableCodeCopy: true,\n enableCollapsibleHeadings: false,\n collapsibleHeadingLevel: 2,\n collapsibleDefaultExpanded: true,\n autoExpandLevels: undefined,\n enableAlerts: true,\n enableSmartypants: true,\n enableSvgRenderer: true,\n enableHtml: false,\n enableJavaScript: false,\n enableHeadingIds: true,\n headingIdPrefix: '',\n enableLineNumbers: false,\n containerClass: '',\n prismTheme: 'prism-okaidia',\n mermaidTheme: 'auto',\n sanitize: true\n};\n\n/**\n * Event emitted when markdown rendering is complete\n */\nexport interface MarkdownRenderEvent {\n /**\n * The rendered HTML string\n */\n html: string;\n\n /**\n * Time taken to render in milliseconds\n */\n renderTime: number;\n\n /**\n * Whether mermaid diagrams were rendered\n */\n hasMermaid: boolean;\n\n /**\n * Whether code blocks were highlighted\n */\n hasCodeBlocks: boolean;\n\n /**\n * List of heading IDs generated (for TOC building)\n */\n headingIds: HeadingInfo[];\n}\n\n/**\n * Information about a heading in the document\n */\nexport interface HeadingInfo {\n /**\n * The heading ID (for anchor links)\n */\n id: string;\n\n /**\n * The heading text content\n */\n text: string;\n\n /**\n * The heading level (1-6)\n */\n level: number;\n\n /**\n * The raw markdown text\n */\n raw: string;\n}\n\n/**\n * Alert types supported by marked-alert\n */\nexport type AlertType = 'note' | 'tip' | 'important' | 'warning' | 'caution';\n\n/**\n * Configuration for a custom alert variant\n */\nexport interface AlertVariant {\n type: string;\n icon: string;\n titleClassName?: string;\n}\n"]}
|