Skip to content

Commit f907e91

Browse files
committed
fix: no space after left parenthesis
1 parent 1ef4439 commit f907e91

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

R/unleash.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ handle_text <- function(text) {
118118
next_sibling <- xml2::xml_find_all(text, "following-sibling::*[1]")
119119
if (length(next_sibling) > 0 && xml2::xml_name(next_sibling) == "link") {
120120
end_space <- endsWith(xml2::xml_text(text), " ")
121-
if (!end_space) {
121+
end_left_parenthesis <- endsWith(xml2::xml_text(text), "(")
122+
if (!end_space && !end_left_parenthesis) {
122123
xml2::xml_text(text) <- paste0(xml2::xml_text(text), " ")
123124
}
124125
}

inst/example.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@ This is a footnote [^ok].
2929

3030
[^ok]: Some more information.
3131

32-
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.
32+
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.
33+
34+
This is a link in parentheses ([example](https://example.com)).

tests/testthat/_snaps/unleash.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@
3434
[29] ""
3535
[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!!!"
3636
[31] "We will begin learning to use `ggplot2` in the next episode."
37+
[32] ""
38+
[33] "This is a link in parentheses ([example](https://example.com))."
3739

0 commit comments

Comments
 (0)