20040113 Tuesday January 13, 2004

[New Feature] Wiki Syntax support added to comments For you, my friends, I've added the ability to use JSPWiki syntax when writing comments. All you need to do is start your comment with an exclamation point - ! Hopefully this will help add automatic line-breaks when you add a line-break in the textarea, as well as making it easier for you to you to type in any code. If you're typing or pasting in Java code, try using the Java2HtmlPlugin. It's easy to use, just type the starting and closing tags, and insert a blank line before your code. For example, here's the raw text.

[{Java2HtmlPlugin 

public class HelloWorld {  
  public static void main(String args[]) {
    System.out.println("Hello World!");
  }
}
}]

I don't know if the "Preview" button (from the Permalink) supports it, but I've added the following to both twisty comments and regular comments.

        #if($content.startsWith("!"))
            #set( $wikiText = $stringUtils.substring($content,1))
            #set( $renderedText = $wikiPlugin.render($wikiText))
        #else
            #set( $renderedText = $content )  
        #end
            $renderedText

Enjoy! Posted in Roller at Jan 13 2004, 05:48:44 PM MST 3 Comments

Comments:

!Testing, testing - will this point to [AppFuse]? ''Sweet - it works in Preview!'' Does it do the auto-line breaks? I'd expect a blank line between the two lines above, but I'm only getting one. It's wierd that it works above this line, but not above the previous line. Oh well, better than nothing - just remember to Preview. Now, how about some Java code? [{Java2HtmlPlugin public class HelloWorld { public static void main(String args[]) { System.out.println("Hello World!"); } }] \\ <em>Very cool!</em>

Posted by Matt Raible on January 13, 2004 at 06:54 PM MST #

Hmm, it works well on the web, but comes across as plain wiki syntax in e-mails. Oh well, use at your own risk.

Posted by Matt Raible on January 13, 2004 at 07:17 PM MST #

I can't look at the source right now, but I suspect that the content of the email is being pulled straight out of the database and not going through any 'renderer'. Also, this is likely to not work in the popup comments since those don't (currently) use the velocimacros. This is something on my ToDo list, however I haven't had the time nor energy to work on Roller for quite some time.

Posted by Lance on January 14, 2004 at 09:11 AM MST #

Post a Comment:
  • HTML Syntax: Allowed
Click me to subscribe
Matt Raible is a Web Architecture Consultant specializing in open source frameworks.
« May 2012
SunMonTueWedThuFriSat
  
1
2
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
23
24
25
26
27
28
29
30
31
  
       
Today

Recent Entries

Tag Cloud