Defect #2629
closedEmbedded plugin stripping leading spaces causes problems with <pre> formatted blocks
0%
Description
We are using the Embedded plugin (version 0.0.1) to render javadoc HTML.
The vendor/plugins/embedded/app/controllers/embedded_controller.rb has the following code inside embed_file(path):-
# Strip leading spaces to reduce file size @content.gsub!(%r{^\s+}, '')
Unfortunately this strips out the leading spaces out of all lines, including lines that are enclosed with PRE tags which destroys the formatting of the blocks and makes the javadoc harder to read. I've commented the line out of our deployment and the problem is resolved (although we are therefore wasting a small amount of bandwidth).
I would propose that this change is made standard, and if bandwidth is really a problem then either adding a switch for this behaviour, or adding some further code to work out whether or not stripping the whitespace out of the line really is "transparent" from an html viewpoint before doing it, but I suspect that the bandwidth savings wouldn't be worth the effort.
The version we are running is Redmine 0.8.0.devel.2263 on:-
About your application's environment
Ruby version 1.8.6 (i686-linux)
RubyGems version 1.3.0
Rails version 2.1.2
Active Record version 2.1.2
Action Pack version 2.1.2
Active Resource version 2.1.2
Action Mailer version 2.1.2
Active Support version 2.1.2
Application root /data/home/redmine/redmine-trunk
Environment development
Database adapter mysql
Updated by Jean-Philippe Lang over 16 years ago
- Status changed from New to Closed
- Resolution set to Fixed
You're right. This behaviour is removed in r2517.