[xwiki-devs] Something to be aware of when using velocity macro and wiki syntax mixed
Hi everyone, Example: ----- %> cut here -------- ... something #end ## some comment {{warning..../}} ----- %> cut here -------- Quizz: Will the macro be inline or standalone? Answer: inline Reason is that velocity will start by removing the comment, which will leave a whitespace after the #end Thus you'll get: something + NL + (space) + NL + warning macro Thus since there are no 2 NLs before the macro it's going to be inline! Thanks -Vincent
In general I think the best rule is to not mix velocity macro and wiki syntax as much as possible. -Vincent On Sep 18, 2009, at 1:00 PM, Vincent Massol wrote:
Hi everyone,
Example:
----- %> cut here -------- ... something #end ## some comment
{{warning..../}} ----- %> cut here --------
Quizz: Will the macro be inline or standalone? Answer: inline
Reason is that velocity will start by removing the comment, which will leave a whitespace after the #end
Thus you'll get: something + NL + (space) + NL + warning macro
Thus since there are no 2 NLs before the macro it's going to be inline!
Thanks -Vincent
Hi Vincent What is NL? -arvind On Fri, Sep 18, 2009 at 07:06, Vincent Massol <[email protected]> wrote:
In general I think the best rule is to not mix velocity macro and wiki syntax as much as possible.
-Vincent
On Sep 18, 2009, at 1:00 PM, Vincent Massol wrote:
Hi everyone,
Example:
----- %> cut here -------- ... something #end ## some comment
{{warning..../}} ----- %> cut here --------
Quizz: Will the macro be inline or standalone? Answer: inline
Reason is that velocity will start by removing the comment, which will leave a whitespace after the #end
Thus you'll get: something + NL + (space) + NL + warning macro
Thus since there are no 2 NLs before the macro it's going to be inline!
Thanks -Vincent
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Sep 18, 2009, at 3:30 PM, Arvind Gupta wrote:
Hi Vincent What is NL?
a new line -Vincent
-arvind
On Fri, Sep 18, 2009 at 07:06, Vincent Massol <[email protected]> wrote:
In general I think the best rule is to not mix velocity macro and wiki syntax as much as possible.
-Vincent
On Sep 18, 2009, at 1:00 PM, Vincent Massol wrote:
Hi everyone,
Example:
----- %> cut here -------- ... something #end ## some comment
{{warning..../}} ----- %> cut here --------
Quizz: Will the macro be inline or standalone? Answer: inline
Reason is that velocity will start by removing the comment, which will leave a whitespace after the #end
Thus you'll get: something + NL + (space) + NL + warning macro
Thus since there are no 2 NLs before the macro it's going to be inline!
Thanks -Vincent
Vincent Massol wrote:
Hi everyone,
Example:
----- %> cut here -------- ... something #end ## some comment
{{warning..../}} ----- %> cut here --------
Quizz: Will the macro be inline or standalone? Answer: inline
Reason is that velocity will start by removing the comment, which will leave a whitespace after the #end
Thus you'll get: something + NL + (space) + NL + warning macro
And then the (space) will be trimmed, leaving two NLs and an inline macro. IMO, this space should not be taken into account when determining if the macro is inline or block.
Thus since there are no 2 NLs before the macro it's going to be inline!
-- Sergiu Dumitriu http://purl.org/net/sergiu/
On Fri, Sep 18, 2009 at 20:22, Sergiu Dumitriu <[email protected]> wrote:
Vincent Massol wrote:
Hi everyone,
Example:
----- %> cut here -------- ... something #end ## some comment
{{warning..../}} ----- %> cut here --------
Quizz: Will the macro be inline or standalone? Answer: inline
Reason is that velocity will start by removing the comment, which will leave a whitespace after the #end
Thus you'll get: something + NL + (space) + NL + warning macro
And then the (space) will be trimmed, leaving two NLs and an inline macro.
Not exactly, the XDOM contains a space, the fact that it produce a <br> <br> instead of <br> <br> is a xhtml renderer bug.
IMO, this space should not be taken into account when determining if the macro is inline or block.
Thus since there are no 2 NLs before the macro it's going to be inline!
-- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
participants (4)
-
Arvind Gupta -
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol