fdoc

subroutineadd_js_textprivate

subroutine add_js_text(text, b)

Append text for use in a JavaScript string in single quotes.

Arguments

NameTypeIntentAttributesDescription
textcharacter(len=*)in

the text

btype(buffer_t)inout

the script

Calls

Source

Show the code
subroutine add_js_text(text, b)
    character(len=*), intent(in) :: text    !! the text
    type(buffer_t), intent(inout) :: b      !! the script
    integer :: k

    do k = 1, len(text)
        if (text(k:k) == "'" .or. text(k:k) == '\') call add(b, '\')
        call add(b, text(k:k))
    end do
end subroutine add_js_text

Graphs

Calls

Called by