Running examples in 'htmltidy-Ex.R' failed
The error most likely occurred in:

> ### Name: tidy_html.response
> ### Title: Tidy or "Pretty Print" HTML/XHTML Documents
> ### Aliases: tidy_html.response tidy_html tidy_html.default
> ###   tidy_html.character tidy_html.raw tidy_html.xml_document
> ###   tidy_html.HTMLInternalDocument tidy_html.connection
> 
> ### ** Examples
> 
> opts <- list(
+   TidyDocType="html5",
+   TidyMakeClean=TRUE,
+   TidyHideComments=TRUE,
+   TidyIndentContent=TRUE,
+   TidyWrapLen=200
+ )
> 
> txt <- paste0(
+   c("<html><head><style>p { color: red; }</style><body><!-- ===== body ====== -->",
+ "<p>Test</p></body><!--Default Zone --> <!--Default Zone End--></html>"),
+   collapse="")
> 
> cat(tidy_html(txt, option=opts))
<!DOCTYPE html>
<html>
  <head>
    <meta name="generator" content="HTML Tidy for HTML5 for R version 5.0.0">
    <style>
    p { color: red; }
    </style>
    <title></title>
  </head>
  <body>
    <p>
      Test
    </p>
  </body>
</html>
> 
> library(httr)
> res <- GET("https://rud.is/test/untidy.html")
> 
> # look at the original, un-tidy source
> cat(content(res, as="text", encoding="UTF-8"))
<head>
<style>
body { font-family: sans-serif; }
</style>
</head>
<body>
<b>This is <b>some <i>really </i> poorly formatted HTML</b>

as is this <span id="sp">portion<div>
> 
> # see the tidied version
> cat(tidy_html(content(res, as="text", encoding="UTF-8"),
+               list(TidyDocType="html5", TidyWrapLen=200)))
<!DOCTYPE html>
<html>
<head>
<meta name="generator" content="HTML Tidy for HTML5 for R version 5.0.0">
<style>
body { font-family: sans-serif; }
</style>
<title></title>
</head>
<body>
<b>This is some <i>really</i> poorly formatted HTML as is this <span id="sp">portion</span></b>
<div><span id="sp"></span></div>
</body>
</html>
> 
> # but, you could also just do:
> cat(tidy_html(url("https://rud.is/test/untidy.html")))
Warning in readLines(content, warn = FALSE) :
  InternetOpenUrl failed: 'Die Serververbindung wurde zurückgesetzt.'
Error in readLines(content, warn = FALSE) : cannot open the connection
Calls: cat ... tidy_html -> tidy_html.connection -> paste0 -> readLines
Execution halted