Re-encoding of input string rather than force encoding. This is safer/more valid

Signed-off-by: Brandon Mathis <brandon@imathis.com>
This commit is contained in:
Avery Yen 2012-05-11 19:59:03 -04:00 committed by Brandon Mathis
parent dd5f3d3fef
commit 19320018b2

View File

@ -10,7 +10,7 @@ module BacktickCodeBlock
@lang = nil
@url = nil
@title = nil
input.force_encoding('UTF-8')
input.encode!("UTF-8")
input.gsub(/^`{3} *([^\n]+)?\n(.+?)\n`{3}/m) do
@options = $1 || ''
str = $2