Fix fenced code extension modifying data beyond slice

I had an issue whereby I was feeding an array slice into blackfriday, and it was modifying data beyond the end of the slice by adding a `\n` and in the process overwriting the data that was already there.

Turns out the `append` here was responsible, so I've changed this to use a temporary variable instead.