Skip to content

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

Open
bmuenzenmeyer wants to merge 2 commits 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 2 commits 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 18, 2026 11:36pm

Request Review

@cursor

cursor Bot commented Jul 17, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Markdown-only CSS scoped to pre; no auth, data, or API changes—visual typography fix with a patch version bump.

Overview
Fixes misaligned ASCII/box-drawing diagrams in fenced code blocks (notably on Windows) by scoping a system monospace font stack to pre in markdown.css, instead of IBM Plex Mono for those blocks.

The override only redefines --font-ibm-plex-mono inside pre, so inline code and the rest of the UI still use Plex. @node-core/ui-components is bumped 1.7.2 → 1.7.3 for the release.

Reviewed by Cursor Bugbot for commit 976454f. 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.56%. Comparing base (2335df8) to head (976454f).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9015   +/-   ##
=======================================
  Coverage   74.55%   74.56%           
=======================================
  Files         100      100           
  Lines        8801     8803    +2     
  Branches      325      324    -1     
=======================================
+ Hits         6562     6564    +2     
  Misses       2235     2235           
  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%)

@avivkeller

Copy link
Copy Markdown
Member

@bmuenzenmeyer can you bump ui-components up a patch

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