devdocs
devdocs copied to clipboard
Fix the broken "Show source" toggle for Ruby 3.4 docs
Should fix https://github.com/freeCodeCamp/devdocs/issues/2417.
With Ruby 3.4 the documentation is generated using a different theme, which impacted the layout of the page and the classes for HTML elements. Without the change the "Source" toggle from the original doc is copied over into the the final document without doing anything, whereas the expected header "Show source" link is missing and as the result the source code cannot be viewed.
This PR updates Docs::Rdoc::CleanHtmlFilter to add a link for methods with the source and remove the superfluous "Source" toggle from the original documentation.
Manually tested on documentation from Ruby 3.3 and 3.4.