summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2021-11-23 11:50:48 +0100
committerSébastien Dailly <sebastien@dailly.me>2022-02-07 16:43:33 +0100
commit536ca039cbae6025ae210231cdc149430be09b4e (patch)
tree4f2a1227d405f3231d29bc94d83192771e75aa3c
parentda1d9ad1c49f31fc9031fd1bc6661dad3600e40c (diff)
Update editor
-rwxr-xr-xeditor/actions/of_markdown.ml20
1 files changed, 14 insertions, 6 deletions
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
-