odoc icon indicating copy to clipboard operation
odoc copied to clipboard

Odoc does not support odoc code blocks within code blocks

Open NathanReb opened this issue 4 years ago • 2 comments

When writing an ocaml code block in odoc markup that itself contains an odoc code block, the first end of block delimiter is interpreted as closing the encompassing block.

For example:

(** Here is how to write odoc code blocks:
  {[
  (** Here is an ocaml code block:
    {[
    let x = 0
    ]}
  *)
  ]}
*)

Will not be rendered as: Screenshot from 2021-11-10 10-46-07

Problem is, if you try to escape the characters, it is also not properly rendered: Screenshot from 2021-11-10 10-48-37

It would be nice to have a way to get this to work both in {[ ... ]} and {@ocaml[ ... ]} code blocks or to have a way to escape those characters properly.

NathanReb avatar Nov 10 '21 09:11 NathanReb

CC @Julow who helped me find out about this bug!

NathanReb avatar Nov 10 '21 09:11 NathanReb

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. The main purpose of this is to keep the issue tracker focused to what is actively being worked on, so that the amount and variety of open yet inactive issues does not overwhelm contributors.

An issue closed as stale is not rejected — further discussion is welcome in its closed state, and it can be resurrected at any time. odoc maintainers regularly check issues that were closed as stale in the past, to see if the time is right to reopen and work on them again. PRs addressing issues closed as stale are as welcome as PRs for open issues. They will be given the same review attention, and any other help.

github-actions[bot] avatar Aug 07 '23 17:08 github-actions[bot]

This is fixed by the {delim[ ... ]delim} syntax!

panglesd avatar May 15 '24 13:05 panglesd

And nicely mentioned in the cheatsheet I should add…

dbuenzli avatar May 15 '24 14:05 dbuenzli