Feature #8120

Code syntax highlighting in Wiki only works with Textile formatting

Added by Ebrahim Mohammadi over 3 years ago. Updated over 3 years ago.

Status:NewStart date:2011-04-10
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Text formatting
Target version:-
Resolution:

Description

Code syntax highlighting in Wiki only works with Textile formatting. However it could/should be formatting-independent. So that any Wiki formatting that produces some < code class="xyz" > (spaces added to prevent parsing) gets a syntax-highlighted code.

Currently the code is at source:trunk/lib/redmine/wiki_formatting/textile/formatter.rb@5386#L50. However I guess a more generic variant of the code could be moved to source:trunk/app/helpers/application_helper.rb besides textilizable, parse_*, replace_toc, ...

History

#1 Updated by Ebrahim Mohammadi over 3 years ago

I messed up the description by not escaping a <code> tag. I wish I could update the description.

#2 Updated by Mischa The Evil over 3 years ago

  • Tracker changed from Defect to Feature
  • Category set to Text formatting

Fixed description and tracker (it seems a feature-request to me) and selected category.

#3 Updated by Ebrahim Mohammadi over 3 years ago

Another choice is implementing a formatting-independent syntax highlighter in client side, using something like Sunlight.

#4 Updated by Ebrahim Mohammadi over 3 years ago

Another JavaScript and CSS based client-side option is Google's Code Prettifier.

#5 Updated by Ebrahim Mohammadi over 3 years ago

Yet another client-side syntax highlighter, but this one already has a Rails plugin: https://github.com/antono/sh2

Also available in: Atom PDF