qTranslate-Team / qtranslate-x

Wordpress plugin: Adds user-friendly and database-friendly multilingual content management and translation support.
http://qtranslatexteam.wordpress.com/about/
GNU General Public License v3.0
206 stars 149 forks source link

The shortcodes are not escaped when saving #31

Open mweimerskirch opened 9 years ago

mweimerskirch commented 9 years ago

The following is a minor issue I noticed while digging through the code. The original qtranslate used HTML comments as separation characters:

<!--:en-->.....<!--:-->

A big advantage of this notation was that if you happened to use this notation in the WYIWYG editor, it would be escaped automatically and saved correctly:

&lt;!--:el--&gt;.....&lt;!--:--&gt;

qtranslate-x uses the shorter versions:

[:en]......

When entered manually in the WYSIWYG editor (e.g. if you want to write an article about qtranslate-x), the codes disappear when saving, because they are not escaped.

On a related note, the original qtranslate codes disappear as well (which didn't happen with the original version). This might be because the "split_regex" handles both separators at the same time.

johnclause commented 9 years ago

I never expected people to use Visual Mode to enter language tags ... It is a good point, we indeed should escape them. Or just tell people not to use visual mode in such case and escape tags manually?

This seems to be a very rare case? We would fix 0.0001% of people and will slow down a little bit all for the sake of convenience of a few?

camaech commented 8 years ago

I've run into this issue as well. Could really use a workaround for the visual editor and shortcodes.

[contentbox background="#5698b0" padding="10px 10px 10px 10px"] English [/contentbox]

[contentbox background="#5698b0" padding="10px 10px 10px 10px"] Spanish [/contentbox]

This does not work as expected. It appears to only save one version (or perhaps the last saved version is applied to both languages)