-
Notifications
You must be signed in to change notification settings - Fork 26
Fix: downlit_html_*() keeps all pre classes
#160
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
base: main
Are you sure you want to change the base?
Conversation
|
Test failures are unrelated to this PR. |
|
|
||
| text <- xml2::xml_text(nodes) | ||
| replacement <- map_chr(text, fun, ...) | ||
| replacement <- unlist(lapply(seq_along(nodes), function(x) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could simplify this code by adding pre_class as an explicit argument to tweak_children() — then you don't need to go through gymnastics to figure out whether or not it's set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand. If I add an explicit argument pre_class in tweak_children(), then I will have to check whether this argument is NULL (or FALSE) before applying strsplit(), so I don't think this would result in a simpler code. But maybe I misunderstood you?
|
Do you have any updates? |
|
@sgvignali I don't think there's anything more I can do on my side, so I'm just waiting for someone from |
Close #149, close #156 (and v2 of #155).
downlit_html()now keeps allpreclasses, which allows for customization of code blocks inpkgdownusing chunk optionsclass.sourceandattr.source.Current behavior (
.my-classand.another-classare dropped):New behavior: