Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attributes are removed from HTML tags in translations #54

Open
theRobinator opened this issue May 31, 2019 · 2 comments · May be fixed by #58
Open

Attributes are removed from HTML tags in translations #54

theRobinator opened this issue May 31, 2019 · 2 comments · May be fixed by #58

Comments

@theRobinator
Copy link

Minimal reproduction in a test case:

import {I18n} from '@ngx-translate/i18n-polyfill';
import {MissingTranslationStrategy} from '@angular/core';

describe('i18n-polyfill', () => {
    it('keeps attributes around', () => {
        const translate = new I18n('xlf', '', 'en-US', MissingTranslationStrategy.Ignore);
        const str = `It's <span class="blue">you</span> versus <span class="red">them</span>!`;
        const result = translate(str);
        expect(result).toBe(str);
    });
});

This test fails with:

Expected 'It's <span>you</span> versus <span>them</span>!' to be 'It's <span class="blue">you</span> versus <span class="red">them</span>!'.
@JoniJnm
Copy link

JoniJnm commented Jan 13, 2020

Can this be merged?

@hugo-valcourt
Copy link

Same problem here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants