File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed
demo-repository/exercises/demo2 Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 1- [ ceci est un lien ] ( http ://google.com )
2- This exercise is just another demo for the exercise environment.
1+ The following example link will open another tab/window: [ OCaml ] ( https ://ocaml.org/ ) .
2+ This exercise is just another demo for the exercise environment.
33<a href =" " onclick =" top .location = ' /exercises/demo/' ;" >Test</a >
44
55<details >
Original file line number Diff line number Diff line change @@ -317,17 +317,20 @@ module File = struct
317317 descrs := (lang, f raw) :: ! descrs;
318318 return ()
319319 in
320- let open Omd_representation in
321- let override_url = function
322- | Url (href ,s ,title ) ->
323- Some ( let title_url =
324- if title <> " "
325- then
326- Printf. sprintf {| title= " %s" | } title
327- else " " in
328- Printf. sprintf
320+ let override_url = function
321+ | Omd_representation. Url (href ,s ,title ) ->
322+ if String. length href > 0 then
323+ if Char. equal (String. get href 0 ) '#' then
324+ None
325+ else
326+ let title_url =
327+ if title <> " " then Printf. sprintf {| title= " %s" | } title else " " in
328+ let html =
329+ Printf. sprintf
329330 {|< a href= " %s" target= " _blank" rel= " noopener noreferrer" % s> % s< / a> | }
330- href title_url (Omd_backend. html_of_md s))
331+ href title_url (Omd_backend. html_of_md s) in
332+ Some html
333+ else None
331334 | _ -> None in
332335 let markdown_to_html md =
333336 Omd. (md |> of_string |> to_html ~override: override_url)
You can’t perform that action at this time.
0 commit comments