mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-01 07:49:43 +02:00
fix(theme-classic): code block wrap mode should allow wrapping in the middle of a word (#7551)
This commit is contained in:
parent
abe5450526
commit
17fe43ecc8
1 changed files with 3 additions and 0 deletions
|
@ -69,6 +69,9 @@ export function useCodeWordWrap(): {
|
|||
codeElement.removeAttribute('style');
|
||||
} else {
|
||||
codeElement.style.whiteSpace = 'pre-wrap';
|
||||
// When code wrap is enabled, we want to avoid a scrollbar in any case
|
||||
// Ensure that very very long words/strings/tokens still wrap
|
||||
codeElement.style.overflowWrap = 'anywhere';
|
||||
}
|
||||
|
||||
setIsEnabled((value) => !value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue