Skip to content

Commit

Permalink
fix(docs): support numbered lists in erlang docs (#506)
Browse files Browse the repository at this point in the history
This was triggered by hovering over `:gen_tcp.close/1`.
  • Loading branch information
fhunleth authored May 31, 2024
1 parent 4c0d582 commit 4740cfb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/next_ls/docs.ex
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ defmodule NextLS.Docs do
"#{to_markdown(type, children)}\n" <> to_markdown(type, rest)
end

def to_markdown("application/erlang+html" = type, [{:ol, _, lis} | rest]) do
"#{to_markdown(type, lis)}\n" <> to_markdown(type, rest)
end

def to_markdown("application/erlang+html" = type, [{:ot, _, children} | rest]) do
"1. #{to_markdown(type, children)}\n" <> to_markdown(type, rest)
end

def to_markdown("application/erlang+html" = type, [{:i, _, children} | rest]) do
"_#{IO.iodata_to_binary(children)}_" <> to_markdown(type, rest)
end
Expand Down

0 comments on commit 4740cfb

Please sign in to comment.