jekyll/jekyll — pull request #2264 by robin850 (2014-04-27 10:23:00+00:00)
Title: Avoid duplicated output using highlight tags

Hello,

This tiny patch fixes a bug while using Rouge with `highlight` tags. The output was duplicated since the `output` variable in the Liquid tag definition was equal to the highlighter's prefix value and the `<<` method changes its receiver.

Therefore, we should simply define an empty string and append the prefix if it is present.

I noticed that this is only happening with posts (not index.html for instance).

I did not manage to write a failing test though so I wrote a feature (see [this gist](https://gist.github.com/robin850/4e7bee99d96cddba3093) ; let me know if I'm doing something wrong). The assertion is also a bit tricky/brittle ; let me know if you have a better idea to ensure that there is only a single `.highlight` div.

There are also other pull requests about this area of the code (i.e. #2221 and #2154) but I don't know which one you are going to ship and Jekyll 2.0 is already at the release candidate step so I take the liberty to send the proper fix here.

Have a nice day.