Skip to content
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

bug with one-character inline math #101

Closed
maelle opened this issue Apr 4, 2024 · 1 comment · Fixed by #103
Closed

bug with one-character inline math #101

maelle opened this issue Apr 4, 2024 · 1 comment · Fixed by #103
Assignees
Labels
bug Something isn't working

Comments

@maelle
Copy link
Member

maelle commented Apr 4, 2024

Reported by @xtimbeau via ropensci-review-tools/babeldown#60 and related discussions

I'll try to fix it.

@maelle maelle added the bug Something isn't working label Apr 4, 2024
@maelle
Copy link
Member Author

maelle commented Apr 4, 2024

lines <- c("bla", "$a=1$")
temp_file <- withr::local_tempfile()
writeLines(lines, temp_file)
wool <- tinkr::yarn$new(temp_file)
tinkr::protect_math(wool$body)
#> {xml_document}
#> <document xmlns="http://commonmark.org/xml/1.0">
#> [1] <paragraph>\n  <text xml:space="preserve">bla</text>\n  <softbreak/>\n  < ...

Created on 2024-04-04 with reprex v2.1.0

vs

lines <- c("bla", "$a$")
temp_file <- withr::local_tempfile()
writeLines(lines, temp_file)
wool <- tinkr::yarn$new(temp_file)
tinkr::protect_math(wool$body)
#> Error in char[[1]]: subscript out of bounds

Created on 2024-04-04 with reprex v2.1.0

@maelle maelle self-assigned this Apr 4, 2024
@zkamvar zkamvar mentioned this issue May 9, 2024
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant