diff options
author | Frederic Hemberger <mail@frederic-hemberger.de> | 2011-10-16 12:02:14 +0200 |
---|---|---|
committer | Frederic Hemberger <mail@frederic-hemberger.de> | 2011-10-16 12:02:14 +0200 |
commit | 1772a8af8f22f2f89d263285be2815ebad6189fa (patch) | |
tree | 5f21c89f38eadca2849cfa65716cd36c13ee3c5d /plugins | |
parent | d98a4de07ec8727b10c3f059c1fbee3e19d01761 (diff) | |
download | my_new_personal_website-1772a8af8f22f2f89d263285be2815ebad6189fa.tar.xz my_new_personal_website-1772a8af8f22f2f89d263285be2815ebad6189fa.zip |
Removes also leading tab from backtick codeblock
Diffstat (limited to '')
-rw-r--r-- | plugins/backtick_code_block.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/backtick_code_block.rb b/plugins/backtick_code_block.rb index 6243de6f..40e7900b 100644 --- a/plugins/backtick_code_block.rb +++ b/plugins/backtick_code_block.rb @@ -10,7 +10,7 @@ module BacktickCodeBlock @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 @@ module BacktickCodeBlock @caption = "<figcaption><span>#{$2}</span></figcaption>" 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('>','>')) |