11defmodule IO.ANSI.Docs do
22 @ moduledoc false
33
4- @ bullet_text "• "
4+ @ bullet_text_unicode "• "
5+ @ bullet_text_ascii "* "
56 @ bullets [ ?* , ?- , ?+ ]
67 @ spaces [ " " , "\n " , "\t " ]
78
@@ -219,7 +220,10 @@ defmodule IO.ANSI.Docs do
219220 end
220221
221222 defp traverse_erlang_html ( { :dt , _ , entries } , indent , options ) do
222- [ "#{ indent } " , @ bullet_text | handle_erlang_html_text ( entries , indent <> " " , options ) ]
223+ [
224+ "#{ indent } " ,
225+ bullet_text ( options ) | handle_erlang_html_text ( entries , indent <> " " , options )
226+ ]
223227 end
224228
225229 defp traverse_erlang_html ( { :dd , _ , entries } , indent , options ) do
@@ -240,7 +244,10 @@ defmodule IO.ANSI.Docs do
240244 end
241245 else
242246 for { :li , _ , lines } <- entries do
243- [ "#{ indent } " , @ bullet_text | handle_erlang_html_text ( lines , indent <> " " , options ) ]
247+ [
248+ "#{ indent } " ,
249+ bullet_text ( options ) | handle_erlang_html_text ( lines , indent <> " " , options )
250+ ]
244251 end
245252 end
246253 end
@@ -424,7 +431,7 @@ defmodule IO.ANSI.Docs do
424431 case stripped do
425432 << bullet , ?\s , item :: binary >> when bullet in @ bullets ->
426433 write_text ( text , indent , options )
427- process_list ( @ bullet_text , item , rest , count , indent , options )
434+ process_list ( bullet_text ( options ) , item , rest , count , indent , options )
428435
429436 << d1 , ?. , ?\s , item :: binary >> when d1 in ?0 .. ?9 ->
430437 write_text ( text , indent , options )
@@ -930,6 +937,10 @@ defmodule IO.ANSI.Docs do
930937 end
931938 end
932939
940+ defp bullet_text ( options ) do
941+ if options [ :enabled ] , do: @ bullet_text_unicode , else: @ bullet_text_ascii
942+ end
943+
933944 defp color ( style , colors ) do
934945 IO.ANSI . format_fragment ( colors [ style ] , colors [ :enabled ] )
935946 end
0 commit comments