Skip to content

Commit

Permalink
Fix raw markup
Browse files Browse the repository at this point in the history
  • Loading branch information
Julow committed Jun 17, 2019
1 parent 36777b7 commit e519cfc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Fmt_odoc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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) ->
Expand Down
2 changes: 2 additions & 0 deletions test/passing/doc_comments.mli
Original file line number Diff line number Diff line change
Expand Up @@ -310,3 +310,5 @@ A
@canonical Foo.Bar
*)

(** {%html:<p>Raw markup</p>%} {%Without language%} {%other:Other language%} *)
2 changes: 2 additions & 0 deletions test/passing/doc_comments.mli.ref
Original file line number Diff line number Diff line change
Expand Up @@ -296,3 +296,5 @@ A
{!modules:Foo Bar.Baz}
@canonical Foo
@canonical Foo.Bar *)

(** {%html:<p>Raw markup</p>%} {%Without language%} {%other:Other language%} *)

0 comments on commit e519cfc

Please sign in to comment.