walle / gimli

Utility for converting markup files to pdf files
https://github.com/walle/gimli
MIT License
538 stars 44 forks source link

Fix garbled characters with code blocks including utf-8 strings #51

Closed toshi-kawanishi closed 10 years ago

toshi-kawanishi commented 10 years ago

The utf-8 strings in code blocks seem to be garbled.

So I add a spec with a utf-8 fixture and it is failed:

Failures:

  1) Gimli::Markup::Renderer should render html with code blocks including utf-8 strings
     Failure/Error: markup.render.strip.should == output.strip
       expected: "<div class=\"CodeRay\">\n  <div class=\"code\"><pre>まつもとゆきひろ</pre></div>\n</div>"
            got: "<div class=\"CodeRay\">\n  <div class=\"code\"><pre>������������������������</pre></div>\n</div>" (using ==)
       Diff:
       @@ -1,4 +1,4 @@
        <div class="CodeRay">
       -  <div class="code"><pre>まつもとゆきひろ</pre></div>
       +  <div class="code"><pre>������������������������</pre></div>
        </div>
     # ./spec/gimli/markup/renderer_spec.rb:28:in `block (2 levels) in <top (required)>'

The changes fix this issue.

walle commented 10 years ago

Thank you for your fix! This is now in the 0.5.4 release. Sorry again for the long wait.

toshi-kawanishi commented 10 years ago

Thanks