From 82b388d01ff65b9168746ac865c84c2ce1591a7b Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Fri, 4 Jun 2021 01:23:13 +0100 Subject: [PATCH] Add missing docstring normalization Without this docstrings with UTF8 withing `[]` have miscalculated lengths. --- lib/Fmt_odoc.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Fmt_odoc.ml b/lib/Fmt_odoc.ml index 0b0c088acf..b6fe268e5b 100644 --- a/lib/Fmt_odoc.ml +++ b/lib/Fmt_odoc.ml @@ -89,7 +89,8 @@ let fmt_code_block conf s1 s2 = let box = match lines with _ :: _ :: _ -> vbox 0 | _ -> hvbox 0 in box (wrap_code (vbox 0 (list_fl lines fmt_line))) -let fmt_code_span s = hovbox 0 (wrap "[" "]" (str (escape_brackets s))) +let fmt_code_span s = + hovbox 0 (wrap "[" "]" (str_normalized ~escape:escape_brackets s)) let fmt_reference = ign_loc ~f:str_normalized