diff options
author | Philip Chimento <philip@endlessm.com> | 2015-06-18 13:57:53 -0700 |
---|---|---|
committer | Philip Chimento <philip@endlessm.com> | 2015-06-18 13:57:53 -0700 |
commit | a2fe0c90e6cbc4d95f772f945833e5dd4255dca8 (patch) | |
tree | babfa9a46e58106e556a0e224b3ef753a04b628b /test | |
parent | 0e2e2b25766b33e98860b59d1363be528477519d (diff) |
Handle quotes in HTML strings
When generating the .dummy.c file, eos-html-extractor previously did not
escape quotes correctly.
[endlessm/eos-sdk#3291]
Diffstat (limited to 'test')
-rw-r--r-- | test/tools/test.html | 1 | ||||
-rw-r--r-- | test/tools/testHtmlExtractor.js | 4 | ||||
-rw-r--r-- | test/webhelper/testTranslate2.js | 5 |
3 files changed, 9 insertions, 1 deletions
diff --git a/test/tools/test.html b/test/tools/test.html index 9f7e341..6687013 100644 --- a/test/tools/test.html +++ b/test/tools/test.html @@ -19,6 +19,7 @@ This is a string that is spread over multiple lines, but that doesn't matter to HTML. </p> + <span name="translatable">String with a "quote"</span> </section> </body> </html> diff --git a/test/tools/testHtmlExtractor.js b/test/tools/testHtmlExtractor.js index 88215ef..7d622e1 100644 --- a/test/tools/testHtmlExtractor.js +++ b/test/tools/testHtmlExtractor.js @@ -9,7 +9,9 @@ _("My Bü∂get");\n\ #line 13 "test/tools/test.html"\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' +_("This is a string that is spread over multiple lines, but that doesn\'t matter to HTML.");\n\ +#line 22 "test/tools/test.html"\n\ +_("String with a \\"quote\\"");\n'; describe('eos-html-extractor', function () { it('works correctly at a minimum', function () { diff --git a/test/webhelper/testTranslate2.js b/test/webhelper/testTranslate2.js index 207f3b5..9cb7042 100644 --- a/test/webhelper/testTranslate2.js +++ b/test/webhelper/testTranslate2.js @@ -145,6 +145,11 @@ describe('WebHelper2 translator', function () { </p>'); expect(gettext_spy).toHaveBeenCalledWith('Translate Me'); }); + + it('handles quotes correctly', function () { + run_loop('<p name="translatable">String with "quotes"</p>'); + expect(gettext_spy).toHaveBeenCalledWith('String with "quotes"'); + }); }); describe('used from client-side Javascript', function () { |