diff --git a/src/lib_stdlib/jbuild b/src/lib_stdlib/jbuild index dc15fb13d..835fdc87a 100644 --- a/src/lib_stdlib/jbuild +++ b/src/lib_stdlib/jbuild @@ -4,9 +4,8 @@ ((name tezos_stdlib) (public_name tezos-stdlib) (libraries (ocplib-endian.bigstring - cstruct - stringext hex + re zarith lwt lwt.log)) diff --git a/src/lib_stdlib/utils.ml b/src/lib_stdlib/utils.ml index 36a6026de..17c870689 100644 --- a/src/lib_stdlib/utils.ml +++ b/src/lib_stdlib/utils.ml @@ -18,6 +18,7 @@ module Infix = struct end +let nbsp = Re.(compile (str "\xC2\xA0")) let display_paragraph ppf description = Format.fprintf ppf "@[%a@]" (Format.pp_print_list ~pp_sep:Format.pp_print_newline @@ -26,7 +27,7 @@ let display_paragraph ppf description = (fun ppf w -> (* replace   by real spaces... *) Format.fprintf ppf "%s@ " - (Stringext.replace_all ~pattern:"\xC2\xA0" ~with_:" " w)) + (Re.replace ~all:true nbsp ~f:(fun _ -> " ") w)) ppf (TzString.split ' ' line))) (TzString.split ~dup:false '\n' description)