@@ -130,12 +130,14 @@ defmodule ExDoc.Retriever do
130130 }
131131
132132 { doc_line , doc_file , format , source_doc , doc_ast , metadata } =
133- get_module_docs ( module_data , source )
133+ get_module_docs ( module_data , source , config )
134134
135135 group_for_doc = config . group_for_doc
136136 annotations_for_docs = config . annotations_for_docs
137137
138- { docs , nodes_groups } = get_docs ( module_data , source , group_for_doc , annotations_for_docs )
138+ { docs , nodes_groups } =
139+ get_docs ( module_data , source , group_for_doc , annotations_for_docs , config )
140+
139141 docs = ExDoc.Utils . natural_sort_by ( docs , & "#{ & 1 . name } /#{ & 1 . arity } " )
140142
141143 moduledoc_groups = Map . get ( metadata , :groups , [ ] )
@@ -144,7 +146,8 @@ defmodule ExDoc.Retriever do
144146 get_docs_groups (
145147 moduledoc_groups ++ config . docs_groups ++ module_data . default_groups ,
146148 nodes_groups ,
147- docs
149+ docs ,
150+ config
148151 )
149152
150153 metadata = Map . put ( metadata , :kind , module_data . type )
@@ -188,29 +191,29 @@ defmodule ExDoc.Retriever do
188191
189192 # Helpers
190193
191- defp get_module_docs ( module_data , source ) do
194+ defp get_module_docs ( module_data , source , config ) do
192195 { :docs_v1 , anno , _ , format , moduledoc , metadata , _ } = module_data . docs
193196 doc_file = anno_file ( anno , source )
194197 doc_line = anno_line ( anno )
195- options = [ file: doc_file , line: doc_line + 1 ]
198+ options = [ file: doc_file , line: doc_line + 1 , markdown_processor: config . markdown_processor ]
196199 { doc_line , doc_file , format , moduledoc , doc_ast ( format , moduledoc , options ) , metadata }
197200 end
198201
199- defp get_docs ( module_data , source , group_for_doc , annotations_for_docs ) do
202+ defp get_docs ( module_data , source , group_for_doc , annotations_for_docs , config ) do
200203 { :docs_v1 , _ , _ , _ , _ , _ , docs } = module_data . docs
201204
202205 { nodes , groups } =
203206 for doc <- docs ,
204207 doc_data = module_data . language . doc_data ( doc , module_data ) do
205208 { _node , _group } =
206- get_doc ( doc , doc_data , module_data , source , group_for_doc , annotations_for_docs )
209+ get_doc ( doc , doc_data , module_data , source , group_for_doc , annotations_for_docs , config )
207210 end
208211 |> Enum . unzip ( )
209212
210213 { filter_defaults ( nodes ) , groups }
211214 end
212215
213- defp get_doc ( doc , doc_data , module_data , source , group_for_doc , annotations_for_docs ) do
216+ defp get_doc ( doc , doc_data , module_data , source , group_for_doc , annotations_for_docs , config ) do
214217 { :docs_v1 , _ , _ , content_type , _ , module_metadata , _ } = module_data . docs
215218 { { type , name , arity } , anno , _signature , source_doc , metadata } = doc
216219 doc_file = anno_file ( anno , source )
@@ -231,7 +234,11 @@ defmodule ExDoc.Retriever do
231234 defaults = get_defaults ( name , arity , Map . get ( metadata , :defaults , 0 ) )
232235
233236 doc_ast =
234- doc_ast ( content_type , source_doc , file: doc_file , line: doc_line + 1 ) ||
237+ doc_ast ( content_type , source_doc ,
238+ file: doc_file ,
239+ line: doc_line + 1 ,
240+ markdown_processor: config . markdown_processor
241+ ) ||
235242 doc_data . doc_fallback . ( )
236243
237244 group = normalize_group ( group_for_doc . ( metadata ) || doc_data . default_group )
@@ -276,7 +283,7 @@ defmodule ExDoc.Retriever do
276283 end )
277284 end
278285
279- defp get_docs_groups ( module_groups , nodes_groups , doc_nodes ) do
286+ defp get_docs_groups ( module_groups , nodes_groups , doc_nodes , config ) do
280287 module_groups = Enum . map ( module_groups , & normalize_group / 1 )
281288
282289 nodes_groups_descriptions = Map . new ( nodes_groups , & { & 1 . title , & 1 . description } )
@@ -299,15 +306,15 @@ defmodule ExDoc.Retriever do
299306 { [ ] , seen }
300307
301308 child_nodes ->
302- group = finalize_group ( group , child_nodes , nodes_groups_descriptions )
309+ group = finalize_group ( group , child_nodes , nodes_groups_descriptions , config )
303310 { [ group ] , seen }
304311 end
305312 end )
306313
307314 docs_groups
308315 end
309316
310- defp finalize_group ( group , doc_nodes , description_fallbacks ) do
317+ defp finalize_group ( group , doc_nodes , description_fallbacks , config ) do
311318 description =
312319 case group . description do
313320 nil -> Map . get ( description_fallbacks , group . title )
@@ -320,7 +327,11 @@ defmodule ExDoc.Retriever do
320327 nil
321328
322329 text ->
323- doc_ast = doc_ast ( "text/markdown" , % { "en" => text } , [ ] )
330+ doc_ast =
331+ doc_ast ( "text/markdown" , % { "en" => text } ,
332+ markdown_processor: config . markdown_processor
333+ )
334+
324335 sub_id = ExDoc.Utils . text_to_id ( group . title )
325336 normalize_doc_ast ( doc_ast , "group-#{ sub_id } -" )
326337 end
0 commit comments