Skip to content

Commit

Permalink
Add Empty inline (#298)
Browse files Browse the repository at this point in the history
Co-authored-by: Cuihtlauac ALVARADO <cuihtmlauac@tarides.com>
  • Loading branch information
cuihtlauac and Cuihtlauac ALVARADO authored Feb 14, 2023
1 parent 2c6b1ad commit 0c224ce
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/ast_constructors.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ module type Intf = sig

(** {3 Constructors for inline elements} *)

val empty : attributes inline
(** [empty] is an empty inline element. *)

val txt : ?attrs:attributes -> string -> attributes inline
(** [txt ~attrs s] is {{!Text} [Text (attrs, s)]}. *)

Expand Down Expand Up @@ -170,6 +173,7 @@ end

module Impl : Intf = struct
let concat elems = Concat ([], elems)
let empty = concat []
let txt ?(attrs = []) s = Text (attrs, s)
let em ?(attrs = []) s = Emph (attrs, txt s)
let strong ?(attrs = []) s = Strong (attrs, txt s)
Expand Down

0 comments on commit 0c224ce

Please sign in to comment.