Skip to content

Load the languages of embedded code in the Autoloader - #4135

Merged
DmitrySharabin merged 1 commit into
v2from
claude/autoloader-embedded-languages
Oct 1, 2026
Merged

DmitrySharabin merged 1 commit into
v2from
claude/autoloader-embedded-languages

Conversation

@DmitrySharabin

@DmitrySharabin DmitrySharabin commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

The Autoloader's complete hook now also loads the languages of tokens marked language-<id> inside the element. Markdown fences (#4133), markup <style>/<script>, and pug and haml filters mark their embedded code that way.

  • Each language loads on its own, so an unknown fence language doesn't block the others. A language that fails is reported to errorHandler once and never retried. The element is highlighted again only if something loaded, so a none fence can't loop.
  • loadLanguages keeps its public behavior. The failed ids live in the hook.
  • A data-dependencies that only names an embedded language is no longer needed, like the pug :less example in the README.
  • The failure test uses a Markdown fence, so it needs Mark fenced code blocks with their language in Markdown again #4133 merged first.
File + −
src/plugins/autoloader/autoloader.js 15 7
tests/plugins/autoloader/basic-functionality.js 35 0
src/plugins/autoloader/README.md 1 1

🤖 Generated with Claude Code

@netlify

netlify Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for dev-prismjs-com ready!

Name Link
🔨 Latest commit 20661db
🔍 Latest deploy log https://app.netlify.com/projects/dev-prismjs-com/deploys/6abe88e61b057300072c9865
😎 Deploy Preview https://deploy-preview-4135--dev-prismjs-com.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@DmitrySharabin
DmitrySharabin force-pushed the claude/autoloader-embedded-languages branch 4 times, most recently from 960c18b to 46e46fa Compare October 1, 2026 16:14
- Markdown fences, markup `<style>`/`<script>` and pug/haml filters mark embedded code with `language-<id>`;
  the Autoloader now loads those too, each on its own, and reports a failed one once

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DmitrySharabin
DmitrySharabin force-pushed the claude/autoloader-embedded-languages branch from 46e46fa to 20661db Compare October 1, 2026 16:23
@DmitrySharabin
DmitrySharabin merged commit 3b9e59d into v2 Oct 1, 2026
12 checks passed
@DmitrySharabin
DmitrySharabin deleted the claude/autoloader-embedded-languages branch October 1, 2026 16:25
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