@ckeditor/ckeditor5-markdown-gfm 36.0.1 → 37.0.0-alpha.1
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/package.json +14 -13
- package/src/augmentation.d.ts +10 -0
- package/src/augmentation.js +5 -0
- package/src/gfmdataprocessor.d.ts +62 -0
- package/src/html2markdown/html2markdown.d.ts +10 -0
- package/src/html2markdown/html2markdown.js +1 -1
- package/src/index.d.ts +9 -0
- package/src/index.js +1 -0
- package/src/markdown.d.ts +23 -0
- package/src/markdown.js +1 -1
- package/src/markdown2html/markdown2html.d.ts +13 -0
- package/src/markdown2html/markdown2html.js +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-markdown-gfm",
|
3
|
-
"version": "
|
3
|
+
"version": "37.0.0-alpha.1",
|
4
4
|
"description": "GitHub Flavored Markdown data processor for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -12,21 +12,21 @@
|
|
12
12
|
],
|
13
13
|
"main": "src/index.js",
|
14
14
|
"dependencies": {
|
15
|
-
"ckeditor5": "^
|
15
|
+
"ckeditor5": "^37.0.0-alpha.1",
|
16
16
|
"marked": "4.0.12",
|
17
17
|
"turndown": "^6.0.0",
|
18
18
|
"turndown-plugin-gfm": "^1.0.2"
|
19
19
|
},
|
20
20
|
"devDependencies": {
|
21
|
-
"@ckeditor/ckeditor5-basic-styles": "^
|
22
|
-
"@ckeditor/ckeditor5-code-block": "^
|
23
|
-
"@ckeditor/ckeditor5-core": "^
|
24
|
-
"@ckeditor/ckeditor5-dev-utils": "^
|
25
|
-
"@ckeditor/ckeditor5-editor-classic": "^
|
26
|
-
"@ckeditor/ckeditor5-engine": "^
|
27
|
-
"@ckeditor/ckeditor5-list": "^
|
28
|
-
"@ckeditor/ckeditor5-table": "^
|
29
|
-
"@ckeditor/ckeditor5-theme-lark": "^
|
21
|
+
"@ckeditor/ckeditor5-basic-styles": "^37.0.0-alpha.1",
|
22
|
+
"@ckeditor/ckeditor5-code-block": "^37.0.0-alpha.1",
|
23
|
+
"@ckeditor/ckeditor5-core": "^37.0.0-alpha.1",
|
24
|
+
"@ckeditor/ckeditor5-dev-utils": "^35.0.0",
|
25
|
+
"@ckeditor/ckeditor5-editor-classic": "^37.0.0-alpha.1",
|
26
|
+
"@ckeditor/ckeditor5-engine": "^37.0.0-alpha.1",
|
27
|
+
"@ckeditor/ckeditor5-list": "^37.0.0-alpha.1",
|
28
|
+
"@ckeditor/ckeditor5-table": "^37.0.0-alpha.1",
|
29
|
+
"@ckeditor/ckeditor5-theme-lark": "^37.0.0-alpha.1",
|
30
30
|
"@types/marked": "^4.0.8",
|
31
31
|
"typescript": "^4.8.4",
|
32
32
|
"webpack": "^5.58.1",
|
@@ -61,8 +61,9 @@
|
|
61
61
|
"block-elements"
|
62
62
|
],
|
63
63
|
"scripts": {
|
64
|
-
"build": "tsc -p ./tsconfig.
|
64
|
+
"build": "tsc -p ./tsconfig.json",
|
65
65
|
"postversion": "npm run build",
|
66
66
|
"dll:build": "webpack"
|
67
|
-
}
|
67
|
+
},
|
68
|
+
"types": "src/index.d.ts"
|
68
69
|
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
import type { Markdown } from './index';
|
6
|
+
declare module '@ckeditor/ckeditor5-core' {
|
7
|
+
interface PluginsMap {
|
8
|
+
[Markdown.pluginName]: Markdown;
|
9
|
+
}
|
10
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @module markdown-gfm/gfmdataprocessor
|
7
|
+
*/
|
8
|
+
import { type DataProcessor, type ViewDocument, type ViewDocumentFragment, type MatcherPattern } from 'ckeditor5/src/engine';
|
9
|
+
/**
|
10
|
+
* This data processor implementation uses GitHub Flavored Markdown as input/output data.
|
11
|
+
*
|
12
|
+
* See the {@glink features/markdown Markdown output} guide to learn more on how to enable it.
|
13
|
+
*/
|
14
|
+
export default class GFMDataProcessor implements DataProcessor {
|
15
|
+
/**
|
16
|
+
* HTML data processor used to process HTML produced by the Markdown-to-HTML converter and the other way.
|
17
|
+
*/
|
18
|
+
private _htmlDP;
|
19
|
+
/**
|
20
|
+
* Creates a new instance of the Markdown data processor class.
|
21
|
+
*/
|
22
|
+
constructor(document: ViewDocument);
|
23
|
+
/**
|
24
|
+
* Keeps the specified element in the output as HTML. This is useful if the editor contains
|
25
|
+
* features producing HTML that is not a part of the Markdown standard.
|
26
|
+
*
|
27
|
+
* By default, all HTML tags are removed.
|
28
|
+
*
|
29
|
+
* @param element The element name to be kept.
|
30
|
+
*/
|
31
|
+
keepHtml(element: keyof HTMLElementTagNameMap): void;
|
32
|
+
/**
|
33
|
+
* Converts the provided Markdown string to a view tree.
|
34
|
+
*
|
35
|
+
* @param data A Markdown string.
|
36
|
+
* @returns The converted view element.
|
37
|
+
*/
|
38
|
+
toView(data: string): ViewDocumentFragment;
|
39
|
+
/**
|
40
|
+
* Converts the provided {@link module:engine/view/documentfragment~DocumentFragment} to data format — in this
|
41
|
+
* case to a Markdown string.
|
42
|
+
*
|
43
|
+
* @returns Markdown string.
|
44
|
+
*/
|
45
|
+
toData(viewFragment: ViewDocumentFragment): string;
|
46
|
+
/**
|
47
|
+
* Registers a {@link module:engine/view/matcher~MatcherPattern} for view elements whose content should be treated as raw data
|
48
|
+
* and not processed during the conversion from Markdown to view elements.
|
49
|
+
*
|
50
|
+
* The raw data can be later accessed by a
|
51
|
+
* {@link module:engine/view/element~Element#getCustomProperty custom property of a view element} called `"$rawContent"`.
|
52
|
+
*
|
53
|
+
* @param pattern The pattern matching all view elements whose content should
|
54
|
+
* be treated as raw data.
|
55
|
+
*/
|
56
|
+
registerRawContentMatcher(pattern: MatcherPattern): void;
|
57
|
+
/**
|
58
|
+
* This method does not have any effect on the data processor result. It exists for compatibility with the
|
59
|
+
* {@link module:engine/dataprocessor/dataprocessor~DataProcessor `DataProcessor` interface}.
|
60
|
+
*/
|
61
|
+
useFillerType(): void;
|
62
|
+
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
declare const turndownService: any;
|
6
|
+
/**
|
7
|
+
* Parses HTML to a markdown.
|
8
|
+
*/
|
9
|
+
export default function html2markdown(html: string): string;
|
10
|
+
export { turndownService };
|
@@ -3,7 +3,7 @@
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
4
|
*/
|
5
5
|
/**
|
6
|
-
* @module markdown-gfm/html2markdown
|
6
|
+
* @module markdown-gfm/html2markdown/html2markdown
|
7
7
|
*/
|
8
8
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
9
9
|
// Importing types for this package is problematic, so it's omitted.
|
package/src/index.d.ts
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @module markdown-gfm
|
7
|
+
*/
|
8
|
+
export { default as Markdown } from './markdown';
|
9
|
+
import './augmentation';
|
package/src/index.js
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @module markdown-gfm/markdown
|
7
|
+
*/
|
8
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
9
|
+
/**
|
10
|
+
* The GitHub Flavored Markdown (GFM) plugin.
|
11
|
+
*
|
12
|
+
* For a detailed overview, check the {@glink features/markdown Markdown feature} guide.
|
13
|
+
*/
|
14
|
+
export default class Markdown extends Plugin {
|
15
|
+
/**
|
16
|
+
* @inheritDoc
|
17
|
+
*/
|
18
|
+
constructor(editor: Editor);
|
19
|
+
/**
|
20
|
+
* @inheritDoc
|
21
|
+
*/
|
22
|
+
static get pluginName(): 'Markdown';
|
23
|
+
}
|
package/src/markdown.js
CHANGED
@@ -10,7 +10,7 @@ import GFMDataProcessor from './gfmdataprocessor';
|
|
10
10
|
/**
|
11
11
|
* The GitHub Flavored Markdown (GFM) plugin.
|
12
12
|
*
|
13
|
-
* For a detailed overview, check the {@glink features/markdown Markdown feature
|
13
|
+
* For a detailed overview, check the {@glink features/markdown Markdown feature} guide.
|
14
14
|
*/
|
15
15
|
export default class Markdown extends Plugin {
|
16
16
|
/**
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* @module markdown-gfm/markdown2html/markdown2html
|
7
|
+
*/
|
8
|
+
import { marked } from 'marked';
|
9
|
+
/**
|
10
|
+
* Parses markdown string to an HTML.
|
11
|
+
*/
|
12
|
+
export default function markdown2html(markdown: string): string;
|
13
|
+
export { marked };
|