-
Notifications
You must be signed in to change notification settings - Fork 93
[EditInPlace] Fix bad HTML generation when there is HTML in the translation #259
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
Conversation
(too bad phpcsfixer is not part of the project)
|
This is going to fix #141. |
rvanlaak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure wo don't want contenttools to support certain html tags?
http://getcontenttools.com/demo
If so, it would be a pity that we can't support html translations. Disabling it for edit in place in that case is better as trying to support it.
|
You are right, we support HTML translations (we try to), as shown in the documentation: https://php-translation.readthedocs.io/en/latest/symfony/edit-in-place.html#the-editor-toolbox-for-html symfony-bundle/Resources/public/js/editInPlace.js Lines 57 to 61 in 5955660
So the implementation is broken when the HTML contains attributes. Just pushed another way to fix this that works with HTML translations! 👏 Thanks for your input @rvanlaak ! |
|
Thank you |
…lation (php-translation#259) * [EditInPlace] Do not replace HTML translation with <x-trans> tag * Fix the Coding Style as suggested by StyleCi (too bad phpcsfixer is not part of the project) * Instead of disabling HTML translations, just generate valid HTML
An error could occur when using Edit In Place with HTML in the translations:
Is was caused by the Translator, as we transform the translation to wrap them in a
x-transHTML tag, and the translation is set as an attribute of that tag, the bundle was building invalid HTML.This PR remove the ability to Edit In Place a translation where HTML has been put, and also add tests.This PR fix the generated HTML output and adds tests.