diff --git a/src/Fmt_odoc.ml b/src/Fmt_odoc.ml index 65d9844c1b..8d46b1c6ba 100644 --- a/src/Fmt_odoc.ml +++ b/src/Fmt_odoc.ml @@ -122,7 +122,13 @@ let rec fmt_inline_element : inline_element -> Fmt.t = function | `Code_span s -> let s = escape_brackets s in hovbox 0 (wrap "[" "]" (str_verbatim s)) - | `Raw_markup (_lang, s) -> str s + | `Raw_markup (lang, s) -> + let lang = + match lang with + | Some l -> str l $ str ":" + | None -> noop + in + wrap "{%%" "%%}" (lang $ str_verbatim s) | `Styled (style, elems) -> fmt_styled style (ign_loc ~f:fmt_inline_element) elems | `Reference (_kind, ref, txt) -> diff --git a/test/passing/doc_comments.mli b/test/passing/doc_comments.mli index a8189ec93f..11d16207e2 100644 --- a/test/passing/doc_comments.mli +++ b/test/passing/doc_comments.mli @@ -310,3 +310,5 @@ A @canonical Foo.Bar *) + +(** {%html:
Raw markup
%} {%Without language%} {%other:Other language%} *) diff --git a/test/passing/doc_comments.mli.ref b/test/passing/doc_comments.mli.ref index 17f68ffb10..004ae9c060 100644 --- a/test/passing/doc_comments.mli.ref +++ b/test/passing/doc_comments.mli.ref @@ -296,3 +296,5 @@ A {!modules:Foo Bar.Baz} @canonical Foo @canonical Foo.Bar *) + +(** {%html:Raw markup
%} {%Without language%} {%other:Other language%} *)