aboutsummaryrefslogtreecommitdiff
path: root/render.f90
diff options
context:
space:
mode:
Diffstat (limited to 'render.f90')
-rw-r--r--render.f9042
1 files changed, 42 insertions, 0 deletions
diff --git a/render.f90 b/render.f90
index b3b1c32..405fff9 100644
--- a/render.f90
+++ b/render.f90
@@ -275,4 +275,46 @@ contains
end subroutine render_link
+ function handle_input(r, url, unit_number)
+ use escaper
+ implicit none
+
+ class(renderer)::r
+ character(*), intent(inout)::url
+ integer, intent(in)::unit_number
+
+ logical::handle_input
+
+ character(1024)::response_line
+ character(256)::answer
+ integer::question_index
+
+ rewind(unit_number)
+
+ read(unit_number, '(A1024)') response_line
+ question_index = 3
+ do while(response_line(question_index:question_index) == " " .or. &
+ response_line(question_index:question_index) == char(9))
+
+ question_index = question_index + 1
+
+ end do
+
+ handle_input = r%request_input(response_line(question_index:len_trim(response_line)), &
+ answer)
+
+ if(handle_input) then
+ question_index = index(url, "?")
+ if(question_index < 1) then
+ url = trim(url)//"?"
+ question_index = len_trim(url)
+ end if
+
+ call escape_string(answer)
+
+ url = url(1:question_index)//answer
+ end if
+
+ end function handle_input
+
end module render