Skip to content

Commit

Permalink
Unescaped translation
Browse files Browse the repository at this point in the history
Disable default HTML escape from angular-translate

Fix #1214
  • Loading branch information
Kmaschta committed Sep 29, 2016
1 parent f35c2ce commit 74b29d8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/blog/data.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/javascripts/ng-admin/Main/config/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function translate($translateProvider) {
'NOT_FOUND_DETAILS': 'The page you are looking for cannot be found. Take a break before trying again.',
});
$translateProvider.preferredLanguage('en');
$translateProvider.useSanitizeValueStrategy('sanitize');
$translateProvider.useSanitizeValueStrategy(null);
}

translate.$inject = ['$translateProvider'];
9 changes: 9 additions & 0 deletions src/javascripts/test/e2e/ListViewSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,13 @@ describe('ListView', function () {
});
});

describe('translate', () => {
it('should not escape HTML characters', () => {
const title = $$('tbody tr:last-child .ng-admin-column-title').first();

// If this title is escaped, it will be:
// Accusantium qui nihil & voluptatum quia voluptas maxime ab similique
expect(title.getText()).toBe('Accusantium qui nihil & voluptatum quia voluptas maxime ab similique');
});
});
});

0 comments on commit 74b29d8

Please sign in to comment.