Welcome, Guest
Username: Password: Remember me

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

Can't remove unwanted line break on 2nd language 1 year 10 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.

Re: Can't remove unwanted line break on 2nd language 1 year 10 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.

Re: Can't remove unwanted line break on 2nd language 1 year 10 months ago #85504

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4068
  • Thank you received: 746
  • Karma: 341
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Can't remove unwanted line break on 2nd language 1 year 10 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.

Re: Can't remove unwanted line break on 2nd language 1 year 10 months ago #85548

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6219
  • Thank you received: 791
  • Karma: 238
Deactivate HTML inline editor and use HTML popup editor.

Denis
The administrator has disabled public write access.

Re: Can't remove unwanted line break on 2nd language 1 year 10 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.

Re: Can't remove unwanted line break on 2nd language 1 year 10 months ago #85590

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6219
  • Thank you received: 791
  • Karma: 238
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
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.148 seconds
Donation Image