@ones-editor/editor 3.0.4-beta.1 → 3.0.4-beta.2
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,8 +1,10 @@
|
|
|
1
|
-
import { DocObject } from '../../../@ones-editor/core';
|
|
1
|
+
import { DocBlockText, DocBlockTextAttributes, DocObject } from '../../../@ones-editor/core';
|
|
2
2
|
import './types/marked-extended-latex.d';
|
|
3
|
+
import { CustomTagToken } from './custom/tag';
|
|
3
4
|
export { getBlocksWidth } from './tokens/block-tokens/table';
|
|
4
5
|
interface MarkdownToDocOptions {
|
|
5
6
|
font?: string | Element;
|
|
6
7
|
htmlToDoc?: (html: string) => DocObject | null;
|
|
8
|
+
customTagProcess?: (token: CustomTagToken, attributes: DocBlockTextAttributes) => DocBlockText | null | undefined;
|
|
7
9
|
}
|
|
8
10
|
export declare function markdownToDoc(markdown: string, options?: MarkdownToDocOptions): DocObject | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { marked } from 'marked';
|
|
2
2
|
import { DocBlock, DocBlockText, DocBlockTextAttributes, DocObject } from '../../../../@ones-editor/core';
|
|
3
|
+
import { CustomTagToken } from '../custom/tag';
|
|
3
4
|
export type TextAndChildren = {
|
|
4
5
|
text: DocBlockText;
|
|
5
6
|
children: DocBlock[];
|
|
@@ -7,6 +8,7 @@ export type TextAndChildren = {
|
|
|
7
8
|
export type TokensToText = (tokens: marked.Token[], attributes: DocBlockTextAttributes, options: TokenToBlockOptions) => DocBlockText;
|
|
8
9
|
export type TokensToBlocks = (tokens: marked.Token[], options: TokenToBlockOptions) => DocBlock[];
|
|
9
10
|
export type TokensToTextWithChildren = (tokens: marked.Token[], options: TokenToBlockOptions) => TextAndChildren;
|
|
11
|
+
export type CustomTagProcess = (token: CustomTagToken, attributes: DocBlockTextAttributes) => DocBlockText | null | undefined;
|
|
10
12
|
export type HtmlToDoc = (html: string) => DocObject | null;
|
|
11
13
|
export type TokenToBlockOptions = {
|
|
12
14
|
font?: string | Element;
|
|
@@ -16,4 +18,5 @@ export type TokenToBlockOptions = {
|
|
|
16
18
|
tokensToTextWithChildren: TokensToTextWithChildren;
|
|
17
19
|
htmlToDoc?: HtmlToDoc;
|
|
18
20
|
listLevel: number;
|
|
21
|
+
customTagProcess?: CustomTagProcess;
|
|
19
22
|
};
|