qtranslate / qtranslate-xt

qTranslate-XT (eXTended) - reviving qTranslate-X multilingual plugin for WordPress. A new community-driven plugin soon. Built-in modules for WooCommerce, ACF, slugs and others.
GNU General Public License v2.0
553 stars 104 forks source link

The shortcodes are not escaped when saving #31

Open herrvigg opened 6 years ago

herrvigg commented 6 years ago

Issue by mweimerskirch Monday Feb 23, 2015 at 22:38 GMT Originally opened as https://github.com/qTranslate-Team/qtranslate-x/issues/31


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.

herrvigg commented 6 years ago

Comment by johnclause Tuesday Feb 24, 2015 at 00:36 GMT


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?

herrvigg commented 6 years ago

Comment by camaech Thursday Mar 10, 2016 at 16:07 GMT


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)