fix(theme-classic): code block wrap mode should allow wrapping in the middle of a word (#7551)

This commit is contained in:
Sébastien Lorber 2022-06-02 17:40:42 +02:00 committed by GitHub
parent abe5450526
commit 17fe43ecc8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);