judofyr/temple — Issue #57: Temple modified incoming strings when :pretty => true
Author: ddfreyne
Created: 2011-12-20 20:26:18+00:00
State: open

Strings given to Temple are modified by a `#gsub!` which should not happen. Here is a test case:

```ruby
# encoding: utf-8

CONTENT = < true

foo = "abc\n"
puts "BEFORE: #{foo.inspect}"
::Slim::Template.new { CONTENT }.render { foo }
puts "AFTER: #{foo.inspect}"

# output:
#
# BEFORE: "abc\n"
# AFTER: "abc\n "
```

A fix for this would be to replace line 41 in `lib/temple/html/pretty.rb` that says

```ruby
"#{tmp}.gsub!(\"\\n\", #{indent.inspect})"
```

with

```ruby
"#{tmp} = #{tmp}.gsub(\"\\n\", #{indent.inspect})"
```