This question about Using an extension: Answered

No Carriage Return (\n) at the end of %FIDEFINED% tag when you use %ELSEDEFINED%

Example:

---
%IFDEFINEDTHEN{'test'}%
Item 1<br>
Item 2
%FIDEFINED%
---
%IFDEFINEDTHEN{'test'}%
Item 1<br>
Item 2
%ELSEDEFINED%
Item 3
%FIDEFINED%
---

Is rendered (wrong):


%IFDEFINEDTHEN{'test'}% Item 1
Item 2 %FIDEFINED%
%IFDEFINEDTHEN{'test'}% Item 1
Item 2 %ELSEDEFINED% Item 3 %FIDEFINED%

Correct rendering:


%IFDEFINEDTHEN{'test'}% Item 1
Item 2 %FIDEFINED%
%IFDEFINEDTHEN{'test'}% Item 1
Item 2 %ELSEDEFINED% Item 3 %FIDEFINED%

Note

If you use %ELSEDEFINED% tag the rendering is wrong. Probably a carriage return is missing at the end of %FIDEFINED% tag

-- GuidoBrugnara - 23 Aug 2010

That's not a bug, that's a feature. See the documentation about "glue". Both IFDEFINED as well as its block version support "eating up" white spaces at both ends of the macro. This can be turned off with glue="off" .

-- MichaelDaum - 23 Aug 2010

For me it is not intuitive, I can understand a "glue" default value to "off" ... but it matches your specifications.
I'm sorry for my needless question.

-- GuidoBrugnara - 23 Aug 2010

QuestionForm edit

Subject Using an extension
Extension IfDefinedPlugin
Version Foswiki 1.0.9
Status Answered
Topic revision: r3 - 23 Aug 2010, GuidoBrugnara
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy