mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-06 10:20:09 +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');
|
codeElement.removeAttribute('style');
|
||||||
} else {
|
} else {
|
||||||
codeElement.style.whiteSpace = 'pre-wrap';
|
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);
|
setIsEnabled((value) => !value);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue