Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

odoc: Fix formatting of paragraphs in lists #2607

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ profile. This started with version 0.26.0.
- Display `a##b` instead of `a ## b` and similarly for operators that start with # (#2580, @v-gb)
- \* Fix arrow type indentation with `break-separators=before` (#2598, @Julow)
- Fix missing parentheses around a let in class expressions (#2599, @Julow)
- Fix formatting of paragraphs in lists in documentation (#2607, @Julow)

## 0.26.2 (2024-04-18)

Expand Down
2 changes: 1 addition & 1 deletion lib/Fmt_odoc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ let rec fmt_inline_elements c elements =

and fmt_nestable_block_element c elm =
match elm.Loc.value with
| `Paragraph elems -> fmt_inline_elements c elems
| `Paragraph elems -> hovbox 0 (fmt_inline_elements c elems)
| `Code_block (s1, s2) -> fmt_code_block c s1 s2
| `Math_block s -> fmt_math_block s
| `Verbatim s -> fmt_verbatim_block ~loc:elm.location s
Expand Down
9 changes: 9 additions & 0 deletions test/passing/tests/doc_comments-no-parse-docstrings.mli.ref
Original file line number Diff line number Diff line change
Expand Up @@ -641,3 +641,12 @@ type x =
(** at@ *)

(** \@at *)

(** Lists can't be nested
- foo
- module system documentation including
{ol
{- bar}
{- baz}
}
*)
9 changes: 9 additions & 0 deletions test/passing/tests/doc_comments-no-wrap.mli.ref
Original file line number Diff line number Diff line change
Expand Up @@ -683,3 +683,12 @@ type x =
(** at@ *)

(** \@at *)

(** Lists can't be nested
{ul
{- foo }
{- module system documentation including
+ bar
+ baz
}
} *)
9 changes: 9 additions & 0 deletions test/passing/tests/doc_comments.mli
Original file line number Diff line number Diff line change
Expand Up @@ -648,3 +648,12 @@ type x =

(** at@ *)
(** \@at *)

(** Lists can't be nested
- foo
- module system documentation including
{ol
{- bar}
{- baz}
}
*)
9 changes: 9 additions & 0 deletions test/passing/tests/doc_comments.mli.ref
Original file line number Diff line number Diff line change
Expand Up @@ -677,3 +677,12 @@ type x =
(** at@ *)

(** \@at *)

(** Lists can't be nested
{ul
{- foo }
{- module system documentation including
+ bar
+ baz
}
} *)
Loading