Skip to content

Commit b139da8

Browse files
committed
Add missing docstring normalization
Without this docstrings with UTF8 withing `[]` have miscalculated lengths.
1 parent 67eaab2 commit b139da8

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/Fmt.mli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ type s = (unit, Format.formatter, unit) format
2020
type t
2121

2222
type sp =
23-
| Blank (** [ ] *)
23+
| Blank (** [ ] *)
2424
| Cut (** [@,] *)
25-
| Space (** [@ ] *)
25+
| Space (** [@ ] *)
2626
| Break of int * int (** [@;] *)
2727

2828
val sp : sp -> t

lib/Fmt_odoc.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ let fmt_code_block conf s1 s2 =
8989
let box = match lines with _ :: _ :: _ -> vbox 0 | _ -> hvbox 0 in
9090
box (wrap_code (vbox 0 (list_fl lines fmt_line)))
9191

92-
let fmt_code_span s = hovbox 0 (wrap "[" "]" (str (escape_brackets s)))
92+
let fmt_code_span s =
93+
hovbox 0 (wrap "[" "]" (str_normalized ~escape:escape_brackets s))
9394

9495
let fmt_reference = ign_loc ~f:str_normalized
9596

0 commit comments

Comments
 (0)