@@ -249,9 +249,9 @@ and item (l : Item.t list) args nesting_level =
249249            |  None  -> paragraph title
250250          in 
251251          blocks heading' (continue rest)
252-       |  Declaration  { attr  = _ ; anchor; content; doc }  -> ( 
252+       |  Declaration  { attr  = _ ; anchor; content; doc }  ->
253253          (* 
254-              A declaration  render like this: 
254+              Declarations  render like this: 
255255
256256             {v 
257257             <a id="<id>"></a> 
@@ -271,14 +271,21 @@ and item (l : Item.t list) args nesting_level =
271271              in 
272272              paragraph (anchor' anchor)
273273            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)
274284          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
282289      |  Include  { content  = { summary; status; content } ; _ }  ->
283290          let  inline_subpage  =  function 
284291            |  `Inline  |  `Open  |  `Default  -> true 
0 commit comments