path: root/test/tools
diff options
authorPhilip Chimento <>2015-06-18 13:53:01 -0700
committerPhilip Chimento <>2015-06-18 13:53:01 -0700
commit0e2e2b25766b33e98860b59d1363be528477519d (patch)
treefa2e6fea86af4db60c885433fd10cfb1d8466cdb /test/tools
parentb290a1214d0e78fb0a613b232b15d3e423292e1e (diff)
Handle excess whitespace in strings
Whitespace between words and tags doesn't matter to HTML. Indeed, the text in a translatable element may be formatted any way over any number of lines, so we normalize all consecutive whitespace to be just one space character and strip whitespace from the beginning and end of the strings. This is so that translators are not confronted with strange newlines and whitespace on Transifex. [endlessm/eos-sdk#3291]
Diffstat (limited to 'test/tools')
2 files changed, 7 insertions, 1 deletions
diff --git a/test/tools/test.html b/test/tools/test.html
index 4dfda70..9f7e341 100644
--- a/test/tools/test.html
+++ b/test/tools/test.html
@@ -15,6 +15,10 @@
<nav id="finance-nav">
+ <p name="translatable">
+ This is a string that is spread over multiple lines,
+ but that doesn't matter to HTML.
+ </p>
diff --git a/test/tools/testHtmlExtractor.js b/test/tools/testHtmlExtractor.js
index 4f46706..88215ef 100644
--- a/test/tools/testHtmlExtractor.js
+++ b/test/tools/testHtmlExtractor.js
@@ -7,7 +7,9 @@ _("Finance Builder");\n\
// TRANSLATORS: This is a test of UTF-8 encoded characters\n\
_("My Bü∂get");\n\
#line 13 "test/tools/test.html"\n\
-_("Choose a template");\n';
+_("Choose a template");\n\
+#line 21 "test/tools/test.html"\n\
+_("This is a string that is spread over multiple lines, but that doesn\'t matter to HTML.");\n'
describe('eos-html-extractor', function () {
it('works correctly at a minimum', function () {