Removes also leading tab from backtick codeblock
This commit is contained in:
parent
d98a4de07e
commit
1772a8af8f
@ -10,7 +10,7 @@ module BacktickCodeBlock
|
|||||||
@lang = nil
|
@lang = nil
|
||||||
@url = nil
|
@url = nil
|
||||||
@title = nil
|
@title = nil
|
||||||
input.gsub /^`{3} *([^\n]+)?\n(.+?)\n`{3}/m do
|
input.gsub(/^`{3} *([^\n]+)?\n(.+?)\n`{3}/m) do
|
||||||
@options = $1 || ''
|
@options = $1 || ''
|
||||||
str = $2
|
str = $2
|
||||||
|
|
||||||
@ -22,8 +22,8 @@ module BacktickCodeBlock
|
|||||||
@caption = "<figcaption><span>#{$2}</span></figcaption>"
|
@caption = "<figcaption><span>#{$2}</span></figcaption>"
|
||||||
end
|
end
|
||||||
|
|
||||||
if str.match(/\A {4}/)
|
if str.match(/\A( {4}|\t)/)
|
||||||
str = str.gsub /^ {4}/, ''
|
str = str.gsub(/^( {4}|\t)/, '')
|
||||||
end
|
end
|
||||||
if @lang.nil? || @lang == 'plain'
|
if @lang.nil? || @lang == 'plain'
|
||||||
code = tableize_code(str.gsub('<','<').gsub('>','>'))
|
code = tableize_code(str.gsub('<','<').gsub('>','>'))
|
||||||
|
Loading…
Reference in New Issue
Block a user