From 4740cfb48cad2ae5343fdf027a9dd697f76a6c1f Mon Sep 17 00:00:00 2001 From: Frank Hunleth Date: Fri, 31 May 2024 09:51:58 -0400 Subject: [PATCH] fix(docs): support numbered lists in erlang docs (#506) This was triggered by hovering over `:gen_tcp.close/1`. --- lib/next_ls/docs.ex | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/next_ls/docs.ex b/lib/next_ls/docs.ex index 8359d840..cd7f050b 100644 --- a/lib/next_ls/docs.ex +++ b/lib/next_ls/docs.ex @@ -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