Skip to content

fix: improve word breaking for code blocks in markdown - #2636

Merged
sy-records merged 2 commits into
docsifyjs:developfrom
sy-records:fix/2635
Nov 28, 2025
Merged

sy-records merged 2 commits into
docsifyjs:developfrom
sy-records:fix/2635

Conversation

@sy-records

Copy link
Copy Markdown
Member

Summary

Related issue, if any:

Fix #2635

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

For any code change,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed

Does this PR introduce a breaking change?

  • Yes
  • No

Tested in the following browsers:

  • Chrome
  • Firefox
  • Safari
  • Edge
@vercel

vercel Bot commented Nov 26, 2025

Copy link
Copy Markdown

@sy-records is attempting to deploy a commit to the Docsify Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Nov 26, 2025 •

Copy link
Copy Markdown

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

Project Deployment Preview Comments Updated (UTC)
docsify-preview Ready Ready Preview Comment Nov 27, 2025 5:09am

Copilot AI left a comment

Copy link
Copy Markdown

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 addresses issue #2635 by adding word-break: break-word to inline code blocks and samp elements to improve text wrapping behavior in markdown content, preventing overflow issues with long unbroken text in code elements.

Key changes:

  • Added word-break: break-word CSS property to code and samp elements in markdown styling

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

Comment thread src/themes/shared/_markdown.css Resolved
Comment thread src/themes/shared/_markdown.css Resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@paulhibbitts

Copy link
Copy Markdown
Member

Thanks very much @sy-records ! I've made a sandbox to test with issue codeblock and additional examples:
https://sd3x9g.csb.app/#/

Things look good, but there does not seem to be a deployment with the most recent changes for me to Approve?

@sy-records

Copy link
Copy Markdown
Member Author

I've reapproved it. Not sure why Vercel suddenly requires approval to build.

@paulhibbitts paulhibbitts left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updated deployment @sy-records . I re-tested the new build in codesandbox on desktop and mobile and all looks good:
https://sd3x9g.csb.app/#/

@sy-records
sy-records merged commit 73d41e9 into docsifyjs:develop Nov 28, 2025
8 checks passed
@sy-records
sy-records deleted the fix/2635 branch November 28, 2025 13:56
@trusktr

trusktr commented Dec 4, 2025 •

Copy link
Copy Markdown
Member

What exactly does this do? Can you post before/after shots?

@sy-records

Copy link
Copy Markdown
Member Author
before after
image image
@sy-records sy-records mentioned this pull request Jul 3, 2026

This branch was successfully deployed

1 active deployment
Preview — 89607555 Deployed Nov 27, 2025 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants