Skip to content

fix(markdown): update monospace font-face for preformatted code blocks on Windows#9015

Open
bmuenzenmeyer wants to merge 1 commit into
mainfrom
test-windows-text-table-characters
Open

fix(markdown): update monospace font-face for preformatted code blocks on Windows#9015
bmuenzenmeyer wants to merge 1 commit into
mainfrom
test-windows-text-table-characters

Conversation

@bmuenzenmeyer

@bmuenzenmeyer bmuenzenmeyer commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

At @avivkeller's suggestion nodejs/doc-kit#910 could be fixed upstream in ui-components, so as to improve all usages

Validation

Setup: add this to any markdown on the site

### 909 Debug Test

```text
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                              href                                              │
├──────────┬──┬─────────────────────┬────────────────────────┬───────────────────────────┬───────┤
│ protocol │  │        auth         │          host          │           path            │ hash  │
│          │  │                     ├─────────────────┬──────┼──────────┬────────────────┤       │
│          │  │                     │    hostname     │ port │ pathname │     search     │       │
│          │  │                     │                 │      │          ├─┬──────────────┤       │
│          │  │                     │                 │      │          │ │    query     │       │
"  https:   //    user   :   pass   @ sub.example.com : 8080   /p/a/t/h  ?  query=string   #hash "
│          │  │          │          │    hostname     │ port │          │                │       │
│          │  │          │          ├─────────────────┴──────┤          │                │       │
│ protocol │  │ username │ password │          host          │          │                │       │
├──────────┴──┼──────────┴──────────┼────────────────────────┤          │                │       │
│   origin    │                     │         origin         │ pathname │     search     │ hash  │
├─────────────┴─────────────────────┴────────────────────────┴──────────┴────────────────┴───────┤
│                                              href                                              │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
(All spaces in the "" line should be ignored. They are purely for formatting.)

Before

image

After

image

Related Issues

Closes nodejs/doc-kit#909
Closes nodejs/doc-kit#910

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run pnpm format to ensure the code follows the style guide.
  • I have run pnpm test to check if all tests are passing.
  • I have run pnpm build to check if the website builds without errors.
  • I've covered new added functionality with unit tests if necessary.

@bmuenzenmeyer
bmuenzenmeyer requested a review from a team as a code owner July 17, 2026 21:21
Copilot AI review requested due to automatic review settings July 17, 2026 21:21
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
nodejs-org Ready Ready Preview Jul 17, 2026 9:21pm

Request Review

@cursor

cursor Bot commented Jul 17, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Scoped CSS variable override in markdown styles only; no auth, data, or application logic changes.

Overview
Fenced markdown code blocks (pre) now override --font-ibm-plex-mono with a system monospace stack (SF Mono, Menlo, Consolas, etc.) so ASCII diagrams with Unicode box-drawing characters stay column-aligned on Windows.

IBM Plex Mono is still used for inline code and other UI; only content inside markdown pre picks up the stack, matching how nodejs.org already renders diagrams and addressing doc-kit #909.

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

@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.61%. Comparing base (2335df8) to head (412acb1).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9015      +/-   ##
==========================================
+ Coverage   74.55%   74.61%   +0.05%     
==========================================
  Files         100      100              
  Lines        8801     8801              
  Branches      325      325              
==========================================
+ Hits         6562     6567       +5     
+ Misses       2235     2230       -5     
  Partials        4        4              

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts Markdown fenced code block typography so box-drawing/ASCII-art diagrams render with consistent character widths on Windows by switching those blocks to a system monospace font stack (instead of IBM Plex Mono) via a scoped CSS variable override.

Changes:

  • Override --font-ibm-plex-mono within pre to a system monospace stack to avoid per-glyph fallback width mismatches on Windows.
  • Add detailed rationale in markdown.css explaining the box-drawing glyph issue and why the override is scoped to pre.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Build Size Comparison

Summary

Metric Value
Old Total First Load JS 10.64 MB
New Total First Load JS 10.64 MB
Delta 0 B (0.00%)

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.

Possible bug on Windows 25H2

5 participants