Skip to content

Commit fcbf4da

Browse files
authored
Merge pull request #64 from yandex-cloud/parser-serializer-props
feat(core): add getters for parser and serializer instances
2 parents e6a8320 + 190384b commit fcbf4da

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/core/Editor.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type {CommonEditor, ContentHandler, MarkupString} from '../common';
55
import type {Extension} from './types/extension';
66
import {bindActions} from './utils/actions';
77
import type {Serializer} from './types/serializer';
8+
import type {Parser} from './types/parser';
89
import {ExtensionsManager} from './ExtensionsManager';
910
import type {ActionStorage} from './types/actions';
1011
import type {ActionsManager} from './ActionsManager';
@@ -35,13 +36,22 @@ export type YfmEditorOptions = {
3536
export class YfmEditor implements CommonEditor, ActionStorage {
3637
#view: EditorView;
3738
#serializer: Serializer;
39+
#parser: Parser;
3840
#actions: ActionsManager;
3941
#contentHandler: ContentHandler;
4042

4143
get dom() {
4244
return this.#view.dom;
4345
}
4446

47+
get serializer() {
48+
return this.#serializer;
49+
}
50+
51+
get parser() {
52+
return this.#parser;
53+
}
54+
4555
get actions() {
4656
return this.#actions.actions;
4757
}
@@ -97,6 +107,7 @@ export class YfmEditor implements CommonEditor, ActionStorage {
97107
bindActions<keyof YfmEditor.Actions>(rawActions)(this.#view) as YfmEditor.Actions,
98108
);
99109
this.#serializer = serializer;
110+
this.#parser = parser;
100111
this.#contentHandler = new WysiwygContentHandler(this.#view, parser);
101112
}
102113

0 commit comments

Comments
 (0)