Skip to content

Commit

Permalink
fix: support numbered lists in docs to prevent crash
Browse files Browse the repository at this point in the history
This was triggered by hovering over `:gen_tcp.shutdown/2`.
  • Loading branch information
fhunleth committed May 31, 2024
1 parent 4c0d582 commit 90c6ab1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .tool-versions

This file was deleted.

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 90c6ab1

Please sign in to comment.