ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Bump redcloth version (Feature #210)


Added by Eric Thomas at 2011-02-19 10:15 am. Updated at 2011-12-11 04:01 pm.


Status:Open Start date:2011-02-19
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:Libraries
Target version:-
Remote issue URL: Affected version:

Description

The current redcloth is very old and a lot of improvements have been made to it.
This commit upgrades redcloth to the stable version (4.2.2).

I have another commit which integrates it with CodeRay, but first a question:
Blocks of code are done with bc[ruby].. code, see here.
I couldn't find any reference to pre/code class="ruby" in the redcloth textile documentation. Was this redmine specific?
Should ChiliProject support both ways of formatting code or one way (if one, which one?).


Associated revisions

Revision 2920daf2
Added by Jean-Philippe Lang at 2008-02-03 04:34 pm

Do not use RedCloth's glyphs (#210).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1113 e93f8b46-1217-0410-a6f0-8f06a7374b81

History

Updated by Felix Schäfer at 2011-02-19 11:51 am

IIRC redcloth 4 has binary parts that aren't windows-compatible, am I mistaken?

Updated by Eric Thomas at 2011-02-19 04:44 pm

Felix Schäfer wrote:

IIRC redcloth 4 has binary parts that aren't windows-compatible, am I mistaken?

I seem to remember a response from matz to someone who remarked that the latest release of ruby didn't work on windows to which he replied (something along these lines): "I don't use windows, so I don't care."

I wish everyone had this philosophy.

All kidding aside, according to the redcloth homepage:

RedCloth will compile the C extension and install. RedCloth is available for native Ruby, JRuby, and Win32 platform.

I have zero experience with running ruby on windows nor do I have access to a windows box so I really have no way of testing this. Can anybody assist?

Updated by Aleksey Zapparov at 2011-02-19 05:26 pm

If it does matter, I can check RedCloth on Windows, just tell me which version of it against which version of Ruby you want me to check, so I'll check it on one of my WinXP boxes.

Updated by Eric Thomas at 2011-02-19 05:38 pm

Aleksey, I ran it on the master branch with RedCloth 4.2.2 and ruby 1.9.2.

From what I've gathered on RedCloth's website, it looks like ruby >=1.8.6 is supported, so could you try it with ruby 1.8.7? Thanks!

Updated by Eric Davis at 2011-02-19 11:13 pm

If someone can test RedCloth with Ruby 1.8.7 and 1.9.2 on Windows that would be great. I think coderay is the part that uses the pre/code blocks but I could be wrong.

Updated by Ian Freeman at 2011-02-20 01:05 am

It's easy to do a virtualbox vm, although I agree, who cares about hosting a website on windows? :)

Updated by Eric Thomas at 2011-02-20 05:25 am

Eric Davis wrote:

I think coderay is the part that uses the pre/code blocks but I could be wrong.

It is done here:
source:lib/redmine/wiki_formatting/textile/formatter.rb#L55

Basically takes < pre >< code class="ruby" > and translates it to < pre >< code class="syntaxhl ruby" > CodeRay formatting etc. etc.

Looking closely at the output of bc.., it looks like it should stay the same since when skipping a line with bc, RedCloth creates a new block.
Consider this example

bc[ruby].. def hello_world
  puts "hello world" 
end

def goodbye_world
  puts "goodbye world" 
end

RedCloth will create the following:

< pre >
< code lang="ruby" >
def hello_world
  puts "hello world" 
end
< /code >

< code lang="ruby" >
def goodbye_world
  puts "goodbye world" 
end
< /code >
< / pre>

Since there are two < code > sections, it would be treated as if there are two separate code blocks which is probably not what the user intended.
I propose to not even include the bc tag and just stick with the current format.

Updated by Felix Schäfer at 2011-02-20 05:04 pm

Back to the original point :-) I'm OK with upgrading redcloth if it works on windows too, I think that's big enough to hold it for 2.0.0 though.

  • Target version set to 2.0.0

Updated by Ian Freeman at 2011-03-03 01:04 pm

Eric Davis wrote:

If someone can test RedCloth with Ruby 1.8.7 and 1.9.2 on Windows that would be great.

I'm attempting to do so but I am a complete noob when it comes to rails and ruby. I can't seem to include the redcloth gem with ruby 1.8.7 on windows/mongrel.

I get this:

undefined local variable or method `version_requirements' for #<Rails::GemDependency:0x4b258a8>

When trying to rake gems:install or mongrel_rails start after config.gem "RedCloth" and require 'RedCloth' in environmet.rb of a test rails app.

I don't expect help from this forum on troubleshooting this, as it may be completely unrelated to RedCloth. But, I'll keep trying...

Updated by Holger Just at 2011-03-03 01:12 pm

Ian Freeman wrote:

I get this:

undefined local variable or method `version_requirements' for #<Rails::GemDependency:0x4b258a8>

This errors comes from your rubygems which is too new. The 1.1.0 — Bell release has fixes for rubygems 1.5, the current master for 1.6.0 (#251). Your safest bet is to use a rubygems < 1.5.

Updated by Ian Freeman at 2011-03-07 12:49 am

gem -v says 1.5.2. I was using master current when I posted. Still try older gem?

Updated by Eric Thomas at 2011-03-07 03:56 am

Ian I am using version 1.6.2 on the master with no problem.

Updated by Ian Freeman at 2011-03-07 06:53 pm

I'm now using 1.6.1 with fewer problems. Now trying to sort out syntax errors on load calls (as reported by mongrel_rails start -e production).

You may want to reconfirm that master works with gem 1.5 (did not for me).

Updated by Holger Just at 2011-03-07 06:56 pm

@Ian. The current 1.1 release should work with rubygems 1.5, the current master with 1.6. If there are still bugs, please re-open #251, but don't re-purpose other issues.

Updated by Eric Davis at 2011-03-18 05:56 pm

I'm removing this from the 2.0.0 target until someone commits to upgrading it.

  • Target version deleted (2.0.0)
  • Category changed from Text formatting to Libraries

Updated by Felix Schäfer at 2011-12-03 07:00 pm

I had nearly forgotten about that. I just gave it a spin, and tl;dr: It works, redclotch4 works on windows, mri and jruby, but we'd need to port the 2 autolinking and the highlighting rule to redcloth4.

If I understood Holger correctly, redcloth4 would also allow us to port all the custom markup to redcloth rules, those wouldn't be available to other formatter anymore though.

I'd like us to at least consider this for 3.0 as the next time we'll be able to bump it is middle of next year.

Updated by Felix Schäfer at 2011-12-11 04:01 pm

My current work is on a branch in my repo on github: https://github.com/thegcat/chiliproject/tree/feature/210/redcloth4

Status: the Redmine::WikiFormatting::TextileFormatterTest go through but for a double-escaping problem in a @-block, the problem though is that the ragel implementation makes it harder to hop in in-between the built-in methods/rules, so I'm not so sure that we would benefit much from upgrading after all.

Also available in: Atom PDF