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

Div fences immediately following lists (no newline) are swallowed by the list #84

Open
zkamvar opened this issue Mar 14, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@zkamvar
Copy link
Contributor

zkamvar commented Mar 14, 2022

I noticed that this div was causing a build to fail at the validation step with this diagnostic:

── Validating Fenced Divs ──────────────────────────────────────────────────────
Error: Error in .x[[1]] : subscript out of bounds
Calls: <Anonymous> ... get_linestart -> get_pos -> gsub -> is.factor -> <Anonymous>
Execution halted

It turns out that the closing fence for this div was being interpreted as part of the previous list item:

https://github.com/MCMaurer/Rewrite-R-ecology-lesson/blob/b23e42e4a876ce4aff65cf38ad98753f72719eba/episodes/01-visualizing-ggplot.Rmd#L401-L412

Here's a simplified use case:

tmp <- tempfile()
writeLines("text\n\n::: callout\n- list item\n  - list item 2\n:::\n\n text", tmp)
ep <- pegboard::Episode$new(tmp)
ep$show()
#> text
#> 
#> ::: callout
#> 
#> - list item
#>   - list item 2
#>     :::
#> 
#> text
ep$label_divs()$get_divs()
#> $`div-1-callout`
#> {xml_nodeset (0)}

Created on 2022-03-14 by the reprex package (v2.0.1)

zkamvar added a commit to zkamvar/Rewrite-R-ecology-lesson that referenced this issue Mar 14, 2022
zkamvar added a commit that referenced this issue Oct 28, 2022
This begins to address #84
@zkamvar zkamvar added the bug Something isn't working label Jun 30, 2023
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

No branches or pull requests

1 participant