From 536ca039cbae6025ae210231cdc149430be09b4e Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Tue, 23 Nov 2021 11:50:48 +0100 Subject: Update editor --- editor/actions/of_markdown.ml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'editor/actions') diff --git a/editor/actions/of_markdown.ml b/editor/actions/of_markdown.ml index 580c6c4..88f7c00 100755 --- a/editor/actions/of_markdown.ml +++ b/editor/actions/of_markdown.ml @@ -103,8 +103,11 @@ module FromMarkdown = struct (Js.some attrs') in parse_inline_content view pm marks link_attrs.label - | _ -> + | Hard_break (_) + | Soft_break (_) (* TODO Handle Break *) + | Image (_, _) + | Html (_, _) -> Brr.Console.(log [Jstr.v "Other"]); new%js Js.array_empty @@ -203,12 +206,17 @@ module FromMarkdown = struct (Js.null) in Some node - | _ -> + | Code_block(_, _, _) + (* TODO *) + -> None + | Html_block(_, _) + | Definition_list(_, _) + -> Brr.Console.(log [Jstr.v "Other block"]); None let parse - : Prosemirror.View.editor_view Js.t -> PM.t -> Omd.doc -> unit + : Prosemirror.View.editor_view Js.t -> PM.t -> Omd.doc -> Prosemirror.Model.node Js.t = fun view pm doc -> Brr.Console.( log [ doc ]); (* Transform each node inside the markdown document and add them into the @@ -225,12 +233,12 @@ module FromMarkdown = struct (Js.null) (Js.some fragment) (Js.null) in - Brr.Console.(log [ document ]) + Brr.Console.(log [ document ]); + document let update : t -> State.t -> State.t = fun (pm, doc) state -> - let () = parse state.State.view pm doc in + let _ = parse state.State.view pm doc in state end - -- cgit v1.2.3