Skip to content

shiki: add HTML and CSS language support#884

Open
InukaWijerathna wants to merge 1 commit into
nodejs:mainfrom
InukaWijerathna:customize-shiki-html-css
Open

shiki: add HTML and CSS language support#884
InukaWijerathna wants to merge 1 commit into
nodejs:mainfrom
InukaWijerathna:customize-shiki-html-css

Conversation

@InukaWijerathna

@InukaWijerathna InukaWijerathna commented Jul 5, 2026

Copy link
Copy Markdown

Summary

Registers the HTML and CSS Shiki grammars in shiki.config.mjs so fenced code blocks using these languages are picked up and syntax highlighted, as requested in #844.

Test plan

  • Built a highlighter with the updated config and rendered sample html/css snippets through codeToHtml — confirmed correctly colored output for both languages
  • npm test — no new failures (3 pre-existing failures on this checkout are unrelated Windows path-separator issues, reproducible on main as well)
  • npm run lint — clean (pre-existing unrelated warnings only)

Registers the HTML and CSS Shiki grammars in shiki.config.mjs so
fenced code blocks using these languages are syntax highlighted.

Refs: nodejs#844
@InukaWijerathna InukaWijerathna requested a review from a team as a code owner July 5, 2026 14:41
@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-docs-tooling Ready Ready Preview Jul 5, 2026 2:42pm

Request Review

@cursor

cursor Bot commented Jul 5, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Config-only addition of two Shiki language bundles with no auth, data, or runtime logic changes.

Overview
Extends the API docs Shiki highlighter so fenced html and css blocks get proper grammar-based highlighting instead of plain text.

shiki.config.mjs imports shiki/langs/html.mjs and shiki/langs/css.mjs and registers both in the existing langs list alongside the other API-doc languages.

Reviewed by Cursor Bugbot for commit 14512a6. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.00%. Comparing base (9c5f11f) to head (14512a6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #884   +/-   ##
=======================================
  Coverage   85.00%   85.00%           
=======================================
  Files         179      179           
  Lines       16453    16457    +4     
  Branches     1491     1492    +1     
=======================================
+ Hits        13986    13990    +4     
  Misses       2457     2457           
  Partials       10       10           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@avivkeller

Copy link
Copy Markdown
Member

While it's good to add these langs, this doesn't close the mentioned issue, since it doesn't allow users to customize the Shiki config

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.

2 participants