Check out the LimeSurvey source code on GitHub!

Can't remove unwanted line break on 2nd language

More
4 years 4 months ago #85368 by jay_ar
I'm working on a bilingual (English and Spanish) survey, and I'm getting a weird unwanted behavior out of LS. Hopefully someone around here knows what's going on, and how to fix it.

I'm using LS v. 1.92+ build 120909, both on my PC (running XP) and on an online server (Linux shared server on 1and1.com). On both of them happens the same thing: I added some javascript code to the group description, to display the language selector only if the user wants it. The [source] on the English version shows only the script (as it should). However, when I check the source of the Spanish version, there's always a page break ( <br />) BEFORE the code. I have tried deleting the <br /> time and time again, but to no avail. After I save the question and open it again, the line break comes back.

Any idea why is this happening?
Thanks!
Attachments:

Please Log in to join the conversation.

More
4 years 4 months ago #85369 by jay_ar
(Tried editing the post but apparently it didn't work)

I just confirmed the same behavior is present using different languages and templates. To reproduce it:
- Create a new survey in more than one language
- Add a question group to it
- Edit the "description" source code in each language, adding some javascript to it. (i.e. <script charset="utf-8" type="text/javascript">
alert("Test!")
}</script> )
- Save your changes
- Edit the question group' description, and compare the source between the differen languages

Please Log in to join the conversation.

More
4 years 4 months ago #85504 by tpartner
Try replacing the <br /> tag with an empty HTML element like:
<div></div>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
4 years 4 months ago #85533 by jay_ar
Thank you for replying!

Well... the empty <div> does something, but still there's a gremlin somewhere :)

(sorry for the bold font... using it to highlight comments)

For the question in Spanish, I first entered:

<script type="text/javascript" charset="utf-8">
alert ("Hello world");
</script>

When I re-opened the source code, I got:
<br />
<script type="text/javascript" charset="utf-8">
alert ("Hello world");
</script>


So... now I entered the empty <div>:
<div></div>
<script type="text/javascript" charset="utf-8">
alert ("Hello world");
</script>

...and upon re-opening the source code, I get:
<div>
 </div>
<script type="text/javascript" charset="utf-8">
alert ("Hello world");
</script>

I guess I can modify the 1st language so it looks like the 2nd one after the gremlin-induced </br>, but the question is: why do this thing appear *only* on the 2nd language?

Please Log in to join the conversation.

More
4 years 4 months ago #85548 by DenisChenu
Deactivate HTML inline editor and use HTML popup editor.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
4 years 4 months ago #85578 by jay_ar
Well... that did the trick. Thanks!

Now... when the inline editor adds some extra code for the 2nd language, is it a bug or is it the intended behavior? Or using other wording: is this something that should be reported?

Please Log in to join the conversation.

More
4 years 4 months ago #85590 by DenisChenu
Not sure, very specific usage (empty question text: only javascript).

It's more a ckeditor bug. Maybe there are some opton ti put. You can put a bug report, but it's a minor bug i think.

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form