Did you clear cache before opening an issue?
Is there an existing issue for this?
Does the issue happen when logged in?
Yes
Does the issue happen when logged out?
No
Does the issue happen in incognito mode when logged in?
Yes
Does the issue happen in incognito mode when logged out?
No
Account name
bijanmurmu
Account config
{"theme":"serika_dark","themeLight":"serika","themeDark":"serika_dark","autoSwitchTheme":false,"customTheme":false,"customThemeColors":["#323437","#e2b714","#e2b714","#646669","#2c2e31","#d1d0c5","#ca4754","#7e2a33","#ca4754","#7e2a33"],"favThemes":[],"showKeyTips":true,"smoothCaret":"medium","codeUnindentOnBackspace":false,"quickRestart":"off","punctuation":false,"numbers":false,"words":25,"time":15,"mode":"time","quoteLength":[1],"language":"english","fontSize":2,"freedomMode":false,"difficulty":"normal","blindMode":false,"quickEnd":false,"caretStyle":"default","paceCaretStyle":"default","flipTestColors":false,"layout":"default","funbox":[],"confidenceMode":"off","indicateTypos":"off","compositionDisplay":"replace","timerStyle":"mini","liveSpeedStyle":"off","liveAccStyle":"off","liveBurstStyle":"off","colorfulMode":false,"randomTheme":"off","timerColor":"main","timerOpacity":"1","stopOnError":"off","showAllLines":false,"keymapMode":"off","keymapStyle":"staggered","keymapLegendStyle":"lowercase","keymapLayout":"overrideSync","keymapShowTopRow":"layout","keymapSize":1,"fontFamily":"Roboto_Mono","smoothLineScroll":false,"alwaysShowDecimalPlaces":false,"alwaysShowWordsHistory":false,"singleListCommandLine":"on","capsLockWarning":true,"playSoundOnError":"off","playSoundOnClick":"off","soundVolume":0.5,"startGraphsAtZero":true,"showOutOfFocusWarning":true,"paceCaret":"off","paceCaretCustomSpeed":100,"repeatedPace":true,"accountChart":["on","on","on","on"],"minWpm":"off","minWpmCustomSpeed":100,"highlightMode":"letter","typedEffect":"keep","typingSpeedUnit":"wpm","ads":"result","hideExtraLetters":false,"strictSpace":false,"minAcc":"off","minAccCustom":90,"monkey":false,"repeatQuotes":"off","resultSaving":true,"oppositeShiftMode":"off","customBackground":"","customBackgroundSize":"cover","customBackgroundFilter":[0,1,1,1],"customLayoutfluid":["qwerty","dvorak","colemak"],"customPolyglot":["english","spanish","french","german"],"monkeyPowerLevel":"off","minBurst":"off","minBurstCustomSpeed":100,"burstHeatmap":false,"britishEnglish":false,"lazyMode":false,"showAverage":"off","showPb":false,"tapeMode":"off","tapeMargin":50,"maxLineWidth":0,"playTimeWarning":"off"}
Current Behavior
If a user adds a newline in their bio but leaves spaces around it (for example, "Hello \n \n World"), the sanitizeString function collapses the content into a single line.
This happens because the regex /\s{3,}/g matches newline characters in addition to spaces, causing intended line breaks to be removed.
Expected Behavior
The sanitizeString function should only collapse consecutive horizontal whitespace (spaces and tabs) while preserving intentional newlines.
Multiple consecutive newlines (3+) should continue to be handled by the existing newline-specific sanitization logic.
Steps To Reproduce
- Navigate to the profile settings page.
- Edit your bio.
- Enter text, add a space, press Enter, add another space, then enter more text.
- Save the profile.
- Observe that the newline is removed and the text is merged into a single line.
Environment
- OS: Windows 11
- Browser: Google Chrome
- Browser Version: 148.0.7778.217 (Official Build) (64-bit)
Anything else?
How I faced it: I noticed some user bios had their paragraphs completely merged into one line unintentionally. I checked the sanitizeString logic and saw the \s regex was the culprit. I would love to submit a PR to fix this if approved!
Did you clear cache before opening an issue?
Is there an existing issue for this?
Does the issue happen when logged in?
Yes
Does the issue happen when logged out?
No
Does the issue happen in incognito mode when logged in?
Yes
Does the issue happen in incognito mode when logged out?
No
Account name
bijanmurmu
Account config
{"theme":"serika_dark","themeLight":"serika","themeDark":"serika_dark","autoSwitchTheme":false,"customTheme":false,"customThemeColors":["#323437","#e2b714","#e2b714","#646669","#2c2e31","#d1d0c5","#ca4754","#7e2a33","#ca4754","#7e2a33"],"favThemes":[],"showKeyTips":true,"smoothCaret":"medium","codeUnindentOnBackspace":false,"quickRestart":"off","punctuation":false,"numbers":false,"words":25,"time":15,"mode":"time","quoteLength":[1],"language":"english","fontSize":2,"freedomMode":false,"difficulty":"normal","blindMode":false,"quickEnd":false,"caretStyle":"default","paceCaretStyle":"default","flipTestColors":false,"layout":"default","funbox":[],"confidenceMode":"off","indicateTypos":"off","compositionDisplay":"replace","timerStyle":"mini","liveSpeedStyle":"off","liveAccStyle":"off","liveBurstStyle":"off","colorfulMode":false,"randomTheme":"off","timerColor":"main","timerOpacity":"1","stopOnError":"off","showAllLines":false,"keymapMode":"off","keymapStyle":"staggered","keymapLegendStyle":"lowercase","keymapLayout":"overrideSync","keymapShowTopRow":"layout","keymapSize":1,"fontFamily":"Roboto_Mono","smoothLineScroll":false,"alwaysShowDecimalPlaces":false,"alwaysShowWordsHistory":false,"singleListCommandLine":"on","capsLockWarning":true,"playSoundOnError":"off","playSoundOnClick":"off","soundVolume":0.5,"startGraphsAtZero":true,"showOutOfFocusWarning":true,"paceCaret":"off","paceCaretCustomSpeed":100,"repeatedPace":true,"accountChart":["on","on","on","on"],"minWpm":"off","minWpmCustomSpeed":100,"highlightMode":"letter","typedEffect":"keep","typingSpeedUnit":"wpm","ads":"result","hideExtraLetters":false,"strictSpace":false,"minAcc":"off","minAccCustom":90,"monkey":false,"repeatQuotes":"off","resultSaving":true,"oppositeShiftMode":"off","customBackground":"","customBackgroundSize":"cover","customBackgroundFilter":[0,1,1,1],"customLayoutfluid":["qwerty","dvorak","colemak"],"customPolyglot":["english","spanish","french","german"],"monkeyPowerLevel":"off","minBurst":"off","minBurstCustomSpeed":100,"burstHeatmap":false,"britishEnglish":false,"lazyMode":false,"showAverage":"off","showPb":false,"tapeMode":"off","tapeMargin":50,"maxLineWidth":0,"playTimeWarning":"off"}
Current Behavior
If a user adds a newline in their bio but leaves spaces around it (for example,
"Hello \n \n World"), thesanitizeStringfunction collapses the content into a single line.This happens because the regex
/\s{3,}/gmatches newline characters in addition to spaces, causing intended line breaks to be removed.Expected Behavior
The
sanitizeStringfunction should only collapse consecutive horizontal whitespace (spaces and tabs) while preserving intentional newlines.Multiple consecutive newlines (3+) should continue to be handled by the existing newline-specific sanitization logic.
Steps To Reproduce
Environment
Anything else?
How I faced it: I noticed some user bios had their paragraphs completely merged into one line unintentionally. I checked the
sanitizeStringlogic and saw the\sregex was the culprit. I would love to submit a PR to fix this if approved!