this repo has no description

Html: Fix stack overflow computing source code spans

authored by

Jules Aguillon and committed by jon.recoil.org f4b81efd f83e69a1

+3 -4
+3 -4
src/html/html_source.ml
··· 1 module HLink = Link 2 open Odoc_document.Types 3 open Tyxml ··· 23 | Source_page.Plain_code s -> [ txt s ] 24 | Tagged_code (info, docs) -> ( 25 let is_in_a = match info with Link _ -> true | _ -> is_in_a in 26 - let children = List.concat @@ (List.rev_map (doc_to_html ~is_in_a) docs |> List.rev) in 27 match info with 28 | Syntax tok -> [ span ~a:[ a_class [ tok ] ] children ] 29 (* Currently, we do not render links to documentation *) ··· 33 [ a ~a:[ a_href href ] children ] 34 | Anchor lbl -> [ span ~a:[ a_id lbl ] children ]) 35 in 36 - let span_content_l = List.rev_map (doc_to_html ~is_in_a:false) docs |> List.rev in 37 - (* This is List.concat, tail recursive version *) 38 - let span_content = List.fold_left (fun acc x -> List.rev_append x acc) [] span_content_l |> List.rev in 39 span ~a:[] span_content 40 41 let count_lines_in_string s =
··· 1 + open Odoc_utils 2 module HLink = Link 3 open Odoc_document.Types 4 open Tyxml ··· 24 | Source_page.Plain_code s -> [ txt s ] 25 | Tagged_code (info, docs) -> ( 26 let is_in_a = match info with Link _ -> true | _ -> is_in_a in 27 + let children = List.concat_map (doc_to_html ~is_in_a) docs in 28 match info with 29 | Syntax tok -> [ span ~a:[ a_class [ tok ] ] children ] 30 (* Currently, we do not render links to documentation *) ··· 34 [ a ~a:[ a_href href ] children ] 35 | Anchor lbl -> [ span ~a:[ a_id lbl ] children ]) 36 in 37 + let span_content = List.concat_map (doc_to_html ~is_in_a:false) docs in 38 span ~a:[] span_content 39 40 let count_lines_in_string s =