doddoreul / google-code-prettify

Automatically exported from code.google.com/p/google-code-prettify
Apache License 2.0
0 stars 0 forks source link

Candidate ruby module #203

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This ruby module adds the following:

 1. heredocs of the form `<<HEREDOC`, `<<-HEREDOC`, `<<'HEREDOC spaces allowed'`, `<<-'HEREDOC spaces allowed'`
 2. strings of the form 's', "s", `s`, %q{}, %q[], %q(), %q<>, and the corresponding %Q forms (all forms supporting multiline strings and escaped quotes)
 3. regexes of the form /r/options, %r{}, %r[], %r(), %r<> (all forms supporting multiline regexes and escaped delimiters)
 4. scope variables of the form @foo, @@foo, $foo
 5. comments of the form =begin, =end

I tested this module against rack, and also created an html unit test. I am 
aware of the following issues:

 1. `1 / 2 / 3`: / 2 / is interpreted as regex instead of division
 2. `?/ foo /`is interpreted as regex when ?/ should be the character "/"

Also, a note: Even though ruby is currently built into prettify core, it seemed 
best to implement this as a separate module since the patterns have changed so 
much. If this means anything, I have previously contributed to rainbow.js, so I 
have some prior experience with prettifying ruby. 

Let me know what you think. I would be happy to make changes.

Original issue reported on code.google.com by matthew....@gmail.com on 8 Apr 2012 at 11:14

Attachments: