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

TOPIC: Parser problems

Parser problems 4 years 1 month ago #80989

  • AlDemion
  • AlDemion's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
Hi all.
I have e problems with LimeSurvey parser.
I need to create tests with source code examples in questions, and parser try to parse this source code, so i see corrupted question.

Can i disable parser for some parts of question like <noparse> {i don't want to parse this text} <<and<< <<this>> "Text" (Too) </noparse>
The administrator has disabled public write access.

Parser problems 4 years 1 month ago #80990

  • DenisChenu
  • DenisChenu's Avatar
  • Online
  • Moderator Lime
  • Posts: 9258
  • Thank you received: 1319
  • Karma: 382
Hello,

You can disable HTML editor.

To use < and > , use & lt; and & gt; : it's not limesurvey, it's HTML.

Denis
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.

Parser problems 4 years 1 month ago #80992

  • AlDemion
  • AlDemion's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
I know it.
But now i'm talking about question display.
Its question code
<pre class="cpp" style="font-family:monospace;">
class Base
{
public:
virtual void foo(int n = 5) { cout<<"Base::foo("<<n<<")"<<endl;}
};

class Derived
{
public:
void foo(int n = 10) { cout<<"Derived::foo() "<<n<<")"<<endl;}
};

int main()
{
Base *b = new Derived;
b->foo();
}
</pre>
Which one of the following messages is displayed when you run the sample code above?

And result you may see on the screenshot.
Last Edit: 4 years 1 month ago by AlDemion.
The administrator has disabled public write access.

Parser problems 4 years 1 month ago #80993

  • DenisChenu
  • DenisChenu's Avatar
  • Online
  • Moderator Lime
  • Posts: 9258
  • Thank you received: 1319
  • Karma: 382
For complex code, i use < textarea >

It work like a chram, an you can give a look with css too.

Denis
PS: LS parse only {SOMETHING} but you can do like this { SOMETHING }
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
Last Edit: 4 years 1 month ago by DenisChenu.
The administrator has disabled public write access.

Parser problems 4 years 1 month ago #81003

  • TMSWhite
  • TMSWhite's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 758
  • Thank you received: 83
  • Karma: 37
To clarify, if you use curly braces and want LS NOT to parse the contents, you must add a space after the opening curly brace and a space before the closing curly brace.

So, instead of this:
{i don't want to parse this text}
use this:
{ i don't want to parse this text }
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.214 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form