You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: a badges paragraph right at the beginning of a README.md doesn't get recognized.
Why: in markdown_path_html(), xml2::read_html() loses the first comment as it's read as if it were outside of the body.
A fix might be to wrap the HTML string into <body></body>.
xml2::read_html(
'<!-- badges: start --><p><a href="https://github.com/ropensci/occCite/actions"><img src="https://github.com/ropensci/occCite/workflows/R-CMD-check/badge.svg" alt="R build status" /></a><!-- badges: end -->'
) |> as.character()
#> [1] "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n<!-- badges: start --><html><body><p><a href=\"https://github.com/ropensci/occCite/actions\"><img src=\"https://github.com/ropensci/occCite/workflows/R-CMD-check/badge.svg\" alt=\"R build status\"></a>\n<!-- badges: end --></p></body></html>\n"xml2::read_html(
'<body><!-- badges: start --><p><a href="https://github.com/ropensci/occCite/actions"><img src="https://github.com/ropensci/occCite/workflows/R-CMD-check/badge.svg" alt="R build status" /></a><!-- badges: end --></body>'
) |> as.character()
#> [1] "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">\n<html><body>\n<!-- badges: start -->\n<p><a href=\"https://github.com/ropensci/occCite/actions\"><img src=\"https://github.com/ropensci/occCite/workflows/R-CMD-check/badge.svg\" alt=\"R build status\"></a>\n<!-- badges: end --></p>\n</body></html>\n"
Problem: a badges paragraph right at the beginning of a README.md doesn't get recognized.
Why: in
markdown_path_html()
,xml2::read_html()
loses the first comment as it's read as if it were outside of the body.A fix might be to wrap the HTML string into
<body></body>
.Created on 2022-03-17 by the reprex package (v2.0.1)
(A workaround is to put the badges paragraph after the heading)
Cc @hannahlowens
The text was updated successfully, but these errors were encountered: