Fix: downlit_html_*() keeps all pre classes#160
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.
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.
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 |
|
Apologies for necroing this old PR and related issue, but I have been trying to fix a failing WCAG check and found this. Current accessibility standards state that scrollable elements need a tabindex to allow keyboard focus and scrolling. Given that downlit removes any user-added https://dequeuniversity.com/rules/axe-devtools/4.6/scrollable-region-focusable Output from the AC Lite 1.0.7 Accessibility Checker extension for Chrome |

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: