[xwiki-devs] Not allowing the code macro in inline mode when there are NL inside
Hi, Right now we support code macro in both inline and standalone modes. However the style isn't nice if the macro is inline and on several lines. For ex: This is {{code language="java"}} public class LoggingEventListener implements EventListener { } {{/code}} inline I'm proposing to test in the code macro if there are NL in the macro content and if so and if the macro is inline then generate an error explaining that the macro but not be inline to use multi line content. WDYT? Thanks -Vincent
Hi, On Fri, Aug 28, 2009 at 6:17 PM, Vincent Massol <[email protected]> wrote:
Hi,
Right now we support code macro in both inline and standalone modes. However the style isn't nice if the macro is inline and on several lines.
For ex:
This is {{code language="java"}} public class LoggingEventListener implements EventListener { } {{/code}} inline
I'm proposing to test in the code macro if there are NL in the macro content and if so and if the macro is inline then generate an error explaining that the macro but not be inline to use multi line content.
WDYT?
What about automatically displaying it as if it were standalone if there are new lines in it instead of generating an error? Guillaume
Thanks -Vincent
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Lerouge Product Manager - XWiki Skype: wikibc Twitter: glerouge http://guillaumelerouge.com/
On Aug 28, 2009, at 6:35 PM, Guillaume Lerouge wrote:
Hi,
On Fri, Aug 28, 2009 at 6:17 PM, Vincent Massol <[email protected]> wrote:
Hi,
Right now we support code macro in both inline and standalone modes. However the style isn't nice if the macro is inline and on several lines.
For ex:
This is {{code language="java"}} public class LoggingEventListener implements EventListener { } {{/code}} inline
I'm proposing to test in the code macro if there are NL in the macro content and if so and if the macro is inline then generate an error explaining that the macro but not be inline to use multi line content.
WDYT?
What about automatically displaying it as if it were standalone if there are new lines in it instead of generating an error?
Because it's an error... It's not standalone... It's not right for a macro such as this one to start modifying the XDOM content. Ex: This is {{sommacro/}} something generates: - begin para - onword - onspace - onword - onspace - (result of macro inserted here) - onspace - onword Renderers don't know anything about the macro and putting non inline block in a paragraph block is invalid. Thanks -Vincent
+0, but what about display:inline-block ? Thanks, Marius Vincent Massol wrote:
Hi,
Right now we support code macro in both inline and standalone modes. However the style isn't nice if the macro is inline and on several lines.
For ex:
This is {{code language="java"}} public class LoggingEventListener implements EventListener { } {{/code}} inline
I'm proposing to test in the code macro if there are NL in the macro content and if so and if the macro is inline then generate an error explaining that the macro but not be inline to use multi line content.
WDYT?
Thanks -Vincent
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Aug 29, 2009, at 10:17 AM, Marius Dumitru Florea wrote:
+0, but what about display:inline-block ?
This sounds like a good idea. I'll implement that. Thanks -Vincent
Thanks, Marius
Vincent Massol wrote:
Hi,
Right now we support code macro in both inline and standalone modes. However the style isn't nice if the macro is inline and on several lines.
For ex:
This is {{code language="java"}} public class LoggingEventListener implements EventListener { } {{/code}} inline
I'm proposing to test in the code macro if there are NL in the macro content and if so and if the macro is inline then generate an error explaining that the macro but not be inline to use multi line content.
WDYT?
Thanks -Vincent
Done. Haven't tested it on IE6/7 though. If someone who IE6/7 could test it that would be great. Thanks -Vincent On Aug 29, 2009, at 4:42 PM, Vincent Massol wrote:
On Aug 29, 2009, at 10:17 AM, Marius Dumitru Florea wrote:
+0, but what about display:inline-block ?
This sounds like a good idea. I'll implement that.
Thanks -Vincent
Thanks, Marius
Vincent Massol wrote:
Hi,
Right now we support code macro in both inline and standalone modes. However the style isn't nice if the macro is inline and on several lines.
For ex:
This is {{code language="java"}} public class LoggingEventListener implements EventListener { } {{/code}} inline
I'm proposing to test in the code macro if there are NL in the macro content and if so and if the macro is inline then generate an error explaining that the macro but not be inline to use multi line content.
WDYT?
Thanks -Vincent
Vincent Massol wrote:
Hi,
Right now we support code macro in both inline and standalone modes. However the style isn't nice if the macro is inline and on several lines.
For ex:
This is {{code language="java"}} public class LoggingEventListener implements EventListener { } {{/code}} inline
I'm proposing to test in the code macro if there are NL in the macro content and if so and if the macro is inline then generate an error explaining that the macro but not be inline to use multi line content.
WDYT?
+1, if we do allow to put code blocks inside a group. -- Sergiu Dumitriu http://purl.org/net/sergiu/
On Aug 29, 2009, at 1:26 PM, Sergiu Dumitriu wrote:
Vincent Massol wrote:
Hi,
Right now we support code macro in both inline and standalone modes. However the style isn't nice if the macro is inline and on several lines.
For ex:
This is {{code language="java"}} public class LoggingEventListener implements EventListener { } {{/code}} inline
I'm proposing to test in the code macro if there are NL in the macro content and if so and if the macro is inline then generate an error explaining that the macro but not be inline to use multi line content.
WDYT?
+1, if we do allow to put code blocks inside a group.
Yes we do. A group block will break the inline flow. For ex: This is ((({{code language="java"}} public class LoggingEventListener implements EventListener { } {{/code}}))) inline is the same as: This is {{code language="java"}} public class LoggingEventListener implements EventListener { } {{/code}} inline Thanks -Vincent
participants (4)
-
Guillaume Lerouge -
Marius Dumitru Florea -
Sergiu Dumitriu -
Vincent Massol