@@ -22,6 +22,7 @@ import type {FileUploadHandler} from '../utils/upload';
2222import type {
2323 MarkdownEditorMode as EditorMode ,
2424 MarkdownEditorPreset as EditorPreset ,
25+ MarkdownEditorMdOptions ,
2526 MarkdownEditorOptions ,
2627 MarkdownEditorMarkupConfig as MarkupConfig ,
2728 RenderPreview ,
@@ -77,6 +78,7 @@ export interface EditorInt
7778 readonly splitModeEnabled : boolean ;
7879 readonly splitMode : SplitMode ;
7980 readonly preset : EditorPreset ;
81+ readonly mdOptions : Readonly < MarkdownEditorMdOptions > ;
8082
8183 /** @internal used in demo for dev-tools */
8284 readonly _wysiwygView ?: PMEditorView ;
@@ -132,11 +134,9 @@ export class EditorImpl extends SafeEventEmitter<EventMapInt> implements EditorI
132134 #markupEditor?: MarkupEditor ;
133135 #markupConfig: MarkupConfig ;
134136 #escapeConfig?: EscapeConfig ;
137+ #mdOptions: Readonly < MarkdownEditorMdOptions > ;
135138
136139 readonly #preset: EditorPreset ;
137- #allowHTML?: boolean ;
138- #linkify?: boolean ;
139- #linkifyTlds?: string | string [ ] ;
140140 #extensions?: WysiwygEditorOptions [ 'extensions' ] ;
141141 #renderStorage: ReactRenderStorage ;
142142 #fileUploadHandler?: FileUploadHandler ;
@@ -209,6 +209,10 @@ export class EditorImpl extends SafeEventEmitter<EventMapInt> implements EditorI
209209 return this . #preset;
210210 }
211211
212+ get mdOptions ( ) : Readonly < MarkdownEditorMdOptions > {
213+ return this . #mdOptions;
214+ }
215+
212216 get renderPreview ( ) : RenderPreview | undefined {
213217 return this . #renderPreview;
214218 }
@@ -233,9 +237,9 @@ export class EditorImpl extends SafeEventEmitter<EventMapInt> implements EditorI
233237 mdPreset,
234238 initialContent : this . #markup,
235239 extensions : this . #extensions,
236- allowHTML : this . #allowHTML ,
237- linkify : this . #linkify,
238- linkifyTlds : this . #linkifyTlds,
240+ allowHTML : this . #mdOptions . html ,
241+ linkify : this . #mdOptions . linkify ,
242+ linkifyTlds : this . #mdOptions . linkifyTlds ,
239243 escapeConfig : this . #escapeConfig,
240244 onChange : ( ) => this . emit ( 'rerender-toolbar' , null ) ,
241245 onDocChange : ( ) => this . emit ( 'change' , null ) ,
@@ -303,9 +307,7 @@ export class EditorImpl extends SafeEventEmitter<EventMapInt> implements EditorI
303307 this . #markup = initial . markup ?? '' ;
304308
305309 this . #preset = opts . preset ?? 'full' ;
306- this . #linkify = md . linkify ;
307- this . #linkifyTlds = md . linkifyTlds ;
308- this . #allowHTML = md . html ;
310+ this . #mdOptions = md ;
309311 this . #extensions = wysiwygConfig . extensions ;
310312 this . #markupConfig = { ...opts . markupConfig } ;
311313
0 commit comments