Open jonathansampson opened 3 years ago
I was thinking maybe I'd do a little
diff --git a/browser/resources/settings/brave_sync_page/brave_sync_code_dialog.js b/browser/resources/settings/brave_sync_page/brave_sync_code_dialog.js
index 78e2091a7f..04d22124cc 100644
--- a/browser/resources/settings/brave_sync_page/brave_sync_code_dialog.js
+++ b/browser/resources/settings/brave_sync_page/brave_sync_code_dialog.js
@@ -83,7 +83,7 @@ Polymer({
if (!this.syncCode) {
return 0
}
- return this.syncCode.trim().split(' ').length
+ return this.syncCode.trim().split(/\s+/g).length
},
isCodeType: function(askingType) {
But... I don't know where syncCode
is actually used to make sure that it's treated likewise is those places.
Sidenote: the code is inconsistently formatted - needs a .prettierrc.json
Description
Brave now trims sync code strings of leading and trailing whitespace. However, Brave still expects a single space between each word.
Instead, Brave should permit contiguous whitespace (such as multiple spaces and/or new lines) between words.
Actual result:
The following is not counted as 4 words:
Desktop Brave version:
v1.25.68
Other Additional Information:
Related to #13681 and #10860.
Reported on Twitter by AJ ONeal.