diff --git a/plugins/backtick_code_block.rb b/plugins/backtick_code_block.rb index 6243de6fd3b..40e7900b540 100644 --- a/plugins/backtick_code_block.rb +++ b/plugins/backtick_code_block.rb @@ -10,7 +10,7 @@ def render_code_block(input) @lang = nil @url = nil @title = nil - input.gsub /^`{3} *([^\n]+)?\n(.+?)\n`{3}/m do + input.gsub(/^`{3} *([^\n]+)?\n(.+?)\n`{3}/m) do @options = $1 || '' str = $2 @@ -22,8 +22,8 @@ def render_code_block(input) @caption = "
#{$2}
" end - if str.match(/\A {4}/) - str = str.gsub /^ {4}/, '' + if str.match(/\A( {4}|\t)/) + str = str.gsub(/^( {4}|\t)/, '') end if @lang.nil? || @lang == 'plain' code = tableize_code(str.gsub('<','<').gsub('>','>'))