walle / gimli

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

Incorrect handling of escaping inside code blocks #90

Open patrickdepinguin opened 6 years ago

patrickdepinguin commented 6 years ago

Input:

```
sed 's/\(..\)/\\\x\1/g'
```

Debug output:

"/home/tdescham/.gem/ruby/2.2.0/bin/wkhtmltopdf"  -q - "/tmp/test.pdf"
<div class="CodeRay">
  <div class="code"><pre>sed 's/\(..\)/\\x/g'</pre></div>
</div>

The input code is no longer the same, the triple backslashes became 2, and the \1 backreference disappeared.

Tested with 0.5.9.