fdoc

subroutinefirst_paragraphpureprivate

pure subroutine first_paragraph(html, out)

The first paragraph of html, or ''.

Arguments

NameTypeIntentAttributesDescription
htmlcharacter(len=*)in

the HTML

outcharacter(len=:)outallocatable

the paragraph

Source

Show the code
pure subroutine first_paragraph(html, out)
    character(len=*), intent(in) :: html                !! the HTML
    character(len=:), allocatable, intent(out) :: out   !! the paragraph
    integer :: a, b

    out = ''
    a = index(html, '<p>')
    if (a == 0) a = index(html, '<p ')
    if (a == 0) return
    b = index(html(a:), '</p>')
    if (b > 0) out = html(a:a + b + 2)
end subroutine first_paragraph

Graphs

Called by