Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Can't remove unwanted line break on 2nd language

Can't remove unwanted line break on 2nd language 4 years 2 months ago #85368

  • jay_ar
  • jay_ar's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 14
  • Karma: 0
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:
The administrator has disabled public write access.

Can't remove unwanted line break on 2nd language 4 years 2 months ago #85369

  • jay_ar
  • jay_ar's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 14
  • Karma: 0
(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
The administrator has disabled public write access.

Can't remove unwanted line break on 2nd language 4 years 2 months ago #85504

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6568
  • Thank you received: 1477
  • Karma: 579
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.
The administrator has disabled public write access.

Can't remove unwanted line break on 2nd language 4 years 2 months ago #85533

  • jay_ar
  • jay_ar's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 14
  • Karma: 0
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?
The administrator has disabled public write access.

Can't remove unwanted line break on 2nd language 4 years 2 months ago #85548

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9572
  • Thank you received: 1374
  • Karma: 390
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 (use private message).
The administrator has disabled public write access.

Can't remove unwanted line break on 2nd language 4 years 2 months ago #85578

  • jay_ar
  • jay_ar's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 14
  • Karma: 0
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?
The administrator has disabled public write access.

Can't remove unwanted line break on 2nd language 4 years 2 months ago #85590

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9572
  • Thank you received: 1374
  • Karma: 390
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 (use private message).
The administrator has disabled public write access.
Time to create page: 0.701 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form