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.

Don't require code tags to be wrapped by pre tags (Feature #228)


Added by Ian Freeman at 2011-02-26 10:45 am. Updated at 2011-03-01 09:33 pm.


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

0%

Category:Text formatting
Target version:-
Remote issue URL: Affected version:

Description

I don't know if this is possible with the external redcloth and coderay components, but it seems it should be straight-forward to parse out <code> blocks before the rest of the normal wiki parsing so that you don't have to wrap <code> tags in <pre> tags, which just seems silly.


History

Updated by Eric Thomas at 2011-02-26 05:36 pm

Every single tag gets stripped unless it's contained with a < pre > tag. Pretty sure this is not possible without hacking up redcloth and putting it a special exception for the < code > tag. Technically for code blocks in textile, there supposed to be done with the bc tag, see here.

Updated by Ian Freeman at 2011-02-28 06:41 am

Essentially this special hacking of redcloth was what I was asking for. However, this bit on RedCloth's site makes me think they no longer allow code tags inside of pre. If that's true, what's the way forward? bc..? Somehow I just don't like that syntax. :(

Preformatted text can be put in a pre. block and its whitespace will be preserved. pre. is almost identical to bc., except that < code >...< /code > tags are not used within the < pre > block.

Updated by Eric Thomas at 2011-03-01 05:07 am

I agree Ian, bc.. is just plain ugly. Furthermore, as I note in #210, it makes integration into coderay more difficult as two consecutive newlines create a new code block.
I think we should stick with the current format the way it is now and not even use bc...

As to your issue, the user should be allowed to omit the pre tags when using the code tag in which case in which case the pre tag would be wrapped around it internally (the only way it can get around redcloth's html safe encoding). Tests definitely need to be written for this especially since there are no tests for the current redcloth hacks.

Updated by Ian Freeman at 2011-03-01 09:33 pm

related to #210.

Also available in: Atom PDF