subroutinewrite_linkrecursiveprivate
recursive subroutine write_link(t, label, url, title, options, out, depth)
Write a link.
Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
| t | type(tree_t) | inout | the conversion | |
| label | character(len=*) | in | its text | |
| url | character(len=*) | in | the address | |
| title | character(len=*) | in | the title, or | |
| options | type(markdown_options_t) | in | what rendering depends on | |
| out | type(buffer_t) | inout | the HTML | |
| depth | integer | in | how deeply this is nested |
Calls
Source
Show the code
recursive subroutine write_link(t, label, url, title, options, out, depth)
type(tree_t), intent(inout) :: t !! the conversion
character(len=*), intent(in) :: label !! its text
character(len=*), intent(in) :: url !! the address
character(len=*), intent(in) :: title !! the title, or `''`
type(markdown_options_t), intent(in) :: options !! what rendering depends on
type(buffer_t), intent(inout) :: out !! the HTML
integer, intent(in) :: depth !! how deeply this is nested
call add(out, '<a href="')
call html_escape(url, out, .true.)
call add(out, '"')
if (len(title) > 0) then
call add(out, ' title="')
call html_escape(title, out, .true.)
call add(out, '"')
end if
call add(out, '>')
if (depth < MAX_DEPTH) call inline(t, label, options, out, depth + 1)
call add(out, '</a>')
end subroutine write_link