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
As reported in carpentries/workbench#62, if someone writes a closing div fence that is more than 80 characters wide, they encounter an error of a missing div tag.
I can construct a reproducible example that demonstrates this pattern with 91 closing colons:
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: instructor
test
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
tmp<-withr::local_tempfile()
open<- paste(paste(rep(":", 80), collapse=""), "instructor")
close<- paste(rep(":", 91), collapse="")
writeLines(c(open, "\ntest\n", close), tmp)
pegboard::Episode$new(tmp)$label_divs()
#> ✖ A section (div) tag mis-match was detected.#> ✖ There are not enough close tags (0) for the number of open tags (2).#> Error: Missing close section (div) tag in /tmp/RtmpBS9YrF/file8e3174daa911.#> Here is a list of all the tags in the file:#> /tmp/RtmpBS9YrF/file8e3174daa911:1 | tag: instructor#> /tmp/RtmpBS9YrF/file8e3174daa911:5 | tag: :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Note, however that this cap is NOT present in the opening div regex (which is even more horrifying than the previous; so much so that it needs 20 lines of explanation) (important part is [:]{3,}):
Problem
As reported in carpentries/workbench#62, if someone writes a closing div fence that is more than 80 characters wide, they encounter an error of a missing div tag.
I can construct a reproducible example that demonstrates this pattern with 91 closing colons:
Created on 2023-06-29 with reprex v2.0.2
Explanation
The reason for this is because the regex (yes, we use regex for this 😨) caps the number of colons at 80 (important part is
[:]{3,80}$
):pegboard/R/div.R
Lines 658 to 660 in 3b06f45
Note, however that this cap is NOT present in the opening div regex (which is even more horrifying than the previous; so much so that it needs 20 lines of explanation) (important part is
[:]{3,}
):pegboard/R/div.R
Line 655 in 3b06f45
The text was updated successfully, but these errors were encountered: