+ let add_markup attr txt =
+ let txt = Netencoding.Html.encode ~in_enc:`Enc_utf8 () txt in
+ let value_of_attr (_,_,v) = v in
+ let title =
+ try Some (value_of_attr (List.find (fun (_,t,_) -> t = "title") attr))
+ with _ -> None in
+ let href =
+ try Some (value_of_attr (List.find (fun (_,t,_) -> t = "href") attr))
+ with _ -> None in
+ match title,href with
+ | None,None -> txt
+ | None,Some u -> "<A href=\"" ^ u ^ "\">" ^ txt ^ "</A>"
+ | Some t, Some u ->
+ "<A href=\"" ^ u ^ "\" title=\"" ^ t ^ "\">" ^ txt ^ "</A>"
+ | Some t, None ->
+ let u = "cic:/fakeuri.con" in
+ "<A href=\"" ^ u ^ "\" title=\"" ^ t ^ "\">" ^ txt ^ "</A>"
+ in
+