Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove meta from reply_html_page

How do I remove the meta tag that is automatically inserted by reply_html_page?

reply_html_page(
    [title('Fortunes')],
    [table([
        ...
    ])]
).

The generate code looks like this:

<!DOCTYPE html>
<HTML>
  <head>
    <title>Fortunes</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    ...
  </body>
</html>

Additionally: Is there a way to send the Content-Length header with the response?

Cross-Post: https://swi-prolog.discourse.group/t/remove-meta-from-reply-html-page/4189

like image 337
vasily Avatar asked Jun 27 '26 14:06

vasily


1 Answers

This is what worked for me (answered by @jan-wielemaker here: https://swi-prolog.discourse.group/t/remove-meta-from-reply-html-page/4189/8)

reply(_Request) :-
    ...,
    phrase(page([ head(title('Fortunes')),
                  body(table(\sequence(row, Rows)))
                ]),
           Tokens),
    print_html(Tokens).

row(row(N, C)) -->
    html(tr([td(N), td(C)])).
like image 174
vasily Avatar answered Jun 30 '26 17:06

vasily



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!