@opensumi/ide-core-browser 3.8.3-next-1747205448.0 → 3.8.3-next-1747205573.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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/markdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAkD,MAAM,oCAAoC,CAAC;AAGpH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/markdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,cAAc,EAAkD,MAAM,oCAAoC,CAAC;AAGpH,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAI3C,eAAO,MAAM,UAAU,YACZ,MAAM,GAAG,KAAK,CAAC,SAAS,WACxB,cAAc,YACb,cAAc,mBACP,OAAO,KACvB,KAAK,CAAC,SAUR,CAAC;AAEF,eAAO,MAAM,cAAc,YAAa,MAAM,YAAY,cAAc,KAAG,MAe1E,CAAC"}
|
package/lib/markdown/index.js
CHANGED
|
@@ -15,16 +15,15 @@ const toMarkdown = (content, opener, options, justUseContent) => {
|
|
|
15
15
|
exports.toMarkdown = toMarkdown;
|
|
16
16
|
const toMarkdownHtml = (message, options) => {
|
|
17
17
|
const renderer = (0, utils_1.createMarkedRenderer)();
|
|
18
|
-
renderer.link = (href, title, text) => `<a rel="noopener" ${render_1.DATA_SET_COMMAND}="${href}" href="javascript:void(0)" title="${title}">${text}</a>`;
|
|
19
|
-
|
|
18
|
+
renderer.link = ({ href, title, text }) => `<a rel="noopener" ${render_1.DATA_SET_COMMAND}="${href}" href="javascript:void(0)" title="${title || ''}">${text}</a>`;
|
|
19
|
+
const result = (0, utils_1.toMarkdownHtml)(message, {
|
|
20
20
|
gfm: true,
|
|
21
21
|
breaks: false,
|
|
22
22
|
pedantic: false,
|
|
23
|
-
smartLists: true,
|
|
24
|
-
smartypants: false,
|
|
25
23
|
renderer,
|
|
26
24
|
...(options || {}),
|
|
27
25
|
});
|
|
26
|
+
return typeof result === 'string' ? result : '';
|
|
28
27
|
};
|
|
29
28
|
exports.toMarkdownHtml = toMarkdownHtml;
|
|
30
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/markdown/index.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,yEAA+F;AAC/F,8DAAoH;AACpH,+DAAqD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/markdown/index.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,yEAA+F;AAC/F,8DAAoH;AACpH,+DAAqD;AAM9C,MAAM,UAAU,GAAG,CACxB,OAAiC,EACjC,MAAuB,EACvB,OAAwB,EACxB,cAAwB,EACP,EAAE;IACnB,IAAI,cAAc,IAAI,OAAO,IAAI,IAAA,0BAAQ,EAAC,OAAO,CAAC,EAAE,CAAC;QACnD,OAAO,8BAAC,sBAAa,IAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAkB,CAAC;IACxE,CAAC;IAED,OAAO,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,CACnC,8BAAC,sBAAa,IAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAA,sBAAc,EAAC,OAAO,EAAE,OAAO,CAAC,GAAkB,CACxF,CAAC,CAAC,CAAC,CACF,OAAO,CACR,CAAC;AACJ,CAAC,CAAC;AAfW,QAAA,UAAU,cAerB;AAEK,MAAM,cAAc,GAAG,CAAC,OAAe,EAAE,OAAwB,EAAU,EAAE;IAClF,MAAM,QAAQ,GAAG,IAAA,4BAAoB,GAAE,CAAC;IAExC,QAAQ,CAAC,IAAI,GAAG,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAe,EAAU,EAAE,CAC7D,qBAAqB,yBAAgB,KAAK,IAAI,sCAAsC,KAAK,IAAI,EAAE,KAAK,IAAI,MAAM,CAAC;IAEjH,MAAM,MAAM,GAAG,IAAA,sBAAM,EAAC,OAAO,EAAE;QAC7B,GAAG,EAAE,IAAI;QACT,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,KAAK;QACf,QAAQ;QACR,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;KACnB,CAAC,CAAC;IAEH,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;AAClD,CAAC,CAAC;AAfW,QAAA,cAAc,kBAezB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensumi/ide-core-browser",
|
|
3
|
-
"version": "3.8.3-next-
|
|
3
|
+
"version": "3.8.3-next-1747205573.0",
|
|
4
4
|
"description": "@opensumi/ide-core-browser",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"build": "tsc --build ../../configs/ts/references/tsconfig.core-browser.json"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@opensumi/ide-components": "3.8.3-next-
|
|
22
|
-
"@opensumi/ide-connection": "3.8.3-next-
|
|
23
|
-
"@opensumi/ide-core-common": "3.8.3-next-
|
|
21
|
+
"@opensumi/ide-components": "3.8.3-next-1747205573.0",
|
|
22
|
+
"@opensumi/ide-connection": "3.8.3-next-1747205573.0",
|
|
23
|
+
"@opensumi/ide-core-common": "3.8.3-next-1747205573.0",
|
|
24
24
|
"@opensumi/vscode-debugprotocol": "1.49.0-beta.1",
|
|
25
25
|
"@vscode/codicons": "0.0.35",
|
|
26
26
|
"ajv": "^6.10.0",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"react": "^18.2.0",
|
|
42
42
|
"react-dom": "^18.2.0"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "db37fc5cbfd2af8b7971c2967afefd42d048258c"
|
|
45
45
|
}
|
package/src/markdown/index.tsx
CHANGED
|
@@ -6,6 +6,8 @@ import { isString } from '@opensumi/ide-core-common';
|
|
|
6
6
|
|
|
7
7
|
import { IOpenerService } from '../opener';
|
|
8
8
|
|
|
9
|
+
import type { Tokens } from 'marked';
|
|
10
|
+
|
|
9
11
|
export const toMarkdown = (
|
|
10
12
|
content: string | React.ReactNode,
|
|
11
13
|
opener?: IOpenerService,
|
|
@@ -26,16 +28,16 @@ export const toMarkdown = (
|
|
|
26
28
|
export const toMarkdownHtml = (message: string, options?: IMarkedOptions): string => {
|
|
27
29
|
const renderer = createMarkedRenderer();
|
|
28
30
|
|
|
29
|
-
renderer.link = (href, title, text) =>
|
|
30
|
-
`<a rel="noopener" ${DATA_SET_COMMAND}="${href}" href="javascript:void(0)" title="${title}">${text}</a>`;
|
|
31
|
+
renderer.link = ({ href, title, text }: Tokens.Link): string =>
|
|
32
|
+
`<a rel="noopener" ${DATA_SET_COMMAND}="${href}" href="javascript:void(0)" title="${title || ''}">${text}</a>`;
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
const result = toHtml(message, {
|
|
33
35
|
gfm: true,
|
|
34
36
|
breaks: false,
|
|
35
37
|
pedantic: false,
|
|
36
|
-
smartLists: true,
|
|
37
|
-
smartypants: false,
|
|
38
38
|
renderer,
|
|
39
39
|
...(options || {}),
|
|
40
40
|
});
|
|
41
|
+
|
|
42
|
+
return typeof result === 'string' ? result : '';
|
|
41
43
|
};
|