Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion R/unleash.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ handle_text <- function(text) {
next_sibling <- xml2::xml_find_all(text, "following-sibling::*[1]")
if (length(next_sibling) > 0 && xml2::xml_name(next_sibling) == "link") {
end_space <- endsWith(xml2::xml_text(text), " ")
if (!end_space) {
end_left_parenthesis <- endsWith(xml2::xml_text(text), "(")
if (!end_space && !end_left_parenthesis) {
xml2::xml_text(text) <- paste0(xml2::xml_text(text), " ")
}
}
Expand Down
4 changes: 3 additions & 1 deletion inst/example.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@ This is a footnote [^ok].

[^ok]: Some more information.

R has well-developed plotting capabilities, and the `ggplot2` package is one of, if not the most powerful pieces of plotting software available today!!! We will begin learning to use `ggplot2` in the next episode.
R has well-developed plotting capabilities, and the `ggplot2` package is one of, if not the most powerful pieces of plotting software available today!!! We will begin learning to use `ggplot2` in the next episode.

This is a link in parentheses ([example](https://example.com)).
2 changes: 2 additions & 0 deletions tests/testthat/_snaps/unleash.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@
[29] ""
[30] "R has well-developed plotting capabilities, and the `ggplot2` package is one of, if not the most powerful pieces of plotting software available today!!!"
[31] "We will begin learning to use `ggplot2` in the next episode."
[32] ""
[33] "This is a link in parentheses ([example](https://example.com))."

Loading