fdoc

subroutineinline_entityprivate

subroutine inline_entity(text, i, out, used)

Handle &: an entity stays as it is, anything else is escaped.

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)in

the text

iintegerin

where it is

outtype(buffer_t)inout

the HTML

usedintegerout

how much was used

Calls

Source

Show the code
subroutine inline_entity(text, i, out, used)
    character(len=*), intent(in) :: text    !! the text
    integer, intent(in) :: i                !! where it is
    type(buffer_t), intent(inout) :: out    !! the HTML
    integer, intent(out) :: used            !! how much was used
    integer :: close

    close = index(text(i:), ';')
    used = 1
    if (close > 2) then
        if (verify(text(i + 1:i + close - 2), WORD_CHARS(:62)//'#') == 0) then
            call add(out, text(i:i + close - 1))
            used = close
            return
        end if
    end if
    call add(out, '&')
end subroutine inline_entity

Graphs

Calls

Called by