Problems with <p> in editor

More
4 years 5 months ago - 4 years 5 months ago #121543 by supervinnie40
Hi all,

I find that the wysiwyg editor is really annoying sometimes on Limesurvey.

I'm trying to put a piece of text in the center. Obviously I just do this via <p style="text-align: center;"> blablabla </p>
But when I click safe it changes it to: <p style="text-align: center;"> </p> blablabla.

And it's even worse if I have some sort of code in the text between the two P's.
For example:
<p style="text-align: center;">Just imagine if I wanted some <strong>bold</strong> text with a <a href=" www.link.com ">hyperlink</a> in there </p>
As soon as I press the "code" button, it changes it all into:

<p style="text-align: center;"> <strong> </strong> <a href=" www.link.com "></a> </p>Just imagine if I wanted some bold text with a hyperlink in there.


Even something simple like

<audio><source src="link-to.mp3" type="audio/mpeg"> Your browser does not support the audio tag. </source></audio>

Get's completely messed up as soon as I put <p> in front of it (ending it with </p> off course).
This is what I got after I pressed the "code" button twice:

<p style="text-align: center">
 </p>
<p style="text-align: center">
 </p>
<audio controls="">
<source src="link-to.mp3" type="audio/mpeg"> Your browser does not support the audio tag. </source></audio><source src="link-to.mp3" type="audio/mpeg"> Your browser does not support the audio tag. </source></audio></source></audio>


Why can't I just turn that ridiculous code-changing feature off? It's really frustrating. I know what I wanna do, and I know the code. But Limesurvey just keeps changing it as soon as I press "save". Why can't it just save whatever I've written, no matter what the consequence is?

Can anybody help me with this? Because I'm about done on tearing the hair from my head.
Last edit: 4 years 5 months ago by supervinnie40. Reason: typo

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
4 years 5 months ago #121559 by tpartner
I have never experienced that.

What LimeSurvey version and build?
What Browser?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
4 years 5 months ago #121571 by supervinnie40
I'm on Limesurvey 2.05+ Build 150520 and Google Chrome (which keeps updating itself when needed). Also use Win 8.1 pro as OS.

I've completely disabled the wysiwyg editor, and just work with codes now. Seems to have fixed it. But the wysiwyg editor just shouldn't do that kinda stuff.

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago - 3 years 7 months ago #134583 by mattheoh
Hi,
I confirm what you are saying...
when you add some code or expressions in the source code. Then you save and go back in your question , the WYSIWYG added some <p> and duplicates other markers

For example, in my cas, this line :
<span style="color:#ff0000;">{if (CH3Q2.NAOK == 'O',"<p>Oui : S'assurer que les opérateurs même pour une courte durée sont formés aux BPF/ aux tâches confiées</p>","")} </span>
will be transform in this mess ! ^^
<span style="color:#ff0000;">{if (CH3Q2.NAOK == 'O',"</span>
<p>
	<span style="color:#ff0000;">Oui : S'assurer que les opérateurs même pour une courte durée sont formés aux BPF/ aux tâches confiées</span></p>
<span style="color:#ff0000;">","")} </span>

quite annoying. Only solution is to disable editor.
Last edit: 3 years 7 months ago by mattheoh.

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #134596 by holch
Replied by holch on topic Problems with <p> in editor
In my experience, all WYSIWYG editors create a mess at some point.

Which is why I usually disable the editors all along. The few things you usually need to style in a survey can be learned in about 10min I guess.

So I am not sure if this is actually a bug or just the same old crap from the WYSIWYG editors.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #134597 by mattheoh
You're perfectly right, it's the same thing with a lot of editors (I had some bad experience in Joomla for example)
It's not a problem for me... It will be just less friendly for some of my users when they will want to edit a question. I will teach them ! no a big deal ! ;)

Please Log in or Create an account to join the conversation.

More
3 years 7 months ago #134622 by DenisChenu
Alternative solution :
- Replace HTML editor by mardown. With preview : jbt.github.io/markdown-editor/

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!