File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
mkdocstrings/handlers/crystal Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -325,10 +325,19 @@ def args_html(self) -> crystal_html.TextWithLinks:
325325
326326 @cached_property
327327 def location (self ) -> Optional [DocLocation ]:
328- m = re .fullmatch (r".+?/(?:blob|tree)/[^/]+/(.+)#L(\d+)" , self .data .get ("source_link" ) or "" )
329- if m :
330- filename , line = m .groups ()
331- return DocLocation (filename , line , self .data .get ("source_link" ))
328+ # https://github.com/crystal-lang/crystal/pull/10122
329+ try :
330+ loc = self .data ["location" ]
331+ except KeyError :
332+ m = re .fullmatch (
333+ r".+?/(?:blob|tree)/[^/]+/(.+)#L(\d+)" , self .data .get ("source_link" ) or ""
334+ )
335+ if m :
336+ filename , line = m .groups ()
337+ return DocLocation (filename , line , self .data .get ("source_link" ))
338+ else :
339+ if loc :
340+ return DocLocation (loc ["filename" ], loc ["line_number" ], loc ["url" ])
332341
333342
334343class DocInstanceMethod (DocMethod ):
You can’t perform that action at this time.
0 commit comments