From 5bf228babb97f0ae123e7fb5fd74e49555a64c96 Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Tue, 9 Apr 2024 18:00:01 +0200 Subject: [PATCH 1/2] Fixing atom to capitalize text Credit to @whimboo Fixes #13779 --- javascript/atoms/dom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/atoms/dom.js b/javascript/atoms/dom.js index 6a46cff410fe5..1f521f06a99a5 100644 --- a/javascript/atoms/dom.js +++ b/javascript/atoms/dom.js @@ -1173,7 +1173,7 @@ bot.dom.appendVisibleTextLinesFromTextNode_ = function(textNode, lines, if (textTransform == 'capitalize') { // the unicode regex ending with /gu does not work in IE - var re = goog.userAgent.IE ? /(^|\s|\b)(\S)/g : /(^|[^\d\p{L}\p{S}])([\p{Ll}|\p{S}])/gu; + var re = goog.userAgent.IE ? /(^|\s|\b)(\S)/g : /(^|\s|\b)(\S)/gu; text = text.replace(re, function() { return arguments[1] + arguments[2].toUpperCase(); }); From 6e123c9375988b002ea3c3f9a8c2aa638175043a Mon Sep 17 00:00:00 2001 From: Diego Molina Date: Wed, 10 Apr 2024 11:18:40 +0000 Subject: [PATCH 2/2] Adding a test --- javascript/atoms/test/text_test.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/javascript/atoms/test/text_test.html b/javascript/atoms/test/text_test.html index 14f40c53b4d59..5620902711039 100644 --- a/javascript/atoms/test/text_test.html +++ b/javascript/atoms/test/text_test.html @@ -280,6 +280,8 @@ assertEquals('(This) “Is” [A] –Short– -Test- «For» *The* _Css_ ¿Capitalize? ?¡Transfor', text); text = getVisibleTextByElementId("capitalized-8"); assertEquals('The Dutch Word: "Ijsland" Starts With A Digraph', text); + text = getVisibleTextByElementId("capitalized-9"); + assertEquals('Test_text', text); } function getVisibleTextByElementId(id) { @@ -430,6 +432,7 @@ ⓐⓑⓒ (ⓓⓔⓕ) —ⓖⓗⓘ— ⓙkl
(this) “is” [a] –short– -test- «for» *the* _css_ ¿capitalize? ?¡transfor
The Dutch word: "ijsland" starts with a digraph
+ test_text