@@ -249,9 +249,9 @@ and item (l : Item.t list) args nesting_level =
249
249
| None -> paragraph title
250
250
in
251
251
blocks heading' (continue rest)
252
- | Declaration { attr = _ ; anchor; content; doc } -> (
252
+ | Declaration { attr = _ ; anchor; content; doc } ->
253
253
(*
254
- A declaration render like this:
254
+ Declarations render like this:
255
255
256
256
{v
257
257
<a id="<id>"></a>
@@ -271,14 +271,21 @@ and item (l : Item.t list) args nesting_level =
271
271
in
272
272
paragraph (anchor' anchor)
273
273
else noop
274
+ and begin_code, content =
275
+ match take_code content with
276
+ | [] , _ -> assert false (* Content doesn't begin with code ? *)
277
+ | begin_code, Alternative (Expansion e) :: tl
278
+ when should_inline e.url ->
279
+ (* Take the code from inlined expansion. For example, to catch
280
+ [= sig]. *)
281
+ let e_code, e_tl = take_code e.expansion in
282
+ (begin_code @ e_code, e_tl @ tl)
283
+ | begin_code , content -> (begin_code, content)
274
284
in
275
- match take_code content with
276
- | [] , _ -> assert false (* Content doesn't begin with code ? *)
277
- | begin_code , tl ->
278
- anchor
279
- +++ item_heading nesting_level (source_code begin_code args)
280
- +++ documented_src tl args nesting_level
281
- +++ doc +++ continue rest)
285
+ anchor
286
+ +++ item_heading nesting_level (source_code begin_code args)
287
+ +++ documented_src content args nesting_level
288
+ +++ doc +++ continue rest
282
289
| Include { content = { summary; status; content } ; _ } ->
283
290
let inline_subpage = function
284
291
| `Inline | `Open | `Default -> true
0 commit comments