Title: util: styleText restores overridden color after nested style when format is an array · Issue #67746 · nodejs/node · GitHub
Open Graph Title: util: styleText restores overridden color after nested style when format is an array · Issue #67746 · nodejs/node
X Title: util: styleText restores overridden color after nested style when format is an array · Issue #67746 · nodejs/node
Description: Version v26.13.0 Platform Microsoft Windows NT 10.0.19045.0 x64 Subsystem util What steps will reproduce the bug? node -p "util.styleText(['red', 'green'], 'a' + util.styleText('blue', 'b') + 'a')" How often does it reproduce? Is there a...
Open Graph Description: Version v26.13.0 Platform Microsoft Windows NT 10.0.19045.0 x64 Subsystem util What steps will reproduce the bug? node -p "util.styleText(['red', 'green'], 'a' + util.styleText('blue', 'b') + 'a')"...
X Description: Version v26.13.0 Platform Microsoft Windows NT 10.0.19045.0 x64 Subsystem util What steps will reproduce the bug? node -p "util.styleText(['red', 'green'], 'a' + util.s...
Opengraph URL: https://github.com/nodejs/node/issues/67746
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"util: styleText restores overridden color after nested style when format is an array","articleBody":"### Version\n\nv26.13.0\n\n### Platform\n\n```text\nMicrosoft Windows NT 10.0.19045.0 x64\n```\n\n### Subsystem\n\nutil\n\n### What steps will reproduce the bug?\n\n```bash\nnode -p \"util.styleText(['red', 'green'], 'a' + util.styleText('blue', 'b') + 'a')\"\n```\n\n### How often does it reproduce? Is there a required condition?\n\nalways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nBoth `'a'` characters (before and after the nested blue `'b'`) should be colored **green** (`\\u001b[32m`).\n\nThis works correctly in chalk:\n\n```js\nimport chalk from 'chalk';\n\nconsole.log(chalk.red.green('a' + chalk.blue('b') + 'a'));\n```\n\n### What do you see instead?\n\nThe first `a` is green (\\u001b[32m), `b` is blue (\\u001b[34m), and the second `a` is red (\\u001b[31m):\n\n\n### Additional information\n\nMay be related https://github.com/nodejs/node/pull/59098","author":{"url":"https://github.com/outslept","@type":"Person","name":"outslept"},"datePublished":"2026-11-24T12:24:10Z","url":"https://github.com/nodejs/node/issues/67746"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7e2a670a-c227-6661-503e-49647da90ec6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D52C:128099:624756:835F67:6B062882 |
| html-safe-nonce | f501216ec0d50dbd22ff1f9bf51ac1becbf7ddc7e8d281b9cd8ac961f9936832 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENTJDOjEyODA5OTo2MjQ3NTY6ODM1RjY3OjZCMDYyODgyIiwidmlzaXRvcl9pZCI6IjE4NDA3MDE4NjI0ODg0NTEyMDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d21c107c2a25b61923af456604a88993b6a7c0ea47abfc6fc5f1332441a9bd15 |
| hovercard-subject-tag | issue:6581712927 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/67746/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fffe1d7c076f3082a05e534f6320a2a76a9b958155bed0f9047c5ea1f8fc5920/nodejs/node/issues/67746 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fffe1d7c076f3082a05e534f6320a2a76a9b958155bed0f9047c5ea1f8fc5920/nodejs/node/issues/67746 |
| og:image:alt | Version v26.13.0 Platform Microsoft Windows NT 10.0.19045.0 x64 Subsystem util What steps will reproduce the bug? node -p "util.styleText(['red', 'green'], 'a' + util.styleText('blue', 'b') + 'a')"... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | outslept |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9e10bb0ecc0bd0f8692aa89586ee9b54e498d7ab9f244a44cdb5b93653a125ce |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 32e57d5cc2ce6ce92ec6dceb65858344750c27c2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width