Skip to content

Conversation

toshimaru
Copy link
Member

@toshimaru toshimaru commented Sep 28, 2025

This pull request updates third-party dependencies and improves how scripts are initialized on the site. The main changes are version upgrades for highlight.js and anchor-js, and a refactor of the script initialization to use modern event listeners.

Dependency Upgrades:

  • Upgraded highlight.js from version 11.9.0 to 11.11.1 in both the stylesheet and script includes in default.html for improved syntax highlighting and bug fixes. [1] [2]
  • Upgraded anchor-js from version 4.3.1 to 5.0.0 in default.html for better anchor link support and security improvements.

Script Initialization Improvements:

  • Refactored anchor-js initialization in app.js to use DOMContentLoaded instead of jQuery’s document ready, ensuring compatibility with modern browsers and best practices.
  • Kept highlight.js initialization under jQuery’s document ready for legacy compatibility.

@toshimaru toshimaru changed the title Bump anchor.js from 4.3 to 5.0 Bump anchor.js from 4.3 to 5.0 / Bump highlight.js from 11.9 to 11.11 Sep 28, 2025
@toshimaru toshimaru marked this pull request as ready for review September 28, 2025 07:02
@Copilot Copilot AI review requested due to automatic review settings September 28, 2025 07:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates two JavaScript dependencies (highlight.js and anchor.js) to their latest versions and modernizes the anchor.js initialization to use native DOM events instead of jQuery.

  • Upgraded highlight.js from 11.9.0 to 11.11.1 for improved syntax highlighting
  • Upgraded anchor.js from 4.3.1 to 5.0.0 for better anchor link functionality
  • Refactored anchor.js initialization to use DOMContentLoaded event listener instead of jQuery's document ready

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/_layouts/default.html Updates CDN links for highlight.js and anchor.js to newer versions
src/assets/js/app.js Separates anchor.js initialization to use native DOM events while keeping highlight.js under jQuery

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@toshimaru toshimaru enabled auto-merge September 28, 2025 07:04
@toshimaru toshimaru merged commit 38fd2fc into railsdoc:main Sep 28, 2025
11 checks passed
@toshimaru toshimaru deleted the update-libraries-20250928 branch September 28, 2025 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant