# the HTML validation server was started in GHA validate_html = function(files, server = Sys.getenv('W3C_MARKUP_VALIDATOR_BASEURL')) { if (server == '') return() res = lapply(files, function(f) { h = curl::new_handle() curl::handle_setform(handle = h, out = 'json', file = curl::form_file(f, 'text/html')) jsonlite::fromJSON(rawToChar(curl::curl_fetch_memory(server, h)$content)) }) # Regex patterns for errors that are known/expected and should be ignored. # Using regex (rather than exact strings) makes matching robust to minor # changes in the validator's message wording or quotation style. ignore_patterns = c( # IE CSS hack: border: solid\9 (backslash-9 hack for IE8 compatibility) 'CSS:.*border-(top|bottom).*solid.*9.*is not a.*color.*value', # bookdown uses a custom "number" attribute on