summaryrefslogtreecommitdiff
path: root/editor/actions/of_markdown.ml
diff options
context:
space:
mode:
Diffstat (limited to 'editor/actions/of_markdown.ml')
-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
-