fdoc

subroutinewrite_linkrecursiveprivate

recursive subroutine write_link(t, label, url, title, options, out, depth)

Write a link.

Arguments

NameTypeIntentAttributesDescription
ttype(tree_t)inout

the conversion

labelcharacter(len=*)in

its text

urlcharacter(len=*)in

the address

titlecharacter(len=*)in

the title, or ''

optionstype(markdown_options_t)in

what rendering depends on

outtype(buffer_t)inout

the HTML

depthintegerin

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

Graphs

Calls

Called by